some fixes for combine idf4 and idf5
This commit is contained in:
parent
c81e02262b
commit
8a040da2d9
|
|
@ -1 +1 @@
|
|||
Subproject commit 03ff681a61cb03a43c6f008601a6e6090e9df2bd
|
||||
Subproject commit 5342a39a179a4dddede680615bf4694755d2a59d
|
||||
16
src/MQTT.c
16
src/MQTT.c
|
|
@ -290,22 +290,24 @@ static void start_mqtt()
|
|||
itoa(GetSysConf()->mqttStation[i].ServerPort, tmp, 10);
|
||||
strcat(url, ":");
|
||||
strcat(url, tmp);
|
||||
//mqtt_cfg.uri = url;
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
mqtt_cfg.broker.address.uri = url;
|
||||
//mqtt_cfg.username = GetSysConf()->mqttStation[i].UserName;
|
||||
mqtt_cfg.credentials.username = GetSysConf()->mqttStation[i].UserName;
|
||||
//mqtt_cfg.password = GetSysConf()->mqttStation[i].UserPass;
|
||||
mqtt_cfg.credentials.authentication.password = GetSysConf()->mqttStation[i].UserPass;
|
||||
#else
|
||||
mqtt_cfg.uri = url;
|
||||
mqtt_cfg.username = GetSysConf()->mqttStation[i].UserName;
|
||||
mqtt_cfg.password = GetSysConf()->mqttStation[i].UserPass;
|
||||
#endif
|
||||
strcpy(tmp, GetSysConf()->mqttStation[i].ClientID);
|
||||
strcat(tmp, "-");
|
||||
strcat(tmp, GetSysConf()->ID);
|
||||
<<<<<<< src/MQTT.c
|
||||
//mqtt_cfg.client_id = tmp;
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
mqtt_cfg.credentials.client_id = tmp;
|
||||
=======
|
||||
#else
|
||||
mqtt_cfg.client_id = tmp;
|
||||
#endif
|
||||
mqtt_cfg.reconnect_timeout_ms = MQTT_RECONNECT_TIMEOUT * 1000;
|
||||
>>>>>>> src/MQTT.c
|
||||
mqtt[i].is_connected = false;
|
||||
mqtt[i].mqtt_index = i;
|
||||
//mqtt_cfg.user_context = (void*) &mqtt[i];
|
||||
|
|
|
|||
|
|
@ -73,9 +73,11 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
|||
case HTTP_EVENT_DISCONNECTED:
|
||||
ESP_LOGD(TAG, "HTTP_EVENT_DISCONNECTED");
|
||||
break;
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
case HTTP_EVENT_REDIRECT:
|
||||
ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "NetTransport.h"
|
||||
#include "Helpers.h"
|
||||
#include "HTTPServer.h"
|
||||
#include "esp_rom_gpio.h"
|
||||
|
||||
#define STORAGE_NAMESPACE "storage"
|
||||
#define TAG "SystemConfiguration"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user