feat(esp_https_server): Get the error codes on https_server error

Closes https://github.com/espressif/esp-idf/issues/12026
This commit is contained in:
Harshit Malpani
2024-02-13 16:46:19 +05:30
parent 9274e3e620
commit 3e1a95a0a7
4 changed files with 132 additions and 27 deletions

View File

@@ -12,10 +12,24 @@
#include "esp_http_server.h"
#include "esp_tls.h"
#include "esp_event.h"
#ifdef __cplusplus
extern "C" {
#endif
ESP_EVENT_DECLARE_BASE(ESP_HTTPS_SERVER_EVENT);
typedef enum {
HTTPS_SERVER_EVENT_ERROR = 0, /*!< This event occurs when there are any errors during execution */
HTTPS_SERVER_EVENT_START, /*!< This event occurs when HTTPS Server is started */
HTTPS_SERVER_EVENT_ON_CONNECTED, /*!< Once the HTTPS Server has been connected to the client */
HTTPS_SERVER_EVENT_ON_DATA, /*!< Occurs when receiving data from the client */
HTTPS_SERVER_EVENT_SENT_DATA, /*!< Occurs when an ESP HTTPS server sends data to the client */
HTTPS_SERVER_EVENT_DISCONNECTED, /*!< The connection has been disconnected */
HTTPS_SERVER_EVENT_STOP, /*!< This event occurs when HTTPS Server is stopped */
} esp_https_server_event_id_t;
typedef enum {
HTTPD_SSL_TRANSPORT_SECURE, // SSL Enabled
HTTPD_SSL_TRANSPORT_INSECURE // SSL disabled
@@ -39,6 +53,8 @@ typedef struct esp_https_server_user_cb_arg {
esp_tls_t *tls; /*!< ESP-TLS connection handle */
} esp_https_server_user_cb_arg_t;
typedef esp_tls_last_error_t esp_https_server_last_error_t;
/**
* @brief Callback function prototype
* Can be used to get connection or client information (SSL context)