jasongin / noble-uwp

Noble (Node.js Bluetooth LE) with Windows 10 UWP bindings
MIT License
83 stars 45 forks source link

discoverCharacteristics failing when a valid characteristic UUID is passed #5

Closed qdot closed 7 years ago

qdot commented 7 years ago

Trying to run a script that works on noble on OS X/linux, that uses the discoverCharacteristics([uuids, ...], callback()) format. The uuids are formatted without -'s and using lower case for hex, while it looks like windows is returning uuids with -'s and upper case hex. Should probably clean up uuid format in the filteruuid function before comparison?

qdot commented 7 years ago

BTW, patch incoming, just putting this here in case I get interrupted and don't get it in soon. :)

qdot commented 7 years ago

Ok, revising initial report. There's already a uuid normalization function I didn't see, looks like the problem is that the characteristic object is passed to filterUuid, instead of just the uuid. So discoverCharacteristic will always fail unless no uuid is passed.

jasongin commented 7 years ago

Fixed by https://github.com/jasongin/noble-uwp/commit/27fa5e8542cfecdd4fe7e48df68ad437caf525ee