Make esp_websocket_client_abort_connection not static

This commit is contained in:
2025-02-24 19:52:03 +01:00
parent 3be87562ad
commit 1c2ee55459
2 changed files with 11 additions and 1 deletions

View File

@ -226,7 +226,7 @@ static esp_err_t esp_websocket_client_dispatch_event(esp_websocket_client_handle
return esp_event_loop_run(client->event_handle, 0);
}
static esp_err_t esp_websocket_client_abort_connection(esp_websocket_client_handle_t client, esp_websocket_error_type_t error_type)
esp_err_t esp_websocket_client_abort_connection(esp_websocket_client_handle_t client, esp_websocket_error_type_t error_type)
{
ESP_WS_CLIENT_STATE_CHECK(TAG, client, return ESP_FAIL);
esp_transport_close(client->transport);

View File

@ -247,6 +247,16 @@ esp_err_t esp_websocket_client_initiate_stop(esp_websocket_client_handle_t clien
*/
bool esp_websocket_client_is_already_stopped(esp_websocket_client_handle_t client);
/**
* @brief Closes a websocket connection and causes a reconnect to happen
*
* @param[in] client The client
* @param[in] error_type The error type
*
* @return esp_err_t
*/
esp_err_t esp_websocket_client_abort_connection(esp_websocket_client_handle_t client, esp_websocket_error_type_t error_type);
/**
* @brief Destroy the WebSocket connection and free all resources.
* This function must be the last function to call for an session.