incyclist-devices 3.0.31 → 3.0.32
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.
|
@@ -49,6 +49,10 @@ class BleCyclingSpeedCadenceDevice extends sensor_js_1.TBleSensor {
|
|
|
49
49
|
}
|
|
50
50
|
const parsed = parser.parse(data);
|
|
51
51
|
this.data = { ...this.data, ...parsed };
|
|
52
|
+
if (this.data.speed < 0) {
|
|
53
|
+
this.logEvent({ message: 'error', fn: 'onData', error: 'speed<0', speed: this.data.speed, raw: this.data.raw });
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
52
56
|
this.emit('data', this.data);
|
|
53
57
|
return true;
|
|
54
58
|
}
|
|
@@ -46,6 +46,10 @@ export class BleCyclingSpeedCadenceDevice extends TBleSensor {
|
|
|
46
46
|
}
|
|
47
47
|
const parsed = parser.parse(data);
|
|
48
48
|
this.data = { ...this.data, ...parsed };
|
|
49
|
+
if (this.data.speed < 0) {
|
|
50
|
+
this.logEvent({ message: 'error', fn: 'onData', error: 'speed<0', speed: this.data.speed, raw: this.data.raw });
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
49
53
|
this.emit('data', this.data);
|
|
50
54
|
return true;
|
|
51
55
|
}
|
|
@@ -3,6 +3,7 @@ import { CharacteristicParser, Feature } from "../types.js";
|
|
|
3
3
|
export type CyclingCadenceAndSpeed = {
|
|
4
4
|
cadence?: number;
|
|
5
5
|
speed?: number;
|
|
6
|
+
raw?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare class CscMeasurement implements CharacteristicParser<CyclingCadenceAndSpeed> {
|
|
8
9
|
protected data: CyclingCadenceAndSpeed;
|