std::vector<std::string>alpn_protos;/*!< List of supported application protocols to be used for ALPN */
/* default is ``ESP32_%CHIPID%`` where %CHIPID% are last 3 bytes of MAC address in hex format */
std::optional<std::string>client_id=std::nullopt;
};
structLastWill{
constchar*lwt_topic;/*!< LWT (Last Will and Testament) message topic (NULL by default) */
constchar*lwt_msg;/*!< LWT message (NULL by default) */
intlwt_qos;/*!< LWT message qos */
intlwt_retain;/*!< LWT retained message flag */
intlwt_msg_len;/*!< LWT message length */
};
structSession{
LastWilllast_will;
intdisable_clean_session;/*!< mqtt clean session, default clean_session is true */
intkeepalive;/*!< mqtt keepalive, default is 120 seconds */
booldisable_keepalive;/*!< Set disable_keepalive=true to turn off keep-alive mechanism, false by default (keepalive is active by default). Note: setting the config value `keepalive` to `0` doesn't disable keepalive feature, but uses a default keepalive period */
esp_mqtt_protocol_ver_tprotocol_ver;/*!< MQTT protocol version used for connection, defaults to value from menuconfig*/
};
structTask{
inttask_prio;/*!< MQTT task priority, default is 5, can be changed in ``make menuconfig`` */
inttask_stack;/*!< MQTT task stack size, default is 6144 bytes, can be changed in ``make menuconfig`` */
};
structConnection{
esp_mqtt_transport_ttransport;/*!< overrides URI transport */
intreconnect_timeout_ms;/*!< Reconnect to the broker after this value in miliseconds if auto reconnect is not disabled (defaults to 10s) */
intnetwork_timeout_ms;/*!< Abort network operation if it is not completed after this value, in milliseconds (defaults to 10s) */
intrefresh_connection_after_ms;/*!< Refresh connection after this value (in milliseconds) */
booldisable_auto_reconnect;/*!< this mqtt client will reconnect to server (when errors/disconnect). Set disable_auto_reconnect=true to disable */
};
structConfiguration{
Tasktask;
Sessionsession;
Connectionconnection;
void*user_context;/*!< pass user context to this option, then can receive that context in ``event->user_context`` */
intbuffer_size;/*!< size of MQTT send/receive buffer, default is 1024 (only receive buffer size if ``out_buffer_size`` defined) */
intout_buffer_size;/*!< size of MQTT output buffer. If not defined, both output and input buffers have the same size defined as ``buffer_size`` */