CI: Fix build issues

This commit is contained in:
gabsuren
2022-07-27 17:21:43 +04:00
parent b6852a0588
commit 6e4e4fab1d
5 changed files with 18 additions and 7 deletions

View File

@ -26,7 +26,11 @@ struct MqttClientHandle {
explicit MqttClientHandle(const std::string &uri)
{
esp_mqtt_client_config_t config = { };
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
config.broker.address.uri = uri.c_str();
#else
config.uri = uri.c_str();
#endif
client = esp_mqtt_client_init(&config);
esp_mqtt_client_register_event(client, MQTT_EVENT_ANY, mqtt_event_handler, this);
}