used event loop only if defined in supported features (enabled by macros) for backward compatibily with older IDFs

This commit is contained in:
David Cermak
2019-05-29 15:12:25 +02:00
parent 5afe3e6b24
commit edd67e1c8c
3 changed files with 28 additions and 2 deletions
+6
View File
@@ -19,6 +19,12 @@
extern "C" {
#endif
#ifndef ESP_EVENT_DECLARE_BASE
// Define event loop types if macros not available
typedef void * esp_event_loop_handle_t;
typedef void * esp_event_handler_t;
#endif
typedef struct esp_mqtt_client *esp_mqtt_client_handle_t;
/**
+7 -2
View File
@@ -27,10 +27,15 @@
*/
#ifdef ESP_IDF_VERSION
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(3, 3, 0)
// Features supported from 3.3
#define MQTT_SUPPORTED_FEATURE_EVENT_LOOP
#endif
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
// Features supported in 4.0
#define MQTT_SUPPORTED_FEATURE_WS_SUBPROTOCOL
#endif
#endif