incyclist-devices 1.4.46 → 1.4.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ble/fm.js +7 -4
- package/package.json +1 -1
package/lib/ble/fm.js
CHANGED
|
@@ -159,19 +159,22 @@ class BleFitnessMachineDevice extends ble_device_1.BleDevice {
|
|
|
159
159
|
offset += 2;
|
|
160
160
|
}
|
|
161
161
|
if (flags & IndoorBikeDataFlag.TotalDistancePresent) {
|
|
162
|
-
|
|
162
|
+
const dvLow = data.readUInt8(offset);
|
|
163
|
+
offset += 1;
|
|
164
|
+
const dvHigh = data.readUInt16LE(offset);
|
|
163
165
|
offset += 2;
|
|
166
|
+
this.data.totalDistance = dvHigh << 8 + dvLow;
|
|
164
167
|
}
|
|
165
168
|
if (flags & IndoorBikeDataFlag.ResistanceLevelPresent) {
|
|
166
|
-
this.data.resistanceLevel = data.
|
|
169
|
+
this.data.resistanceLevel = data.readInt16LE(offset);
|
|
167
170
|
offset += 2;
|
|
168
171
|
}
|
|
169
172
|
if (flags & IndoorBikeDataFlag.InstantaneousPowerPresent) {
|
|
170
|
-
this.data.instantaneousPower = data.
|
|
173
|
+
this.data.instantaneousPower = data.readInt16LE(offset);
|
|
171
174
|
offset += 2;
|
|
172
175
|
}
|
|
173
176
|
if (flags & IndoorBikeDataFlag.AveragePowerPresent) {
|
|
174
|
-
this.data.averagePower = data.
|
|
177
|
+
this.data.averagePower = data.readInt16LE(offset);
|
|
175
178
|
offset += 2;
|
|
176
179
|
}
|
|
177
180
|
if (flags & IndoorBikeDataFlag.ExpendedEnergyPresent) {
|