This repository is for active development of the Azure SDK for Embedded C. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-c.
MIT License
224
stars
120
forks
source link
[azure-sdk-for-c-arduino]: Azure_Iot_Central_ESP32.ino have minor missing esp_mqtt_event_handler when compile on arduino core 3.0.1 using arduino-cli #2847
Describe the bug
An _Azure_Iot_CentralESP32 example compile with no error when using Arduino IDE base on Arduino core 3.0.1 but when using arduino-cli to build my project base on reused code on this example. I encountered the following error:
In function 'int mqtt_client_init_function(mqtt_client_config_t*, void**)':'esp_mqtt_event_handler' was not declared in this scope; did you mean 'esp_mqtt_event_handle_t'? 211 | esp_mqtt_client_register_event(mqtt_client, MQTT_EVENT_ANY, esp_mqtt_event_handler, NULL); | ^~~~~~~~~~~~~~~~~~~~~~ | esp_mqtt_event_handle_t
Exception or Stack Trace
Above
Setup (please complete the following information):
OS: Window 11
IDE: Arduino-cli 0.35.3
Version of the Library used: 1.1.7
Suggestion Fix
I think problem in _Azure_Iot_Central_ESP32.ino_ example line 88,static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data);It should be:static void esp_mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data);
Hope it can help!
Information Checklist
Please make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Describe the bug An _Azure_Iot_CentralESP32 example compile with no error when using Arduino IDE base on Arduino core 3.0.1 but when using arduino-cli to build my project base on reused code on this example. I encountered the following error:
In function 'int mqtt_client_init_function(mqtt_client_config_t*, void**)':
'esp_mqtt_event_handler' was not declared in this scope; did you mean 'esp_mqtt_event_handle_t'? 211 | esp_mqtt_client_register_event(mqtt_client, MQTT_EVENT_ANY, esp_mqtt_event_handler, NULL); | ^~~~~~~~~~~~~~~~~~~~~~ | esp_mqtt_event_handle_t
Exception or Stack Trace Above
Setup (please complete the following information):
Suggestion Fix I think problem in _Azure_Iot_Central_ESP32.ino_ example line 88,
static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data);
It should be:static void esp_mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data);
Hope it can help!
Information Checklist Please make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report