incyclist-devices 2.0.14 → 2.0.16
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/adapters.js +1 -1
- package/lib/antv2/adapter.d.ts +2 -2
- package/lib/antv2/ant-interface.js +1 -1
- package/lib/antv2/fe/adapter.js +1 -1
- package/lib/antv2/hr/adapter.js +1 -1
- package/lib/antv2/modes/ant-fe-erg-mode.js +1 -1
- package/lib/antv2/pwr/adapter.js +1 -1
- package/lib/ble/bindings/types.d.ts +1 -1
- package/lib/ble/cp/comm.js +1 -1
- package/lib/ble/elite/comms.js +1 -1
- package/lib/ble/fm/comms.js +1 -1
- package/lib/ble/hr/comm.js +1 -1
- package/lib/ble/tacx/comms.js +1 -1
- package/lib/ble/wahoo/comms.js +1 -1
- package/lib/modes/ble-erg-mode.js +1 -1
- package/lib/modes/cycling-mode.js +1 -1
- package/lib/modes/simulator.js +1 -1
- package/lib/serial/daum/ERGCyclingMode.js +1 -1
- package/lib/serial/daum/SmartTrainerCyclingMode.js +1 -1
- package/lib/serial/daum/classic/adapter.js +1 -1
- package/lib/serial/daum/premium/adapter.js +4 -1
- package/lib/serial/daum/premium/comms.js +3 -2
- package/lib/serial/daum/premium/utils.js +2 -2
- package/lib/serial/kettler/comms.js +2 -2
- package/lib/serial/kettler/ergo-racer/modes/erg.js +1 -1
- package/lib/serial/serial-interface.js +1 -1
- package/lib/types/capabilities.js +1 -1
- package/lib/types/route.js +1 -1
- package/lib/types/user.js +1 -1
- package/package.json +9 -9
package/lib/adapters.js
CHANGED
package/lib/antv2/adapter.d.ts
CHANGED
|
@@ -28,10 +28,10 @@ export default class AntAdapter<TDeviceData extends BaseDeviceData, TData> exten
|
|
|
28
28
|
};
|
|
29
29
|
onDataFn: (data: TData) => void;
|
|
30
30
|
startupRetryPause: number;
|
|
31
|
-
protected ivDataTimeout: NodeJS.
|
|
31
|
+
protected ivDataTimeout: NodeJS.Timeout;
|
|
32
32
|
protected lastDataTS: number;
|
|
33
33
|
protected dataMsgCount: number;
|
|
34
|
-
protected ivWaitForData: NodeJS.
|
|
34
|
+
protected ivWaitForData: NodeJS.Timeout;
|
|
35
35
|
constructor(settings: AntDeviceSettings, props?: DeviceProperties);
|
|
36
36
|
createSensor(settings: AntDeviceSettings): ISensor;
|
|
37
37
|
isEqual(settings: AntDeviceSettings): boolean;
|
|
@@ -280,6 +280,6 @@ class AntInterface extends events_1.default {
|
|
|
280
280
|
return (this.activeScan === undefined || this.activeScan === null);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
exports.default = AntInterface;
|
|
284
283
|
AntInterface._instance = undefined;
|
|
285
284
|
AntInterface.INTERFACE_NAME = 'ant';
|
|
285
|
+
exports.default = AntInterface;
|
package/lib/antv2/fe/adapter.js
CHANGED
package/lib/antv2/hr/adapter.js
CHANGED
|
@@ -71,6 +71,6 @@ class AntHrAdapter extends adapter_1.default {
|
|
|
71
71
|
return this.deviceData.ComputedHeartRate !== undefined && this.deviceData.ComputedHeartRate !== null;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
exports.default = AntHrAdapter;
|
|
75
74
|
AntHrAdapter.INCYCLIST_PROFILE_NAME = 'Heartrate Monitor';
|
|
76
75
|
AntHrAdapter.ANT_PROFILE_NAME = 'HR';
|
|
76
|
+
exports.default = AntHrAdapter;
|
package/lib/antv2/pwr/adapter.js
CHANGED
|
@@ -136,6 +136,6 @@ class AntPwrAdapter extends adapter_1.ControllableAntAdapter {
|
|
|
136
136
|
TimeStamp !== undefined || TimeStamp !== null;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
exports.default = AntPwrAdapter;
|
|
140
139
|
AntPwrAdapter.INCYCLIST_PROFILE_NAME = 'Power Meter';
|
|
141
140
|
AntPwrAdapter.ANT_PROFILE_NAME = 'PWR';
|
|
141
|
+
exports.default = AntPwrAdapter;
|
|
@@ -42,7 +42,7 @@ export declare class StaticWriteCharacteristic extends MockCharacteristic {
|
|
|
42
42
|
}
|
|
43
43
|
export declare abstract class StaticNotifyCharacteristic extends MockCharacteristic {
|
|
44
44
|
cntSubscriptions: number;
|
|
45
|
-
iv: NodeJS.
|
|
45
|
+
iv: NodeJS.Timeout;
|
|
46
46
|
notifyFrequency: number;
|
|
47
47
|
constructor(uuid: string, description: string);
|
|
48
48
|
subscribe(callback: (err: Error | undefined) => void): void;
|
package/lib/ble/cp/comm.js
CHANGED
|
@@ -118,8 +118,8 @@ class BleCyclingPowerDevice extends comms_1.BleComms {
|
|
|
118
118
|
this.prevCrankData = undefined;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
exports.default = BleCyclingPowerDevice;
|
|
122
121
|
BleCyclingPowerDevice.protocol = 'cp';
|
|
123
122
|
BleCyclingPowerDevice.services = [consts_1.CSP];
|
|
124
123
|
BleCyclingPowerDevice.characteristics = [consts_1.CSP_MEASUREMENT, consts_1.CSP_FEATURE, '2a5d', '2a3c'];
|
|
125
124
|
BleCyclingPowerDevice.detectionPriority = 1;
|
|
125
|
+
exports.default = BleCyclingPowerDevice;
|
package/lib/ble/elite/comms.js
CHANGED
|
@@ -119,8 +119,8 @@ class BleEliteDevice extends comms_1.BleComms {
|
|
|
119
119
|
this.prevCrankData = undefined;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
exports.default = BleEliteDevice;
|
|
123
122
|
BleEliteDevice.protocol = 'elite';
|
|
124
123
|
BleEliteDevice.services = [consts_1.ELITE_TRAINER_SVC];
|
|
125
124
|
BleEliteDevice.characteristics = [consts_1.CSP_MEASUREMENT, consts_1.CSP_FEATURE, '2a5d', '2a3c'];
|
|
126
125
|
BleEliteDevice.detectionPriority = 10;
|
|
126
|
+
exports.default = BleEliteDevice;
|
package/lib/ble/fm/comms.js
CHANGED
|
@@ -496,8 +496,8 @@ class BleFitnessMachineDevice extends comms_1.BleComms {
|
|
|
496
496
|
this.data = {};
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
exports.default = BleFitnessMachineDevice;
|
|
500
499
|
BleFitnessMachineDevice.protocol = 'fm';
|
|
501
500
|
BleFitnessMachineDevice.services = [consts_1.FTMS];
|
|
502
501
|
BleFitnessMachineDevice.characteristics = ['2acc', consts_1.INDOOR_BIKE_DATA, '2ad6', '2ad8', consts_1.FTMS_CP, consts_1.FTMS_STATUS];
|
|
503
502
|
BleFitnessMachineDevice.detectionPriority = 100;
|
|
503
|
+
exports.default = BleFitnessMachineDevice;
|
package/lib/ble/hr/comm.js
CHANGED
|
@@ -49,8 +49,8 @@ class BleHrmDevice extends comms_1.BleComms {
|
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
exports.default = BleHrmDevice;
|
|
53
52
|
BleHrmDevice.protocol = 'hr';
|
|
54
53
|
BleHrmDevice.services = ['180d'];
|
|
55
54
|
BleHrmDevice.characteristics = ['2a37', '2a38', '2a39', '2a3c'];
|
|
56
55
|
BleHrmDevice.detectionPriority = 1;
|
|
56
|
+
exports.default = BleHrmDevice;
|
package/lib/ble/tacx/comms.js
CHANGED
|
@@ -625,9 +625,9 @@ class TacxAdvancedFitnessMachineDevice extends comms_1.default {
|
|
|
625
625
|
this.data = {};
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
exports.default = TacxAdvancedFitnessMachineDevice;
|
|
629
628
|
TacxAdvancedFitnessMachineDevice.protocol = 'tacx';
|
|
630
629
|
TacxAdvancedFitnessMachineDevice.services = [consts_1.TACX_FE_C_BLE];
|
|
631
630
|
TacxAdvancedFitnessMachineDevice.characteristics = ['2acc', '2ad2', '2ad6', '2ad8', '2ad9', '2ada', consts_1.TACX_FE_C_RX, consts_1.TACX_FE_C_TX];
|
|
632
631
|
TacxAdvancedFitnessMachineDevice.PROFILE = PROFILE_ID;
|
|
633
632
|
TacxAdvancedFitnessMachineDevice.detectionPriority = 10;
|
|
633
|
+
exports.default = TacxAdvancedFitnessMachineDevice;
|
package/lib/ble/wahoo/comms.js
CHANGED
|
@@ -391,8 +391,8 @@ class BleWahooDevice extends comms_1.default {
|
|
|
391
391
|
this.simModeSettings = undefined;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
exports.default = BleWahooDevice;
|
|
395
394
|
BleWahooDevice.protocol = 'wahoo';
|
|
396
395
|
BleWahooDevice.services = [consts_1.CSP];
|
|
397
396
|
BleWahooDevice.characteristics = ['2acc', '2ad2', '2ad6', '2ad8', '2ad9', '2ada', consts_1.WAHOO_ADVANCED_TRAINER_CP];
|
|
398
397
|
BleWahooDevice.detectionPriority = 5;
|
|
398
|
+
exports.default = BleWahooDevice;
|
|
@@ -9,7 +9,7 @@ var CyclingModeProperyType;
|
|
|
9
9
|
CyclingModeProperyType["String"] = "String";
|
|
10
10
|
CyclingModeProperyType["SingleSelect"] = "SingleSelect";
|
|
11
11
|
CyclingModeProperyType["MultiSelect"] = "MultiSelect";
|
|
12
|
-
})(CyclingModeProperyType
|
|
12
|
+
})(CyclingModeProperyType || (exports.CyclingModeProperyType = CyclingModeProperyType = {}));
|
|
13
13
|
class CyclingModeBase {
|
|
14
14
|
constructor(adapter, props) {
|
|
15
15
|
this.settings = {};
|
package/lib/modes/simulator.js
CHANGED
|
@@ -24,7 +24,7 @@ var direction;
|
|
|
24
24
|
(function (direction) {
|
|
25
25
|
direction["up"] = "up";
|
|
26
26
|
direction["down"] = "down";
|
|
27
|
-
})(direction
|
|
27
|
+
})(direction || (exports.direction = direction = {}));
|
|
28
28
|
class SmartTrainerCyclingMode extends cycling_mode_1.CyclingModeBase {
|
|
29
29
|
constructor(adapter, props) {
|
|
30
30
|
super(adapter, props);
|
|
@@ -177,6 +177,7 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
177
177
|
}
|
|
178
178
|
launch(props = {}, isRelaunch = false) {
|
|
179
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
const isPaused = this.isPaused() !== false;
|
|
180
181
|
this.setBikeProps(props);
|
|
181
182
|
const user = this.user;
|
|
182
183
|
const { route, onStatusUpdate, gear } = props;
|
|
@@ -224,6 +225,8 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
224
225
|
.then(() => {
|
|
225
226
|
this.stopped = false;
|
|
226
227
|
this.paused = false;
|
|
228
|
+
if (isPaused)
|
|
229
|
+
this.resume();
|
|
227
230
|
this.startUpdatePull();
|
|
228
231
|
return true;
|
|
229
232
|
});
|
|
@@ -240,5 +243,5 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
240
243
|
});
|
|
241
244
|
}
|
|
242
245
|
}
|
|
243
|
-
exports.default = DaumPremiumAdapter;
|
|
244
246
|
DaumPremiumAdapter.NAME = PROTOCOL_NAME;
|
|
247
|
+
exports.default = DaumPremiumAdapter;
|
|
@@ -74,8 +74,9 @@ class Daum8i {
|
|
|
74
74
|
this.isLoggingPaused = false;
|
|
75
75
|
}
|
|
76
76
|
logEvent(e) {
|
|
77
|
-
if (
|
|
78
|
-
|
|
77
|
+
if (this.isLoggingPaused)
|
|
78
|
+
return;
|
|
79
|
+
this.logger.logEvent(e);
|
|
79
80
|
const w = global.window;
|
|
80
81
|
if (w === null || w === void 0 ? void 0 : w.DEVICE_DEBUG) {
|
|
81
82
|
console.log('~~~ DaumPremium', e);
|
|
@@ -183,13 +183,13 @@ var ReservedCommands;
|
|
|
183
183
|
ReservedCommands[ReservedCommands["RELAX_GET_DATA"] = 15] = "RELAX_GET_DATA";
|
|
184
184
|
ReservedCommands[ReservedCommands["KEY_PRESSED"] = 16] = "KEY_PRESSED";
|
|
185
185
|
ReservedCommands[ReservedCommands["PROGRAM_CONTROL"] = 17] = "PROGRAM_CONTROL";
|
|
186
|
-
})(ReservedCommands
|
|
186
|
+
})(ReservedCommands || (exports.ReservedCommands = ReservedCommands = {}));
|
|
187
187
|
var BikeType;
|
|
188
188
|
(function (BikeType) {
|
|
189
189
|
BikeType[BikeType["ALLROUND"] = 0] = "ALLROUND";
|
|
190
190
|
BikeType[BikeType["RACE"] = 1] = "RACE";
|
|
191
191
|
BikeType[BikeType["MOUNTAIN"] = 2] = "MOUNTAIN";
|
|
192
|
-
})(BikeType
|
|
192
|
+
})(BikeType || (exports.BikeType = BikeType = {}));
|
|
193
193
|
function getBikeType(bikeTypeStr) {
|
|
194
194
|
if (bikeTypeStr === undefined || bikeTypeStr === null)
|
|
195
195
|
return BikeType.RACE;
|
|
@@ -32,13 +32,13 @@ var SerialCommsState;
|
|
|
32
32
|
SerialCommsState[SerialCommsState["Disconnecting"] = 3] = "Disconnecting";
|
|
33
33
|
SerialCommsState[SerialCommsState["Disconnected"] = 4] = "Disconnected";
|
|
34
34
|
SerialCommsState[SerialCommsState["Error"] = 5] = "Error";
|
|
35
|
-
})(SerialCommsState
|
|
35
|
+
})(SerialCommsState || (exports.SerialCommsState = SerialCommsState = {}));
|
|
36
36
|
var SendState;
|
|
37
37
|
(function (SendState) {
|
|
38
38
|
SendState[SendState["Idle"] = 0] = "Idle";
|
|
39
39
|
SendState[SendState["Sending"] = 1] = "Sending";
|
|
40
40
|
SendState[SendState["Receiving"] = 2] = "Receiving";
|
|
41
|
-
})(SendState
|
|
41
|
+
})(SendState || (exports.SendState = SendState = {}));
|
|
42
42
|
const getBikeProps = (props) => {
|
|
43
43
|
const { port, interface: ifaceName } = props;
|
|
44
44
|
let serial;
|
|
@@ -9,4 +9,4 @@ var IncyclistCapability;
|
|
|
9
9
|
IncyclistCapability["HeartRate"] = "heartrate";
|
|
10
10
|
IncyclistCapability["Gear"] = "gear";
|
|
11
11
|
IncyclistCapability["Control"] = "control";
|
|
12
|
-
})(IncyclistCapability
|
|
12
|
+
})(IncyclistCapability || (exports.IncyclistCapability = IncyclistCapability = {}));
|
package/lib/types/route.js
CHANGED
package/lib/types/user.js
CHANGED
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-devices",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.16",
|
|
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.
|
|
10
|
+
"incyclist-ant-plus": "^0.2.0",
|
|
11
11
|
"win32filetime": "^1.0.2"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"gd-eventlog": "^0.1.
|
|
14
|
+
"gd-eventlog": "^0.1.24"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@serialport/binding-mock": "^10.2.2",
|
|
18
18
|
"@serialport/bindings-cpp": "^10.8.0",
|
|
19
|
-
"@types/jest": "^29.
|
|
20
|
-
"@types/node": "^
|
|
21
|
-
"eslint": "^8.
|
|
19
|
+
"@types/jest": "^29.5.3",
|
|
20
|
+
"@types/node": "^20.5.0",
|
|
21
|
+
"eslint": "^8.47.0",
|
|
22
22
|
"eslint-config-react-app": "^7.0.1",
|
|
23
|
-
"jest": "^29.
|
|
24
|
-
"ts-jest": "^29.
|
|
25
|
-
"typescript": "^
|
|
23
|
+
"jest": "^29.6.2",
|
|
24
|
+
"ts-jest": "^29.1.1",
|
|
25
|
+
"typescript": "^5.1.6"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"lint": "eslint . --ext .ts",
|