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);
|
itoa(GetSysConf()->mqttStation[i].ServerPort, tmp, 10);
|
||||||
strcat(url, ":");
|
strcat(url, ":");
|
||||||
strcat(url, tmp);
|
strcat(url, tmp);
|
||||||
//mqtt_cfg.uri = url;
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
mqtt_cfg.broker.address.uri = url;
|
mqtt_cfg.broker.address.uri = url;
|
||||||
//mqtt_cfg.username = GetSysConf()->mqttStation[i].UserName;
|
|
||||||
mqtt_cfg.credentials.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;
|
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);
|
strcpy(tmp, GetSysConf()->mqttStation[i].ClientID);
|
||||||
strcat(tmp, "-");
|
strcat(tmp, "-");
|
||||||
strcat(tmp, GetSysConf()->ID);
|
strcat(tmp, GetSysConf()->ID);
|
||||||
<<<<<<< src/MQTT.c
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
//mqtt_cfg.client_id = tmp;
|
|
||||||
mqtt_cfg.credentials.client_id = tmp;
|
mqtt_cfg.credentials.client_id = tmp;
|
||||||
=======
|
#else
|
||||||
mqtt_cfg.client_id = tmp;
|
mqtt_cfg.client_id = tmp;
|
||||||
|
#endif
|
||||||
mqtt_cfg.reconnect_timeout_ms = MQTT_RECONNECT_TIMEOUT * 1000;
|
mqtt_cfg.reconnect_timeout_ms = MQTT_RECONNECT_TIMEOUT * 1000;
|
||||||
>>>>>>> src/MQTT.c
|
|
||||||
mqtt[i].is_connected = false;
|
mqtt[i].is_connected = false;
|
||||||
mqtt[i].mqtt_index = i;
|
mqtt[i].mqtt_index = i;
|
||||||
//mqtt_cfg.user_context = (void*) &mqtt[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:
|
case HTTP_EVENT_DISCONNECTED:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_DISCONNECTED");
|
ESP_LOGD(TAG, "HTTP_EVENT_DISCONNECTED");
|
||||||
break;
|
break;
|
||||||
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
case HTTP_EVENT_REDIRECT:
|
case HTTP_EVENT_REDIRECT:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");
|
ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
#include "NetTransport.h"
|
#include "NetTransport.h"
|
||||||
#include "Helpers.h"
|
#include "Helpers.h"
|
||||||
#include "HTTPServer.h"
|
#include "HTTPServer.h"
|
||||||
|
#include "esp_rom_gpio.h"
|
||||||
|
|
||||||
#define STORAGE_NAMESPACE "storage"
|
#define STORAGE_NAMESPACE "storage"
|
||||||
#define TAG "SystemConfiguration"
|
#define TAG "SystemConfiguration"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user