Page 1 of 1

PM5 BLE notifications contains only a single byte

Posted: March 27th, 2023, 8:53 am
by wmmnpr1
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.

Re: PM5 BLE notifications contains only a single byte

Posted: March 28th, 2023, 4:36 pm
by wmmnpr1
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: :cry:
https://github.com/danielsogl/awesome-c ... ex.ts#L483