Closed franciozzy closed 9 months ago
Thanks for your report @franciozzy. I see we already have an issue tracking this problem: https://github.com/arduino-libraries/ArduinoBLE/issues/310. So I'll close this as a duplicate.
From the fact that this problem is causing a compilation error instead of only a warning, I will assume you are compiling for an ESP32 board.
The "esp32" boards platform (as well as the "Arduino ESP32 Boards" platform which is a fork of "esp32") is unique in that the compilation result is affected by the setting of Arduino IDE's "Compiler warnings" preference.
Traditionally this preference has only influenced how many warnings we see in the compilation output, but the Arduino boards platform framework allows each platform developer to decide exactly what effect they want each of the levels of this preference to have. The ESP32 developers decided to add the -Werror=all
flag to the compilation command when you set the "Compiler warnings" preference to the "More" or "All" levels. This flag causes compilation to fail when the sketch code produces a compilation warning.
This means that the workaround for this error is to reduce the level of the "Compiler warnings" preference to avoid the warnings causing a compilation error:
After doing that, you should be able to compile the ArduinoBLE library for ESP32 boards.
I'm trying to compile the "scan" example from 1.3.6 on Arduino IDE 2.2.1 and running into a few errors including the following:
Looks like a legit error as the enum
LE_META_EVENT
(see HCI.h) only has values from 1 to 9 and the switch statement checks for 10.