feat: Add custom transport configuration

Today there is no way to add a new transport without applying
modifications to the transport list. This impose limitations on the
client usage. Adding the custom configuration we enable user defined
transports.
This commit is contained in:
Euripedes Rocha
2023-05-03 09:49:17 +02:00
committed by Rocha Euripedes
parent ffd7d4df6c
commit a5c1b441dc
4 changed files with 32 additions and 20 deletions
+2
View File
@@ -12,6 +12,7 @@
#include <string.h>
#include "esp_err.h"
#include "esp_event.h"
#include "esp_transport.h"
#ifdef CONFIG_MQTT_PROTOCOL_5
#include "mqtt5_client.h"
#endif
@@ -329,6 +330,7 @@ typedef struct esp_mqtt_client_config_t {
int refresh_connection_after_ms; /*!< Refresh connection after this value (in milliseconds) */
bool disable_auto_reconnect; /*!< Client will reconnect to server (when errors/disconnect). Set
`disable_auto_reconnect=true` to disable */
esp_transport_handle_t transport; /*!< Custom transport handle to use. Warning: The transport should be valid during the client lifetime and is destroyed when esp_mqtt_client_destroy is called. */
} network; /*!< Network configuration */
/**
* Client task configuration