incyclist-devices 2.3.19 → 2.3.22
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/tacx/sensor.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { CrankData } from "../cp";
|
|
|
3
3
|
import { IndoorBikeData } from "../fm";
|
|
4
4
|
import BleFitnessMachineDevice from "../fm/sensor";
|
|
5
5
|
import { BleProtocol } from "../types";
|
|
6
|
-
import { BleFeBikeData } from "./types";
|
|
6
|
+
import { BleFeBikeData, FECState } from "./types";
|
|
7
7
|
export default class TacxAdvancedFitnessMachineDevice extends BleFitnessMachineDevice {
|
|
8
8
|
static readonly profile: LegacyProfile;
|
|
9
9
|
static readonly protocol: BleProtocol;
|
|
@@ -17,6 +17,7 @@ export default class TacxAdvancedFitnessMachineDevice extends BleFitnessMachineD
|
|
|
17
17
|
protected data: BleFeBikeData;
|
|
18
18
|
protected hasFECData: boolean;
|
|
19
19
|
protected messageCnt: number;
|
|
20
|
+
protected currentState: FECState;
|
|
20
21
|
protected tacxRx: string;
|
|
21
22
|
protected tacxTx: string;
|
|
22
23
|
protected prevMessages: Record<string, {
|
package/lib/ble/tacx/sensor.js
CHANGED
|
@@ -221,7 +221,8 @@ class TacxAdvancedFitnessMachineDevice extends sensor_1.default {
|
|
|
221
221
|
break;
|
|
222
222
|
case 2:
|
|
223
223
|
this.data.State = 'READY';
|
|
224
|
-
this.
|
|
224
|
+
if (this.currentState !== 'READY')
|
|
225
|
+
this.resetState();
|
|
225
226
|
break;
|
|
226
227
|
case 3:
|
|
227
228
|
this.data.State = 'IN_USE';
|
|
@@ -235,6 +236,7 @@ class TacxAdvancedFitnessMachineDevice extends sensor_1.default {
|
|
|
235
236
|
}
|
|
236
237
|
if (capStateBF & 0x80) {
|
|
237
238
|
}
|
|
239
|
+
this.currentState = this.data.State;
|
|
238
240
|
}
|
|
239
241
|
parseGeneralFE(data) {
|
|
240
242
|
const equipmentTypeBF = data.readUInt8(1);
|
package/lib/ble/tacx/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IndoorBikeData } from "../fm";
|
|
2
|
+
export type FECState = 'OFF' | 'READY' | 'IN_USE' | 'FINISHED';
|
|
2
3
|
export interface BleFeBikeData extends IndoorBikeData {
|
|
3
4
|
EquipmentType?: 'Treadmill' | 'Elliptical' | 'StationaryBike' | 'Rower' | 'Climber' | 'NordicSkier' | 'Trainer' | 'General';
|
|
4
5
|
RealSpeed?: number;
|
|
5
6
|
VirtualSpeed?: number;
|
|
6
7
|
HeartRateSource?: 'HandContact' | 'EM' | 'ANT+';
|
|
7
|
-
State?:
|
|
8
|
+
State?: FECState;
|
|
8
9
|
EventCount?: number;
|
|
9
10
|
AccumulatedPower?: number;
|
|
10
11
|
TrainerStatus?: number;
|
|
@@ -47,5 +47,5 @@ export declare const FileTimeSupport: {
|
|
|
47
47
|
};
|
|
48
48
|
export declare function routeToEpp(route: Route, date?: Date): Uint8Array;
|
|
49
49
|
export declare function parseTrainingData(payload: string): IncyclistBikeData;
|
|
50
|
-
export declare function getPersonData(user: User): Buffer
|
|
50
|
+
export declare function getPersonData(user: User): Buffer<ArrayBuffer>;
|
|
51
51
|
export declare function parsePersonData(buffer: Buffer): User;
|
package/lib/serial/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-devices",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.22",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@serialport/bindings-interface": "^1.2.2",
|
|
6
6
|
"@serialport/parser-byte-length": "^9.0.1",
|
|
7
7
|
"@serialport/parser-delimiter": "^9.0.1",
|
|
8
8
|
"@serialport/parser-readline": "^10.5.0",
|
|
9
9
|
"@serialport/stream": "^10.5.0",
|
|
10
|
-
"incyclist-ant-plus": "^0.3.
|
|
10
|
+
"incyclist-ant-plus": "^0.3.5",
|
|
11
11
|
"win32filetime": "^1.0.2"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"@serialport/binding-mock": "^10.2.2",
|
|
18
18
|
"@serialport/bindings-cpp": "^10.8.0",
|
|
19
19
|
"@stoprocent/noble": "^1.15.2",
|
|
20
|
-
"@types/jest": "^29.5.
|
|
21
|
-
"@types/node": "^22.
|
|
20
|
+
"@types/jest": "^29.5.14",
|
|
21
|
+
"@types/node": "^22.15.18",
|
|
22
22
|
"bonjour-service": "^1.3.0",
|
|
23
|
-
"eslint": "^8.
|
|
23
|
+
"eslint": "^8.57.1",
|
|
24
24
|
"eslint-config-react-app": "^7.0.1",
|
|
25
25
|
"jest": "^29.7.0",
|
|
26
|
-
"ts-jest": "^29.
|
|
27
|
-
"typescript": "^5.
|
|
26
|
+
"ts-jest": "^29.3.4",
|
|
27
|
+
"typescript": "^5.8.3"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"lint": "eslint . --ext .ts",
|