h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
670 stars 138 forks source link

NimBLE and BLE are not currently compatible. #612

Open zawatse opened 7 months ago

zawatse commented 7 months ago

Hello, Im using this library to create a custom game controller. Im also using the BLE lib in the same project to allow the controller to function as a keyboard. I need to implement a workaround currently, because NimBLE-Arduino\src\NimBLEHIDDevice.h and BLE\src\BLEHIDDevice.h use the same symbol in the #ifndef, _BLEHIDDEVICEH. My suggestion is to change this symbol in the NimBLE-Arduino lib to _NIMBLEHIDDEVICEH, or something else, to allow these libs to be compatible. I tried to push this change to the repo in a branch, but I dont have the right permissions.

h2zero commented 7 months ago

This is interesting, I'm not understanding why you need to use both libraries. Is there something missing in NimBLE that has been overlooked?

zawatse commented 7 months ago

Our use case evolved over time. It's possible we could switch to using NimBLE for both the keyboard and gamepad "modes" for our device, but our code originally only used the BLE lib, and we added use of NimBLE later for the gamepad mode. In your readme you mention that "this library is intended to be compatible with the original ESP32 BLE functions," so I was thinking this could be a useful change (regardless of if it is still necessary for our case), but just a suggestion.

h2zero commented 7 months ago

To be honest I'm quite surprised this even compiles, I will consider making this change in the near future, thanks.