fixed minor incompatibilities with idf 5.4 version

This commit is contained in:
Bogdan Pilyugin 2025-05-11 12:49:02 +02:00
parent 9585559ab7
commit 370f791151
5 changed files with 13 additions and 7 deletions

View File

@ -39,8 +39,8 @@ int ExecCommand(char *cmd);
void GetObjectsInfo(char *data); void GetObjectsInfo(char *data);
void SetCustomObjects(obj_struct_t *obj); void SetCustomObjects(obj_struct_t *obj);
obj_struct_t* GetSystemObjects(); const obj_struct_t* GetSystemObjects();
obj_struct_t* GetCustomObjects(); const obj_struct_t* GetCustomObjects();

View File

@ -94,12 +94,12 @@ const obj_struct_t com_obj_arr[] = {
{ 0 } { 0 }
}; };
obj_struct_t* GetSystemObjects() const obj_struct_t* GetSystemObjects()
{ {
return &com_obj_arr; return (obj_struct_t*)&com_obj_arr;
} }
obj_struct_t* GetCustomObjects() const obj_struct_t* GetCustomObjects()
{ {
return custom_com_obj_arr; return custom_com_obj_arr;
} }

View File

@ -27,6 +27,9 @@
#include "NetTransport.h" #include "NetTransport.h"
#include "MQTT.h" #include "MQTT.h"
#include "UserCallbacks.h" #include "UserCallbacks.h"
#if (ESP_IDF_VERSION_MAJOR == 5 && ESP_IDF_VERSION_MINOR > 1)
#include "esp_log_level.h"
#endif
#define TAG "MQTT" #define TAG "MQTT"
#define SERVICE_NAME "SYSTEM" // Dedicated service name #define SERVICE_NAME "SYSTEM" // Dedicated service name
@ -630,6 +633,9 @@ esp_err_t ExtendedLog(esp_log_level_t level, char *format, ...)
case ESP_LOG_ERROR: case ESP_LOG_ERROR:
ESP_LOGE(SPIRAL_LOG_TAG, "%s", data); ESP_LOGE(SPIRAL_LOG_TAG, "%s", data);
break; break;
#if (ESP_IDF_VERSION_MAJOR == 5 && ESP_IDF_VERSION_MINOR > 1)
case ESP_LOG_MAX:
#endif
} }
for (int idx = 0; idx < 2; idx++) for (int idx = 0; idx < 2; idx++)

View File

@ -30,7 +30,7 @@ extern struct netif *netif_default;
esp_netif_t* GetNetifCurrentDefault() esp_netif_t* GetNetifCurrentDefault()
{ {
return netif_default; return (esp_netif_t*)netif_default;
} }
esp_netif_t* GetNetifByName(char *name) esp_netif_t* GetNetifByName(char *name)

View File

@ -418,7 +418,7 @@ static void wifi_init_apsta(void *pvParameter)
ESP_ERROR_CHECK(esp_netif_set_hostname(sta_netif, "test_TEST")); ESP_ERROR_CHECK(esp_netif_set_hostname(sta_netif, "test_TEST"));
ESP_ERROR_CHECK(esp_netif_set_hostname(ap_netif, GetSysConf()->NetBIOSName)); ESP_ERROR_CHECK(esp_netif_set_hostname(ap_netif, GetSysConf()->NetBIOSName));
char name[32]; char name[32];
esp_netif_get_hostname(sta_netif, &name); esp_netif_get_hostname(sta_netif, (const char**)(&name));
ESP_LOGW(TAG, "Net bios name set to %s", name); ESP_LOGW(TAG, "Net bios name set to %s", name);
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_APSTA)); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_APSTA));