blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.81k stars 1.38k forks source link

Fixed call esp_bt_gap_set_scan_mode() #555

Closed PilnyTomas closed 2 years ago

PilnyTomas commented 2 years ago

Description

Fixing "error: 'ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE' was not declared in this scope"

Issues Resolved

https://github.com/espressif/esp-idf/issues/3219

FedericoBusero commented 2 years ago

This indeed fixes compilation on ESP32 Arduino Core 2.0.3, but it no longer compiles on the more stabel ESP32 Arduino Core 1.0.6. Please reopen this, to add some IFDEF to check IDF version or some other version define (my guess is that the split is on IDF Version 3.x versus 4.x).

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
          esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
#else
          esp_bt_gap_set_scan_mode(ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE);
#endif