You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current approach may read power correctly in most cases, but some trainers won’t report cadence, or will report distance or something else, which will shift the index away from the current fixed value of 6.
In general the index of fields in indoor-bike-data is relative. It’s based on what other fields are present before it, which is determined by reading the flags. Some trainers might also have heart rate field in the indoor-bike-data which is useful to have from just one BLE connection.
Here is example data from Schwinn bike which reports heart rate at last position:
Schwinn 800IC:
(0x) 44-02-AA-05-2E-00-18-00-46
(10) [68, 2, 170, 5, 46, 0, 24, 0, 70]
"Instantanious Speed: 14.5 km/h
Instantanious Cadence: 23.0 per min
Instantanious Power: 24 W
Heart Rate: 70 bpm"
Here is example from my code (you can also read the value of power with getUint16):
functionpowerIndex(flags){leti=fields.Flags.size;if(speedPresent(flags))i+=fields.InstantaneousSpeed.size;if(avgSpeedPresent(flags))i+=fields.AverageSpeed.size;if(cadencePresent(flags))i+=fields.InstantaneousCandence.size;if(avgCadencePresent(flags))i+=fields.AverageCandence.size;if(distancePresent(flags))i+=fields.TotalDistance.size;if(resistancePresent(flags))i+=fields.ResistanceLevel.size;returni;}// and later:if(powerPresent(flags)){returndataview.getUint16(powerIndex(flags),true);}
The text was updated successfully, but these errors were encountered:
dundring/apps/frontend/src/hooks/useSmartTrainerInterface.ts
Line 138 in 96aacbc
The current approach may read power correctly in most cases, but some trainers won’t report cadence, or will report distance or something else, which will shift the index away from the current fixed value of 6.
In general the index of fields in indoor-bike-data is relative. It’s based on what other fields are present before it, which is determined by reading the flags. Some trainers might also have heart rate field in the indoor-bike-data which is useful to have from just one BLE connection.
Here is example data from Schwinn bike which reports heart rate at last position:
Here is example from my code (you can also read the value of power with
getUint16
):The text was updated successfully, but these errors were encountered: