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
700 stars 145 forks source link

Cannot getCharacteristic() using NimBLEUUID #457

Open kinsi55 opened 2 years ago

kinsi55 commented 2 years ago

For some reason, when I try to pass a NimBLEUUID to getCharacteristic it cannot get the characteristic (null returned) - Passing a string instead, works.

Passing a UUID to getService however (In my case, NimBLEUUID JK_BMS_SERVICE_UUID(0xFFE0u)), works.

String example: pSvc->getCharacteristic("FFE1") UUID Example:

static const NimBLEUUID JK_BMS_CHARACTERISTIC_UUID(0xFFE1u);
pSvc->getCharacteristic(JK_BMS_CHARACTERISTIC_UUID);
ILFforever commented 1 year ago

Hello I'm having a similar issue on an ESP32 S3 connecting to a uECG device. The board gets stuck on pChr = pSvc->getCharacteristic(NimBLEUUID("FC7A850D-C1A5-F61F-0DA7-9995621FBD00")); I'm trying to test out the method you used but since our service uuid is in a diffrent format it doesn't seems to work. Could you give me some help with this please? The code : https://github.com/ultimaterobotics/orbitrack_esp32

h2zero commented 1 year ago

Not sure what's going on with that but I'll look into it.