Merge branch 'bugfix/ws_user_context_v4.0' into 'release/v4.0'

websocket: added missing event data (backport v4.0)

See merge request espressif/esp-idf!7195
pull/4653/head
Angus Gratton 2020-01-07 14:34:08 +08:00
commit e3d65c8e3e
2 zmienionych plików z 9 dodań i 16 usunięć

Wyświetl plik

@ -105,6 +105,10 @@ static esp_err_t esp_websocket_client_dispatch_event(esp_websocket_client_handle
{
esp_err_t err;
esp_websocket_event_data_t event_data;
event_data.client = client;
event_data.user_context = client->config->user_context;
event_data.data_ptr = data;
event_data.data_len = data_len;
event_data.op_code = client->last_opcode;

Wyświetl plik

@ -48,9 +48,11 @@ typedef enum {
* @brief Websocket event data
*/
typedef struct {
const char *data_ptr; /*!< Data pointer */
int data_len; /*!< Data length */
uint8_t op_code; /*!< Received opcode */
const char *data_ptr; /*!< Data pointer */
int data_len; /*!< Data length */
uint8_t op_code; /*!< Received opcode */
esp_websocket_client_handle_t client; /*!< esp_websocket_client_handle_t context */
void *user_context; /*!< user_data context, from esp_websocket_client_config_t user_data */
} esp_websocket_event_data_t;
/**
@ -62,19 +64,6 @@ typedef enum {
WEBSOCKET_TRANSPORT_OVER_SSL, /*!< Transport over ssl */
} esp_websocket_transport_t;
/**
* @brief Websocket Client events data
*/
typedef struct {
esp_websocket_event_id_t event_id; /*!< event_id, to know the cause of the event */
esp_websocket_client_handle_t client; /*!< esp_websocket_client_handle_t context */
void *user_context;/*!< user_data context, from esp_websocket_client_config_t user_data */
char *data; /*!< data of the event */
int data_len; /*!< length of data */
} esp_websocket_event_t;
typedef esp_websocket_event_t* esp_websocket_event_handle_t;
/**
* @brief Websocket client setup configuration
*/