mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
[MQTT] - Updates esp_mqtt configuration struct
- Layered config struct - Fix examples.
This commit is contained in:
@@ -110,12 +110,12 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
|
||||
static void mqtt_app_start(void)
|
||||
{
|
||||
esp_mqtt_client_config_t mqtt_cfg = {
|
||||
.uri = CONFIG_BROKER_URL,
|
||||
.broker.address.uri = CONFIG_BROKER_URL,
|
||||
};
|
||||
#if CONFIG_BROKER_URL_FROM_STDIN
|
||||
char line[128];
|
||||
|
||||
if (strcmp(mqtt_cfg.uri, "FROM_STDIN") == 0) {
|
||||
if (strcmp(mqtt_cfg.broker.address.uri, "FROM_STDIN") == 0) {
|
||||
int count = 0;
|
||||
printf("Please enter url of mqtt broker\n");
|
||||
while (count < 128) {
|
||||
@@ -129,7 +129,7 @@ static void mqtt_app_start(void)
|
||||
}
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
}
|
||||
mqtt_cfg.uri = line;
|
||||
mqtt_cfg.broker.address.uri = line;
|
||||
printf("Broker url: %s\n", line);
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Configuration mismatch: wrong broker url");
|
||||
|
Reference in New Issue
Block a user