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
714 stars 150 forks source link

Compile fails if using usb libraries because of HIDTypes.h: #715

Open psxde opened 2 months ago

psxde commented 2 months ago

Hi,

if I use NimBLE instead of the standard BLE stack together with USB Host, I get compile errors like that:

Compiling .pio\build\esp32-s3-devkitc-1\lib3e1\NimBLE-Arduino\NimBLEClient.cpp.o
In file included from .pio/libdeps/esp32-s3-devkitc-1/EspUsbHost/src/EspUsbHost.h:7,
                 from src/main.cpp:5:
.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/esp_rom/include/esp32s3/rom/usb/usb_common.h:104: warning: "HID_CLASS" redefined
 #define HID_CLASS           0x03

In file included from .pio/libdeps/esp32-s3-devkitc-1/NimBLE-Arduino/src/NimBLEHIDDevice.h:24,
                 from .pio/libdeps/esp32-s3-devkitc-1/ESP32 BLE Keyboard/BleKeyboard.h:12,
                 from src/main.cpp:2:
.pio/libdeps/esp32-s3-devkitc-1/NimBLE-Arduino/src/HIDTypes.h:28: note: this is the location of the previous definition
 #define HID_CLASS           (3)

.pio/libdeps/esp32-s3-devkitc-1/NimBLE-Arduino/src/HIDTypes.h:29:29: error: expected identifier before '(' token
 #define HID_SUBCLASS_NONE   (0)
                             ^
h2zero commented 1 month ago

Thanks, I will look to change these.