websocket: make esp_websocket_client_send_with_opcode a public API

This commit is contained in:
Suren Gabrielyan
2022-10-31 20:17:09 +04:00
parent 55c1223a1e
commit 3330b96b10
3 changed files with 18 additions and 5 deletions

View File

@ -15,6 +15,7 @@
#include "esp_err.h"
#include "esp_event.h"
#include <sys/socket.h>
#include "esp_transport_ws.h"
#ifdef __cplusplus
extern "C" {
@ -193,6 +194,21 @@ int esp_websocket_client_send_bin(esp_websocket_client_handle_t client, const ch
*/
int esp_websocket_client_send_text(esp_websocket_client_handle_t client, const char *data, int len, TickType_t timeout);
/**
* @brief Write opcode data to the WebSocket connection
*
* @param[in] client The client
* @param[in] opcode The opcode
* @param[in] data The data
* @param[in] len The length
* @param[in] timeout Write data timeout in RTOS ticks
*
* @return
* - Number of data was sent
* - (-1) if any errors
*/
int esp_websocket_client_send_with_opcode(esp_websocket_client_handle_t client, ws_transport_opcodes_t opcode, const uint8_t *data, int len, TickType_t timeout);
/**
* @brief Close the WebSocket connection in a clean way
*