From 9cf41636634409bc460e39d90a3c0b390d58c617 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Fri, 16 Aug 2024 14:38:45 -0500 Subject: [PATCH] docs(websocket): improve websocket event list --- docs/esp_websocket_client/en/index.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/esp_websocket_client/en/index.rst b/docs/esp_websocket_client/en/index.rst index 4c629588d..d84aba3d9 100644 --- a/docs/esp_websocket_client/en/index.rst +++ b/docs/esp_websocket_client/en/index.rst @@ -91,10 +91,12 @@ For more options on :cpp:type:`esp_websocket_client_config_t`, please refer to A Events ------ +* `WEBSOCKET_EVENT_BEFORE_CONNECT`: The client is about to connect. * `WEBSOCKET_EVENT_CONNECTED`: The client has successfully established a connection to the server. The client is now ready to send and receive data. Contains no event data. -* `WEBSOCKET_EVENT_DISCONNECTED`: The client has aborted the connection due to the transport layer failing to read data, e.g. because the server is unavailable. Contains no event data. * `WEBSOCKET_EVENT_DATA`: The client has successfully received and parsed a WebSocket frame. The event data contains a pointer to the payload data, the length of the payload data as well as the opcode of the received frame. A message may be fragmented into multiple events if the length exceeds the buffer size. This event will also be posted for non-payload frames, e.g. pong or connection close frames. -* `WEBSOCKET_EVENT_ERROR`: Not used in the current implementation of the client. +* `WEBSOCKET_EVENT_ERROR`: The client has experienced an error. Examples include transport write or read failures. +* `WEBSOCKET_EVENT_DISCONNECTED`: The client has aborted the connection due to the transport layer failing to read data, e.g. because the server is unavailable. Contains no event data. +* `WEBSOCKET_EVENT_CLOSED`: The connection has been closed cleanly. If the client handle is needed in the event handler it can be accessed through the pointer passed to the event handler: