I am using the cordova-plugin-ble-central (https://github.com/don/cordova-plugin-ble-central) plugin to subscribe to the "general status characteristic" (0x0031) of my PM5. I receive notifications, however, the notifications have a length of only 1 byte and not the 19 as indicated in the documentation.
Is there something I am forgetting to configure?
I can successfully send commands to the PM5 to configure workout, however, monitoring the workouts' progress is where I have issues.
Thanks for your help.
PM5 BLE notifications contains only a single byte
Re: PM5 BLE notifications contains only a single byte
After getting the thing into the debugger, it was obvious.
The proper code should look something like this:
this.ble.startNotification(DEVICE_ID, PM_ROWING_SERVICE_ID, ROWING_STATUS_CHARACTERISIC).subscribe(buffer => {
let dv = new DataView(buffer[0]);
..
});
Where buffer is an array with the first element being the ArrayBuffer.
Actually, it said it all along right here:
https://github.com/danielsogl/awesome-c ... ex.ts#L483
The proper code should look something like this:
this.ble.startNotification(DEVICE_ID, PM_ROWING_SERVICE_ID, ROWING_STATUS_CHARACTERISIC).subscribe(buffer => {
let dv = new DataView(buffer[0]);
..
});
Where buffer is an array with the first element being the ArrayBuffer.
Actually, it said it all along right here:
https://github.com/danielsogl/awesome-c ... ex.ts#L483