Closed easytarget closed 2 years ago
Ref #15
Great work, Could you wrap the changes up in ifdef statements that check for these new defines and if they exist uses them and if not uses the old ones. think that should preserve backwards compatibility.
C is such fun, pretty certain what I'm hitting is same as this: https://stackoverflow.com/questions/34677148/why-does-the-c-preprocessor-consider-enum-values-as-equal
Learned some interesting lessons about enums and defines. For the purposes of this library it seems that matching on the ESP core version is the way to go; it should keep compatibility for platformio and the esp IDE ecosystem too.
This fixes compiling on the ESP Arduino Core 2.0.1 (current) for all the examples, and my sketch based off of those examples now compiles and runs correctly with the latest ESP release.
TL;DR
The first error was due to ESP expanding and separating discoverability vs connectability
I fixed this by copying the modified ESP examples, using two separate defines for discoverability + connectability.
The second seems to be a renaming of the comms format defines, fixed by following the depreciation warning and suggestion.
Finally there was a non-fatal warning.
I 'fixed' this by changing the
sampleRate
type to a signed integer, which I assume matches a change upstream. But didnt investigate too much so this should be reviewed/checked as to whether it is the correct solution.