diff --git a/include/mqtt_client.h b/include/mqtt_client.h index da98b85..f8d34d6 100644 --- a/include/mqtt_client.h +++ b/include/mqtt_client.h @@ -202,6 +202,7 @@ typedef struct { void *ds_data; /*!< carrier of handle for digital signature parameters */ int network_timeout_ms; /*!< Abort network operation if it is not completed after this value, in milliseconds (defaults to 10s) */ bool disable_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 */ + const char *path; /*!< Path in the URI*/ } esp_mqtt_client_config_t; /** diff --git a/mqtt_client.c b/mqtt_client.c index 3c07609..3a6fc32 100644 --- a/mqtt_client.c +++ b/mqtt_client.c @@ -369,6 +369,7 @@ esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_cl err = ESP_ERR_NO_MEM; ESP_MEM_CHECK(TAG, set_if_config(config->host, &client->config->host), goto _mqtt_set_config_failed); + ESP_MEM_CHECK(TAG, set_if_config(config->path, &client->config->path), goto _mqtt_set_config_failed); ESP_MEM_CHECK(TAG, set_if_config(config->username, &client->connect_info.username), goto _mqtt_set_config_failed); ESP_MEM_CHECK(TAG, set_if_config(config->password, &client->connect_info.password), goto _mqtt_set_config_failed);