PM5 BLE notifications contains only a single byte

Post questions and issues with Concept2 PM3 SDK
Post Reply
wmmnpr1
Paddler
Posts: 9
Joined: December 26th, 2013, 2:40 pm

PM5 BLE notifications contains only a single byte

Post by wmmnpr1 » March 27th, 2023, 8:53 am

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.

wmmnpr1
Paddler
Posts: 9
Joined: December 26th, 2013, 2:40 pm

Re: PM5 BLE notifications contains only a single byte

Post by wmmnpr1 » March 28th, 2023, 4:36 pm

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

Post Reply