EasyManua.ls Logo

Espressif ESP32-S2 - Page 524

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
Return ESP_ERR_NO_MEM if failed to allocate ESP_ERR_INVALID_ARG if conflicts on transport con-
guration. ESP_OK on success
Parameters
client: mqtt client handle
config: mqtt configuration structure
esp_err_t esp_mqtt_client_register_event(esp_mqtt_client_handle_t client,
esp_mqtt_event_id_t event, esp_event_handler_t
event_handler, void *event_handler_arg)
Registers mqtt event.
Return ESP_ERR_NO_MEM if failed to allocate ESP_ERR_INVALID_ARG on wrong initialization
ESP_OK on success
Parameters
client: mqtt client handle
event: event type
event_handler: handler callback
event_handler_arg: handlers context
int esp_mqtt_client_get_outbox_size(esp_mqtt_client_handle_t client)
Get outbox size.
Return outbox size 0 on wrong initialization
Parameters
client: mqtt client handle
Structures
struct esp_mqtt_error_codes
MQTT error code structure to be passed as a contextual information into ERROR event.
Important: This structure extends esp_tls_last_error error structure and is backward compatible with
it (so might be down-casted and treated as esp_tls_last_error error, but recommended to update
applications if used this way previously)
Use this structure directly checking error_type first and then appropriate error code depending on the source
of the error:
| error_type | related member variables | note | | MQTT_ERROR_TYPE_TCP_TRANSPORT |
esp_tls_last_esp_err, esp_tls_stack_err, esp_tls_cert_verify_flags, sock_errno | Error reported from
tcp_transport/esp-tls | | MQTT_ERROR_TYPE_CONNECTION_REFUSED | connect_return_code | Inter-
nal error reported from MQTT broker on connection |
Public Members
esp_err_t esp_tls_last_esp_err
last esp_err code reported from esp-tls component
int esp_tls_stack_err
tls specific error code reported from underlying tls stack
int esp_tls_cert_verify_flags
tls flags reported from underlying tls stack during certificate verification
esp_mqtt_error_type_t error_type
error type referring to the source of the error
esp_mqtt_connect_return_code_t connect_return_code
connection refused error code reported from MQTT broker on connection
int esp_transport_sock_errno
errno from the underlying socket
struct esp_mqtt_event_t
MQTT event configuration structure
Espressif Systems 513
Submit Document Feedback
Release v4.4

Table of Contents