chrvadala / node-ble

Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
https://www.npmjs.com/package/node-ble
MIT License
310 stars 45 forks source link

Interpret buffer of characteristic - encoding #28

Closed ebeling closed 2 years ago

ebeling commented 2 years ago

I am implemented connecting heartrate sensor with another API (@ionic-nativ/bluetooth-le) successful. Now I try implementing connecting the same heartrate sensor with your API on Raspberry Pi. Connecting and start notification works well. But I don't know how I must interpret the incoming data. In "@ionic-native/bluetooth-le" there is a function "encodeStringToBytes(string): Uint8Array" (the incoming data are strings ). Then I can interpret the Uint8Array as described in Bluetooth specification. Your interface deliver "Buffer". I don't know, how I must interpret this. Can you help me?

ebeling commented 2 years ago

I found out, that it can be used as it is (without any encoding).