I'm trying to use the Fitness Machine Service + the Indoor Bike Data characteristic to get the cadence data. By using the nRF Connect Android App I can see that the data is there, sample data:
inst. speed 8.5km/h
inst. cadence 45.0 per min
inst. power 8W
Heart rate 0 bpm
//same data as hex 44 02 52 03 5A 00 08 00 00
Looking at spec for the Indoor Bike Data characteristic it says that the flag field should be encoded as 16bit(spec) but when I try something like,
const characteristic = await char.startNotifications()
characteristic.addEventListener('characteristicvaluechanged', (data) => {
const flags = data.getUint16(0, true);
console.table([ flags & 0x0,flags & 0x1, flags & 0x2,flags & 0x3, flags & 0x4,flags & 0x5, flags & 0x6,flags & 0x7, flags & 0x8,flags & 0x9, flags & 0x10,flags & 0x11, flags & 0x12,flags & 0x13, flags & 0x14,flags & 0x15, flags & 0x16])
});
which outputs:
The data doesn't match up with the above data from nRF Connect Android. Does anyone know why the data provided and the values in the screenshot don't match up and how I can get the rest of the data?
