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.
Files changed (2) hide show
  1. package/lib/ble/fm.js +7 -4
  2. 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
- this.data.totalDistance = data.readUInt16LE(offset);
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.readUInt16LE(offset);
169
+ this.data.resistanceLevel = data.readInt16LE(offset);
167
170
  offset += 2;
168
171
  }
169
172
  if (flags & IndoorBikeDataFlag.InstantaneousPowerPresent) {
170
- this.data.instantaneousPower = data.readUInt16LE(offset);
173
+ this.data.instantaneousPower = data.readInt16LE(offset);
171
174
  offset += 2;
172
175
  }
173
176
  if (flags & IndoorBikeDataFlag.AveragePowerPresent) {
174
- this.data.averagePower = data.readUInt16LE(offset);
177
+ this.data.averagePower = data.readInt16LE(offset);
175
178
  offset += 2;
176
179
  }
177
180
  if (flags & IndoorBikeDataFlag.ExpendedEnergyPresent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.4.46",
3
+ "version": "1.4.47",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",