EasyManua.ls Logo

Espressif ESP32-S2 - Page 603

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
Parameters
[in] ctx: object to free
typedef esp_err_t (*httpd_open_func_t)(httpd_handle_t hd, int sockfd)
Function prototype for opening a session.
Called immediately after the socket was opened to set up the send/recv functions and other parameters of the
socket.
Return
ESP_OK : On success
Any value other than ESP_OK will signal the server to close the socket immediately
Parameters
[in] hd: server instance
[in] sockfd: session socket file descriptor
typedef void (*httpd_close_func_t)(httpd_handle_t hd, int sockfd)
Function prototype for closing a session.
Note Its possible that the socket descriptor is invalid at this point, the function is called for all terminated
sessions. Ensure proper handling of return codes.
Parameters
[in] hd: server instance
[in] sockfd: session socket file descriptor
typedef bool (*httpd_uri_match_func_t)(const char *reference_uri, const char
*uri_to_match, size_t match_upto)
Function prototype for URI matching.
Return true on match
Parameters
[in] reference_uri: URI/template with respect to which the other URI is matched
[in] uri_to_match: URI/template being matched to the reference URI/template
[in] match_upto: For specifying the actual length of uri_to_match up to which the match-
ing algorithm is to be applied (The maximum value is strlen(uri_to_match), independent
of the length of reference_uri)
typedef struct httpd_config httpd_config_t
HTTP Server Configuration Structure.
Note Use HTTPD_DEFAULT_CONFIG() to initialize the configuration to a default value and then modify
only those fields that are specifically determined by the use case.
typedef void (*httpd_work_fn_t)(void *arg)
Prototype of the HTTPD work function Please refer to httpd_queue_work() for more details.
Parameters
[in] arg: The arguments for this work function
Enumerations
enum httpd_err_code_t
Error codes sent as HTTP response in case of errors encountered during processing of an HTTP request.
Values:
HTTPD_500_INTERNAL_SERVER_ERROR = 0
HTTPD_501_METHOD_NOT_IMPLEMENTED
HTTPD_505_VERSION_NOT_SUPPORTED
HTTPD_400_BAD_REQUEST
HTTPD_401_UNAUTHORIZED
HTTPD_403_FORBIDDEN
Espressif Systems 592
Submit Document Feedback
Release v4.4

Table of Contents