incyclist-devices 2.0.38 → 2.1.1
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.d.ts +1 -1
- package/lib/antv2/adapter-factory.d.ts +4 -13
- package/lib/antv2/adapter.d.ts +16 -33
- package/lib/antv2/adapter.js +68 -112
- package/lib/antv2/ant-interface.d.ts +3 -11
- package/lib/antv2/ant-interface.js +1 -1
- package/lib/antv2/base/adapter.d.ts +62 -0
- package/lib/antv2/base/adapter.js +360 -0
- package/lib/antv2/base/ant-interface.d.ts +35 -0
- package/lib/antv2/base/ant-interface.js +285 -0
- package/lib/antv2/base/binding.d.ts +13 -0
- package/lib/antv2/base/binding.js +27 -0
- package/lib/antv2/cad/adapter.d.ts +10 -0
- package/lib/antv2/cad/adapter.js +25 -0
- package/lib/antv2/cad/index.d.ts +2 -0
- package/lib/antv2/cad/index.js +7 -0
- package/lib/antv2/consts.d.ts +2 -0
- package/lib/antv2/consts.js +5 -0
- package/lib/antv2/factories/adapter-factory.d.ts +14 -0
- package/lib/antv2/factories/adapter-factory.js +65 -0
- package/lib/antv2/factories/sensor-factory.d.ts +5 -0
- package/lib/antv2/factories/sensor-factory.js +22 -0
- package/lib/antv2/fe/adapter.d.ts +25 -26
- package/lib/antv2/fe/adapter.js +212 -218
- package/lib/antv2/hr/adapter.d.ts +6 -14
- package/lib/antv2/hr/adapter.js +7 -55
- package/lib/antv2/hr copy/adapter.d.ts +11 -0
- package/lib/antv2/hr copy/adapter.js +30 -0
- package/lib/antv2/hr copy/index.d.ts +2 -0
- package/lib/antv2/hr copy/index.js +7 -0
- package/lib/antv2/index.d.ts +5 -4
- package/lib/antv2/index.js +4 -2
- package/lib/antv2/pwr/adapter.d.ts +9 -29
- package/lib/antv2/pwr/adapter.js +20 -130
- package/lib/antv2/types.d.ts +23 -3
- package/lib/base/adpater.d.ts +42 -45
- package/lib/base/adpater.js +144 -110
- package/lib/base/consts.d.ts +4 -0
- package/lib/base/consts.js +9 -0
- package/lib/ble/adapter-factory.d.ts +4 -4
- package/lib/ble/base/adapter.d.ts +6 -24
- package/lib/ble/base/adapter.js +4 -94
- package/lib/ble/ble-interface.d.ts +2 -3
- package/lib/ble/cp/adapter.d.ts +6 -11
- package/lib/ble/cp/adapter.js +9 -12
- package/lib/ble/elite/adapter.d.ts +8 -8
- package/lib/ble/elite/adapter.js +6 -2
- package/lib/ble/fm/adapter.d.ts +11 -11
- package/lib/ble/fm/adapter.js +26 -20
- package/lib/ble/hr/adapter.d.ts +3 -4
- package/lib/ble/hr/adapter.js +2 -2
- package/lib/ble/tacx/adapter.d.ts +2 -3
- package/lib/ble/tacx/adapter.js +8 -8
- package/lib/ble/types.d.ts +1 -2
- package/lib/ble/wahoo/adapter.d.ts +2 -2
- package/lib/ble/wahoo/adapter.js +6 -6
- package/lib/ble/wahoo/comms.js +16 -16
- package/lib/factories/adapters.d.ts +7 -0
- package/lib/factories/adapters.js +49 -0
- package/lib/factories/index.d.ts +3 -0
- package/lib/factories/index.js +10 -0
- package/lib/factories/interfaces.d.ts +7 -0
- package/lib/factories/interfaces.js +27 -0
- package/lib/index.d.ts +8 -9
- package/lib/index.js +5 -8
- package/lib/interfaces.d.ts +1 -1
- package/lib/modes/ant-fe-adv-st-mode.d.ts +12 -0
- package/lib/modes/ant-fe-adv-st-mode.js +83 -0
- package/lib/modes/antble-erg.d.ts +31 -0
- package/lib/modes/antble-erg.js +28 -0
- package/lib/modes/antble-smarttrainer.d.ts +23 -0
- package/lib/modes/antble-smarttrainer.js +65 -0
- package/lib/modes/base.d.ts +29 -0
- package/lib/modes/{cycling-mode.js → base.js} +23 -26
- package/lib/modes/daum-classic-standard.d.ts +17 -0
- package/lib/modes/daum-classic-standard.js +54 -0
- package/lib/modes/daum-erg.d.ts +49 -0
- package/lib/{serial/daum/ERGCyclingMode.js → modes/daum-erg.js} +45 -73
- package/lib/modes/daum-power.d.ts +5 -0
- package/lib/{serial/daum/DaumPowerMeterCyclingMode.js → modes/daum-power.js} +1 -10
- package/lib/modes/daum-premium-standard.d.ts +24 -0
- package/lib/{serial/daum/premium/modes/daum-classic.js → modes/daum-premium-standard.js} +26 -38
- package/lib/modes/daum-smarttrainer.d.ts +83 -0
- package/lib/{serial/daum/SmartTrainerCyclingMode.js → modes/daum-smarttrainer.js} +23 -26
- package/lib/modes/kettler-erg.d.ts +44 -0
- package/lib/{serial/kettler/ergo-racer/modes/erg.js → modes/kettler-erg.js} +12 -23
- package/lib/modes/power-base.d.ts +28 -3
- package/lib/modes/power-base.js +184 -7
- package/lib/modes/power-meter.d.ts +11 -16
- package/lib/modes/power-meter.js +15 -54
- package/lib/modes/simulator.d.ts +38 -10
- package/lib/modes/simulator.js +14 -46
- package/lib/modes/{cycling-mode.d.ts → types.d.ts} +22 -30
- package/lib/modes/types.js +56 -0
- package/lib/serial/SinglePathScanner.d.ts +17 -0
- package/lib/serial/SinglePathScanner.js +87 -0
- package/lib/serial/adapter-factory.d.ts +8 -6
- package/lib/serial/adapter.d.ts +6 -11
- package/lib/serial/adapter.js +5 -2
- package/lib/serial/base/adapter.d.ts +17 -0
- package/lib/serial/base/adapter.js +67 -0
- package/lib/serial/base/comms.d.ts +62 -0
- package/lib/serial/base/comms.js +280 -0
- package/lib/serial/base/serial-interface.d.ts +36 -0
- package/lib/serial/base/serial-interface.js +288 -0
- package/lib/serial/base/serial-scanner.d.ts +16 -0
- package/lib/serial/base/serial-scanner.js +87 -0
- package/lib/serial/base/serialport.d.ts +17 -0
- package/lib/serial/base/serialport.js +87 -0
- package/lib/serial/comms.d.ts +2 -2
- package/lib/serial/daum/DaumAdapter.d.ts +26 -35
- package/lib/serial/daum/DaumAdapter.js +214 -161
- package/lib/serial/daum/classic/PROTOCOL_NAME.d.ts +2 -0
- package/lib/serial/daum/classic/PROTOCOL_NAME.js +5 -0
- package/lib/serial/daum/classic/adapter.d.ts +13 -26
- package/lib/serial/daum/classic/adapter.js +72 -176
- package/lib/serial/daum/classic/comms.d.ts +21 -17
- package/lib/serial/daum/classic/comms.js +41 -14
- package/lib/serial/daum/classic/consts.d.ts +2 -0
- package/lib/serial/daum/classic/consts.js +5 -0
- package/lib/serial/daum/classic/mock.d.ts +4 -0
- package/lib/serial/daum/classic/mock.js +18 -7
- package/lib/serial/daum/classic/types.d.ts +8 -10
- package/lib/serial/daum/classic/utils.d.ts +1 -2
- package/lib/serial/daum/consts.d.ts +0 -0
- package/lib/serial/daum/consts.js +0 -0
- package/lib/serial/daum/premium/adapter.d.ts +17 -15
- package/lib/serial/daum/premium/adapter.js +86 -109
- package/lib/serial/daum/premium/comms.d.ts +7 -7
- package/lib/serial/daum/premium/comms.js +25 -16
- package/lib/serial/daum/premium/mock.d.ts +5 -1
- package/lib/serial/daum/premium/mock.js +17 -7
- package/lib/serial/daum/premium/types.d.ts +32 -17
- package/lib/serial/daum/premium/types.js +8 -8
- package/lib/serial/daum/premium/utils.d.ts +2 -3
- package/lib/serial/daum/premium/utils.js +3 -3
- package/lib/serial/daum/types.d.ts +14 -0
- package/lib/serial/daum/types.js +13 -0
- package/lib/serial/factories/adapter-factory.d.ts +14 -0
- package/lib/serial/factories/adapter-factory.js +30 -0
- package/lib/serial/index.d.ts +8 -5
- package/lib/serial/index.js +15 -15
- package/lib/serial/kettler/comms.d.ts +1 -1
- package/lib/serial/kettler/ergo-racer/adapter.d.ts +11 -16
- package/lib/serial/kettler/ergo-racer/adapter.js +10 -12
- package/lib/serial/kettler/types.d.ts +8 -0
- package/lib/serial/kettler/types.js +2 -0
- package/lib/serial/serial-interface.d.ts +2 -32
- package/lib/serial/serial-interface.js +4 -78
- package/lib/serial/serial-scanner.d.ts +16 -0
- package/lib/serial/serial-scanner.js +87 -0
- package/lib/serial/serialport.d.ts +1 -13
- package/lib/serial/types.d.ts +45 -0
- package/lib/serial/types.js +9 -0
- package/lib/simulator/Simulator.d.ts +13 -19
- package/lib/simulator/Simulator.js +10 -51
- package/lib/types/Command.d.ts +8 -0
- package/lib/types/Command.js +2 -0
- package/lib/types/adapter.d.ts +34 -24
- package/lib/types/command.d.ts +0 -8
- package/lib/types/command.js +0 -2
- package/lib/types/data.d.ts +12 -1
- package/lib/types/device.d.ts +8 -23
- package/lib/types/device.js +9 -8
- package/lib/types/index.d.ts +6 -0
- package/lib/types/index.js +22 -0
- package/lib/types/route.d.ts +0 -19
- package/lib/types/route.js +0 -2
- package/lib/types/types.d.ts +8 -0
- package/lib/types/types.js +2 -0
- package/lib/utils/utils.d.ts +2 -1
- package/lib/utils/utils.js +22 -4
- package/package.json +3 -3
- package/lib/antv2/modes/ant-fe-adv-st-mode.d.ts +0 -9
- package/lib/antv2/modes/ant-fe-adv-st-mode.js +0 -51
- package/lib/antv2/modes/ant-fe-erg-mode.d.ts +0 -6
- package/lib/antv2/modes/ant-fe-erg-mode.js +0 -14
- package/lib/antv2/modes/ant-fe-st-mode.d.ts +0 -5
- package/lib/antv2/modes/ant-fe-st-mode.js +0 -13
- package/lib/modes/ble-erg-mode.d.ts +0 -18
- package/lib/modes/ble-erg-mode.js +0 -148
- package/lib/modes/ble-st-mode.d.ts +0 -15
- package/lib/modes/ble-st-mode.js +0 -96
- package/lib/serial/daum/DaumPowerMeterCyclingMode.d.ts +0 -8
- package/lib/serial/daum/ERGCyclingMode.d.ts +0 -26
- package/lib/serial/daum/SmartTrainerCyclingMode.d.ts +0 -42
- package/lib/serial/daum/classic/modes/daum-classic.d.ts +0 -13
- package/lib/serial/daum/classic/modes/daum-classic.js +0 -97
- package/lib/serial/daum/constants.d.ts +0 -19
- package/lib/serial/daum/constants.js +0 -22
- package/lib/serial/daum/premium/modes/daum-classic.d.ts +0 -14
- package/lib/serial/kettler/ergo-racer/modes/erg.d.ts +0 -25
package/lib/ble/elite/adapter.js
CHANGED
|
@@ -13,11 +13,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
|
-
const adapter_1 = require("../base/adapter");
|
|
16
|
+
const adapter_1 = __importDefault(require("../base/adapter"));
|
|
17
17
|
const comms_1 = __importDefault(require("./comms"));
|
|
18
18
|
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
19
19
|
const capabilities_1 = require("../../types/capabilities");
|
|
20
|
-
class BleEliteAdapter extends adapter_1.
|
|
20
|
+
class BleEliteAdapter extends adapter_1.default {
|
|
21
21
|
constructor(settings, props) {
|
|
22
22
|
super(settings, props);
|
|
23
23
|
this.distanceInternal = 0;
|
|
@@ -117,4 +117,8 @@ class BleEliteAdapter extends adapter_1.BleControllableAdapter {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
+
BleEliteAdapter.controllers = {
|
|
121
|
+
modes: [power_meter_1.default],
|
|
122
|
+
default: power_meter_1.default
|
|
123
|
+
};
|
|
120
124
|
exports.default = BleEliteAdapter;
|
package/lib/ble/fm/adapter.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import BleAdapter
|
|
2
|
-
import
|
|
3
|
-
import { DeviceProperties } from '../../types/device';
|
|
1
|
+
import BleAdapter from '../base/adapter';
|
|
2
|
+
import ICyclingMode, { CyclingMode } from '../../modes/types';
|
|
4
3
|
import { IndoorBikeData } from './types';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
export default class BleFmAdapter extends
|
|
4
|
+
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from '../types';
|
|
5
|
+
import { IAdapter, IncyclistAdapterData, IncyclistBikeData } from '../../types';
|
|
6
|
+
export default class BleFmAdapter extends BleAdapter {
|
|
8
7
|
distanceInternal: number;
|
|
9
8
|
connectPromise: Promise<boolean>;
|
|
10
|
-
constructor(settings: BleDeviceSettings, props?:
|
|
11
|
-
isSame(device:
|
|
9
|
+
constructor(settings: BleDeviceSettings, props?: BleDeviceProperties);
|
|
10
|
+
isSame(device: IAdapter): boolean;
|
|
12
11
|
getProfile(): string;
|
|
13
12
|
getName(): string;
|
|
14
13
|
getDisplayName(): string;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
isControllable(): boolean;
|
|
15
|
+
getSupportedCyclingModes(): Array<typeof CyclingMode>;
|
|
16
|
+
getDefaultCyclingMode(): ICyclingMode;
|
|
17
17
|
mapData(deviceData: IndoorBikeData): IncyclistBikeData;
|
|
18
|
-
transformData(bikeData: IncyclistBikeData):
|
|
18
|
+
transformData(bikeData: IncyclistBikeData): IncyclistAdapterData;
|
|
19
19
|
start(props?: BleStartProperties): Promise<any>;
|
|
20
20
|
sendUpdate(request: any, enforced?: boolean): Promise<void>;
|
|
21
21
|
sendInitCommands(): Promise<boolean>;
|
package/lib/ble/fm/adapter.js
CHANGED
|
@@ -14,14 +14,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
16
|
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const antble_smarttrainer_1 = __importDefault(require("../../modes/antble-smarttrainer"));
|
|
18
|
+
const antble_erg_1 = __importDefault(require("../../modes/antble-erg"));
|
|
19
19
|
const comms_1 = __importDefault(require("./comms"));
|
|
20
|
-
const adapter_1 = require("../base/adapter");
|
|
20
|
+
const adapter_1 = __importDefault(require("../base/adapter"));
|
|
21
21
|
const consts_1 = require("./consts");
|
|
22
22
|
const utils_1 = require("../../utils/utils");
|
|
23
|
-
const
|
|
24
|
-
class BleFmAdapter extends adapter_1.
|
|
23
|
+
const types_1 = require("../../types");
|
|
24
|
+
class BleFmAdapter extends adapter_1.default {
|
|
25
25
|
constructor(settings, props) {
|
|
26
26
|
super(settings, props);
|
|
27
27
|
this.distanceInternal = 0;
|
|
@@ -31,8 +31,8 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
31
31
|
const ble = this.ble;
|
|
32
32
|
this.device = new comms_1.default({ id, address, name, ble, logger });
|
|
33
33
|
this.capabilities = [
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence,
|
|
35
|
+
types_1.IncyclistCapability.Control
|
|
36
36
|
];
|
|
37
37
|
}
|
|
38
38
|
isSame(device) {
|
|
@@ -49,27 +49,30 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
49
49
|
getDisplayName() {
|
|
50
50
|
return this.getName();
|
|
51
51
|
}
|
|
52
|
+
isControllable() {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
52
55
|
getSupportedCyclingModes() {
|
|
53
56
|
var _a;
|
|
54
57
|
const modes = [power_meter_1.default];
|
|
55
58
|
const features = (_a = this.getComms()) === null || _a === void 0 ? void 0 : _a.features;
|
|
56
59
|
if (!features)
|
|
57
|
-
return [power_meter_1.default,
|
|
60
|
+
return [power_meter_1.default, antble_smarttrainer_1.default, antble_erg_1.default];
|
|
58
61
|
if (features.setPower === undefined || features.setPower)
|
|
59
|
-
modes.push(
|
|
62
|
+
modes.push(antble_erg_1.default);
|
|
60
63
|
if (features.setSlope === undefined || features.setSlope)
|
|
61
|
-
modes.push(
|
|
64
|
+
modes.push(antble_smarttrainer_1.default);
|
|
62
65
|
return modes;
|
|
63
66
|
}
|
|
64
67
|
getDefaultCyclingMode() {
|
|
65
68
|
var _a;
|
|
66
69
|
const features = (_a = this.getComms()) === null || _a === void 0 ? void 0 : _a.features;
|
|
67
70
|
if (!features)
|
|
68
|
-
return new
|
|
71
|
+
return new antble_smarttrainer_1.default(this);
|
|
69
72
|
if (features.setSlope === undefined || features.setSlope)
|
|
70
|
-
return new
|
|
73
|
+
return new antble_smarttrainer_1.default(this);
|
|
71
74
|
if (features.setPower === undefined || features.setPower)
|
|
72
|
-
return new
|
|
75
|
+
return new antble_erg_1.default(this);
|
|
73
76
|
return new power_meter_1.default(this);
|
|
74
77
|
}
|
|
75
78
|
mapData(deviceData) {
|
|
@@ -185,14 +188,14 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
185
188
|
comms.on('disconnected', this.emit);
|
|
186
189
|
}
|
|
187
190
|
const before = this.capabilities.join(',');
|
|
188
|
-
if (comms.features.heartrate && !this.hasCapability(
|
|
189
|
-
this.capabilities.push(
|
|
191
|
+
if (comms.features.heartrate && !this.hasCapability(types_1.IncyclistCapability.HeartRate)) {
|
|
192
|
+
this.capabilities.push(types_1.IncyclistCapability.HeartRate);
|
|
190
193
|
}
|
|
191
|
-
if (comms.features.cadence && !this.hasCapability(
|
|
192
|
-
this.capabilities.push(
|
|
194
|
+
if (comms.features.cadence && !this.hasCapability(types_1.IncyclistCapability.Cadence)) {
|
|
195
|
+
this.capabilities.push(types_1.IncyclistCapability.Cadence);
|
|
193
196
|
}
|
|
194
|
-
if (comms.features.power && !this.hasCapability(
|
|
195
|
-
this.capabilities.push(
|
|
197
|
+
if (comms.features.power && !this.hasCapability(types_1.IncyclistCapability.Power)) {
|
|
198
|
+
this.capabilities.push(types_1.IncyclistCapability.Power);
|
|
196
199
|
}
|
|
197
200
|
const after = this.capabilities.join(',');
|
|
198
201
|
if (before !== after) {
|
|
@@ -227,6 +230,9 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
232
|
catch (err) {
|
|
233
|
+
if (err.message === 'not connected') {
|
|
234
|
+
this.logEvent({ message: 'send bike update failed', reason: 'not connected' });
|
|
235
|
+
}
|
|
230
236
|
this.logEvent({ message: 'error', fn: 'sendUpdate()', request, error: err.message, stack: err.stack });
|
|
231
237
|
}
|
|
232
238
|
});
|
|
@@ -235,7 +241,7 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
235
241
|
return __awaiter(this, void 0, void 0, function* () {
|
|
236
242
|
if (this.started && !this.stopped) {
|
|
237
243
|
try {
|
|
238
|
-
if (this.getCyclingMode() instanceof
|
|
244
|
+
if (this.getCyclingMode() instanceof antble_erg_1.default) {
|
|
239
245
|
const power = this.data.power;
|
|
240
246
|
const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
|
|
241
247
|
yield this.sendUpdate(request, true);
|
package/lib/ble/hr/adapter.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import BleAdapter from '../base/adapter';
|
|
2
|
-
import { DeviceProperties } from '../../types
|
|
2
|
+
import { IncyclistAdapterData, IAdapter, DeviceProperties } from '../../types';
|
|
3
3
|
import { BleDeviceSettings } from '../types';
|
|
4
4
|
import { HrmData } from './types';
|
|
5
|
-
import { DeviceData } from '../../types/data';
|
|
6
5
|
export default class HrmAdapter extends BleAdapter {
|
|
7
6
|
ignore: boolean;
|
|
8
7
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
9
|
-
isSame(device:
|
|
8
|
+
isSame(device: IAdapter): boolean;
|
|
10
9
|
getProfile(): string;
|
|
11
10
|
getName(): string;
|
|
12
11
|
getDisplayName(): string;
|
|
13
|
-
mapData(deviceData: HrmData):
|
|
12
|
+
mapData(deviceData: HrmData): IncyclistAdapterData;
|
|
14
13
|
}
|
package/lib/ble/hr/adapter.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
7
7
|
const adapter_1 = __importDefault(require("../base/adapter"));
|
|
8
8
|
const comm_1 = __importDefault(require("./comm"));
|
|
9
|
-
const
|
|
9
|
+
const types_1 = require("../../types");
|
|
10
10
|
class HrmAdapter extends adapter_1.default {
|
|
11
11
|
constructor(settings, props) {
|
|
12
12
|
super(settings, props);
|
|
@@ -17,7 +17,7 @@ class HrmAdapter extends adapter_1.default {
|
|
|
17
17
|
const ble = this.ble;
|
|
18
18
|
this.device = new comm_1.default({ id, address, name, ble, logger });
|
|
19
19
|
this.capabilities = [
|
|
20
|
-
|
|
20
|
+
types_1.IncyclistCapability.HeartRate
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
23
|
isSame(device) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BleFmAdapter } from '../fm';
|
|
2
|
-
import BleAdapter from '../base/adapter';
|
|
3
|
-
import { DeviceProperties } from '../../types/device';
|
|
4
2
|
import { BleDeviceSettings, BleStartProperties } from '../types';
|
|
3
|
+
import { DeviceProperties, IAdapter } from '../../types';
|
|
5
4
|
export default class BleTacxFEAdapter extends BleFmAdapter {
|
|
6
5
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
7
|
-
isSame(device:
|
|
6
|
+
isSame(device: IAdapter): boolean;
|
|
8
7
|
getProfile(): string;
|
|
9
8
|
start(props?: BleStartProperties): Promise<any>;
|
|
10
9
|
}
|
package/lib/ble/tacx/adapter.js
CHANGED
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
16
|
const fm_1 = require("../fm");
|
|
17
17
|
const comms_1 = __importDefault(require("./comms"));
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const consts_1 = require("../../base/consts");
|
|
19
|
+
const types_1 = require("../../types");
|
|
20
20
|
class BleTacxFEAdapter extends fm_1.BleFmAdapter {
|
|
21
21
|
constructor(settings, props) {
|
|
22
22
|
super(settings, props);
|
|
@@ -26,8 +26,8 @@ class BleTacxFEAdapter extends fm_1.BleFmAdapter {
|
|
|
26
26
|
const ble = this.ble;
|
|
27
27
|
this.device = new comms_1.default({ id, address, name, ble, logger });
|
|
28
28
|
this.capabilities = [
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence,
|
|
30
|
+
types_1.IncyclistCapability.Control
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
33
|
isSame(device) {
|
|
@@ -76,8 +76,8 @@ class BleTacxFEAdapter extends fm_1.BleFmAdapter {
|
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const { user, wheelDiameter, gearRatio, bikeWeight =
|
|
80
|
-
const userWeight = (user && user.weight ? user.weight :
|
|
79
|
+
const { user, wheelDiameter, gearRatio, bikeWeight = consts_1.DEFAULT_BIKE_WEIGHT } = props || {};
|
|
80
|
+
const userWeight = (user && user.weight ? user.weight : consts_1.DEFAULT_USER_WEIGHT);
|
|
81
81
|
comms.sendTrackResistance(0.0);
|
|
82
82
|
comms.sendUserConfiguration(userWeight, bikeWeight, wheelDiameter, gearRatio);
|
|
83
83
|
const startRequest = this.getCyclingMode().getBikeInitRequest();
|
|
@@ -89,8 +89,8 @@ class BleTacxFEAdapter extends fm_1.BleFmAdapter {
|
|
|
89
89
|
this.stopped = false;
|
|
90
90
|
this.started = true;
|
|
91
91
|
this.paused = false;
|
|
92
|
-
if (comms.features && comms.features.heartrate && !this.hasCapability(
|
|
93
|
-
this.capabilities.push(
|
|
92
|
+
if (comms.features && comms.features.heartrate && !this.hasCapability(types_1.IncyclistCapability.HeartRate)) {
|
|
93
|
+
this.capabilities.push(types_1.IncyclistCapability.HeartRate);
|
|
94
94
|
}
|
|
95
95
|
return true;
|
|
96
96
|
}
|
package/lib/ble/types.d.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import EventEmitter from "events";
|
|
4
4
|
import { EventLogger } from "gd-eventlog";
|
|
5
|
-
import { DeviceProperties, DeviceSettings, DeviceStartProperties, IncyclistScanProps } from "../types
|
|
6
|
-
import { InterfaceProps } from "../types/interface";
|
|
5
|
+
import { DeviceProperties, DeviceSettings, DeviceStartProperties, IncyclistScanProps, InterfaceProps } from "../types";
|
|
7
6
|
export type BleProtocol = 'hr' | 'fm' | 'cp' | 'tacx' | 'wahoo' | 'elite';
|
|
8
7
|
export type BleInterfaceState = 'unknown' | 'resetting' | 'unsupported' | 'unauthorized' | 'poweredOff' | 'poweredOn';
|
|
9
8
|
export interface BleBinding extends EventEmitter {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BleFmAdapter } from '../fm';
|
|
2
|
-
import BleAdapter from '../base/adapter';
|
|
3
2
|
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from '../types';
|
|
3
|
+
import { IAdapter } from '../../types';
|
|
4
4
|
export default class BleWahooAdapter extends BleFmAdapter {
|
|
5
5
|
constructor(settings: BleDeviceSettings, props?: BleDeviceProperties);
|
|
6
|
-
isSame(device:
|
|
6
|
+
isSame(device: IAdapter): boolean;
|
|
7
7
|
getProfile(): string;
|
|
8
8
|
start(props?: BleStartProperties): Promise<any>;
|
|
9
9
|
}
|
package/lib/ble/wahoo/adapter.js
CHANGED
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
16
|
const fm_1 = require("../fm");
|
|
17
17
|
const comms_1 = __importDefault(require("./comms"));
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const consts_1 = require("../../base/consts");
|
|
19
|
+
const types_1 = require("../../types");
|
|
20
20
|
class BleWahooAdapter extends fm_1.BleFmAdapter {
|
|
21
21
|
constructor(settings, props) {
|
|
22
22
|
super(settings, props);
|
|
@@ -26,8 +26,8 @@ class BleWahooAdapter extends fm_1.BleFmAdapter {
|
|
|
26
26
|
const ble = this.ble;
|
|
27
27
|
this.device = new comms_1.default({ id, address, name, ble, logger });
|
|
28
28
|
this.capabilities = [
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence,
|
|
30
|
+
types_1.IncyclistCapability.Control
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
33
|
isSame(device) {
|
|
@@ -75,8 +75,8 @@ class BleWahooAdapter extends fm_1.BleFmAdapter {
|
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const { user, bikeWeight =
|
|
79
|
-
const weight = (user && user.weight ? Number(user.weight) :
|
|
78
|
+
const { user, bikeWeight = consts_1.DEFAULT_BIKE_WEIGHT } = props || {};
|
|
79
|
+
const weight = (user && user.weight ? Number(user.weight) : consts_1.DEFAULT_USER_WEIGHT) + bikeWeight;
|
|
80
80
|
yield comms.setSimMode(weight, comms.getCrr(), comms.getCw());
|
|
81
81
|
const startRequest = this.getCyclingMode().getBikeInitRequest();
|
|
82
82
|
yield this.sendUpdate(startRequest);
|
package/lib/ble/wahoo/comms.js
CHANGED
|
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const _1 = require(".");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const consts_1 = require("../../base/consts");
|
|
17
|
+
const consts_2 = require("../consts");
|
|
18
18
|
const comms_1 = __importDefault(require("../fm/comms"));
|
|
19
19
|
const utils_1 = require("../utils");
|
|
20
20
|
const ErgWriteDelay = 2000;
|
|
@@ -27,15 +27,15 @@ class BleWahooDevice extends comms_1.default {
|
|
|
27
27
|
this.tsPrevWrite = undefined;
|
|
28
28
|
this.prevSlope = undefined;
|
|
29
29
|
this.isRequestControlBusy = false;
|
|
30
|
-
this.weight =
|
|
30
|
+
this.weight = consts_1.DEFAULT_BIKE_WEIGHT + consts_1.DEFAULT_USER_WEIGHT;
|
|
31
31
|
this.data = {};
|
|
32
|
-
this.wahooCP =
|
|
32
|
+
this.wahooCP = consts_2.WAHOO_ADVANCED_TRAINER_CP;
|
|
33
33
|
}
|
|
34
34
|
static isMatching(characteristics) {
|
|
35
35
|
if (!characteristics)
|
|
36
36
|
return false;
|
|
37
|
-
const hasWahooCP = characteristics.find(c => (0, utils_1.matches)(c,
|
|
38
|
-
const hasFTMS = characteristics.find(c => (0, utils_1.matches)(c,
|
|
37
|
+
const hasWahooCP = characteristics.find(c => (0, utils_1.matches)(c, consts_2.WAHOO_ADVANCED_TRAINER_CP)) !== undefined;
|
|
38
|
+
const hasFTMS = characteristics.find(c => (0, utils_1.matches)(c, consts_2.FTMS_CP)) !== undefined;
|
|
39
39
|
return hasWahooCP && !hasFTMS;
|
|
40
40
|
}
|
|
41
41
|
init() {
|
|
@@ -46,8 +46,8 @@ class BleWahooDevice extends comms_1.default {
|
|
|
46
46
|
try {
|
|
47
47
|
yield this.subscribeWriteResponse(this.wahooCP);
|
|
48
48
|
try {
|
|
49
|
-
if (this.wahooCP !==
|
|
50
|
-
yield this.subscribeWriteResponse(
|
|
49
|
+
if (this.wahooCP !== consts_2.WAHOO_ADVANCED_TRAINER_CP_FULL.toLowerCase())
|
|
50
|
+
yield this.subscribeWriteResponse(consts_2.WAHOO_ADVANCED_TRAINER_CP_FULL.toLowerCase());
|
|
51
51
|
}
|
|
52
52
|
catch (err) {
|
|
53
53
|
}
|
|
@@ -62,7 +62,7 @@ class BleWahooDevice extends comms_1.default {
|
|
|
62
62
|
setCharacteristicUUIDs(uuids) {
|
|
63
63
|
this.logEvent({ message: 'set uuids', uuids });
|
|
64
64
|
uuids.forEach(c => {
|
|
65
|
-
if ((0, utils_1.matches)(c,
|
|
65
|
+
if ((0, utils_1.matches)(c, consts_2.WAHOO_ADVANCED_TRAINER_CP))
|
|
66
66
|
this.wahooCP = c;
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -143,16 +143,16 @@ class BleWahooDevice extends comms_1.default {
|
|
|
143
143
|
const uuid = characteristic.toLowerCase();
|
|
144
144
|
let res = undefined;
|
|
145
145
|
switch (uuid) {
|
|
146
|
-
case
|
|
146
|
+
case consts_2.CSP_MEASUREMENT:
|
|
147
147
|
res = this.parsePower(data);
|
|
148
148
|
break;
|
|
149
|
-
case
|
|
149
|
+
case consts_2.INDOOR_BIKE_DATA:
|
|
150
150
|
res = this.parseIndoorBikeData(data);
|
|
151
151
|
break;
|
|
152
|
-
case
|
|
152
|
+
case consts_2.HR_MEASUREMENT:
|
|
153
153
|
res = this.parseHrm(data);
|
|
154
154
|
break;
|
|
155
|
-
case
|
|
155
|
+
case consts_2.FTMS_STATUS:
|
|
156
156
|
res = this.parseFitnessMachineStatus(data);
|
|
157
157
|
break;
|
|
158
158
|
default:
|
|
@@ -166,7 +166,7 @@ class BleWahooDevice extends comms_1.default {
|
|
|
166
166
|
return true;
|
|
167
167
|
}
|
|
168
168
|
subscribeAll(conn) {
|
|
169
|
-
return this.subscribeMultiple([
|
|
169
|
+
return this.subscribeMultiple([consts_2.CSP_MEASUREMENT, consts_2.INDOOR_BIKE_DATA, consts_2.HR_MEASUREMENT, consts_2.FTMS_STATUS, this.wahooCP], conn);
|
|
170
170
|
}
|
|
171
171
|
writeWahooFtmsMessage(requestedOpCode, data, props) {
|
|
172
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -392,7 +392,7 @@ class BleWahooDevice extends comms_1.default {
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
BleWahooDevice.protocol = 'wahoo';
|
|
395
|
-
BleWahooDevice.services = [
|
|
396
|
-
BleWahooDevice.characteristics = ['2acc', '2ad2', '2ad6', '2ad8', '2ad9', '2ada',
|
|
395
|
+
BleWahooDevice.services = [consts_2.CSP];
|
|
396
|
+
BleWahooDevice.characteristics = ['2acc', '2ad2', '2ad6', '2ad8', '2ad9', '2ada', consts_2.WAHOO_ADVANCED_TRAINER_CP];
|
|
397
397
|
BleWahooDevice.detectionPriority = 5;
|
|
398
398
|
exports.default = BleWahooDevice;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IncyclistDeviceAdapter } from "../base/adpater";
|
|
2
|
+
import { DeviceProperties, DeviceSettings } from "../types/device";
|
|
3
|
+
export default class AdapterFactory {
|
|
4
|
+
static adapters: IncyclistDeviceAdapter[];
|
|
5
|
+
static reset(): void;
|
|
6
|
+
static create(settings: DeviceSettings, props?: DeviceProperties): any;
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const antv2_1 = require("../antv2");
|
|
4
|
+
const ble_1 = require("../ble");
|
|
5
|
+
const serial_1 = require("../serial");
|
|
6
|
+
const Simulator_1 = require("../simulator/Simulator");
|
|
7
|
+
const device_1 = require("../types/device");
|
|
8
|
+
class AdapterFactory {
|
|
9
|
+
static reset() {
|
|
10
|
+
AdapterFactory.adapters = [];
|
|
11
|
+
ble_1.BleAdapterFactory.getInstance().instances = [];
|
|
12
|
+
}
|
|
13
|
+
static create(settings, props) {
|
|
14
|
+
const adapters = AdapterFactory.adapters;
|
|
15
|
+
if (!settings.interface && settings.protocol === 'Simulator') {
|
|
16
|
+
const adapter = new Simulator_1.Simulator(settings);
|
|
17
|
+
if (adapter) {
|
|
18
|
+
adapters.push(adapter);
|
|
19
|
+
}
|
|
20
|
+
return adapter;
|
|
21
|
+
}
|
|
22
|
+
const existing = adapters.find(a => a.isEqual(settings));
|
|
23
|
+
if (existing)
|
|
24
|
+
return existing;
|
|
25
|
+
const ifaceName = typeof settings.interface === 'string' ? settings.interface : settings.interface.getName();
|
|
26
|
+
let adapter;
|
|
27
|
+
switch (ifaceName) {
|
|
28
|
+
case device_1.INTERFACE.SERIAL:
|
|
29
|
+
case device_1.INTERFACE.TCPIP:
|
|
30
|
+
adapter = serial_1.SerialAdapterFactory.getInstance().createInstance(settings, props);
|
|
31
|
+
break;
|
|
32
|
+
case device_1.INTERFACE.ANT:
|
|
33
|
+
adapter = antv2_1.AntAdapterFactory.getInstance().createInstance(settings, props);
|
|
34
|
+
break;
|
|
35
|
+
case device_1.INTERFACE.BLE:
|
|
36
|
+
adapter = ble_1.BleAdapterFactory.getInstance().createInstance(settings, props);
|
|
37
|
+
break;
|
|
38
|
+
case device_1.INTERFACE.SIMULATOR:
|
|
39
|
+
adapter = new Simulator_1.Simulator(settings, props);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
if (adapter) {
|
|
43
|
+
adapters.push(adapter);
|
|
44
|
+
}
|
|
45
|
+
return adapter;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
AdapterFactory.adapters = [];
|
|
49
|
+
exports.default = AdapterFactory;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InterfaceFactory = exports.AdapterFactory = void 0;
|
|
7
|
+
const adapters_1 = __importDefault(require("./adapters"));
|
|
8
|
+
exports.AdapterFactory = adapters_1.default;
|
|
9
|
+
const interfaces_1 = __importDefault(require("./interfaces"));
|
|
10
|
+
exports.InterfaceFactory = interfaces_1.default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InterfaceProps } from "../types/interface";
|
|
2
|
+
import { SerialInterface } from "../serial";
|
|
3
|
+
import AntInterface from "../antv2/base/ant-interface";
|
|
4
|
+
import { BleInterface } from "../ble";
|
|
5
|
+
export default class InterfaceFactory {
|
|
6
|
+
static create(ifaceName: string, props?: InterfaceProps): AntInterface | BleInterface | SerialInterface;
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const serial_1 = require("../serial");
|
|
7
|
+
const ant_interface_1 = __importDefault(require("../antv2/base/ant-interface"));
|
|
8
|
+
const device_1 = require("../types/device");
|
|
9
|
+
const ble_1 = require("../ble");
|
|
10
|
+
class InterfaceFactory {
|
|
11
|
+
static create(ifaceName, props) {
|
|
12
|
+
switch (ifaceName) {
|
|
13
|
+
case device_1.INTERFACE.SERIAL:
|
|
14
|
+
case device_1.INTERFACE.TCPIP:
|
|
15
|
+
const serialProps = props;
|
|
16
|
+
serialProps.ifaceName = ifaceName;
|
|
17
|
+
return serial_1.SerialInterface.getInstance(serialProps);
|
|
18
|
+
case device_1.INTERFACE.ANT:
|
|
19
|
+
const antProps = props;
|
|
20
|
+
return ant_interface_1.default.getInstance(antProps);
|
|
21
|
+
case device_1.INTERFACE.BLE:
|
|
22
|
+
const bleProps = props;
|
|
23
|
+
return ble_1.BleInterface.getInstance(bleProps);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = InterfaceFactory;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { INTERFACE } from './types/device';
|
|
2
|
-
import InterfaceFactory from './interfaces';
|
|
3
|
-
import AdapterFactory from './adapters';
|
|
4
2
|
import { IncyclistInterface, InterfaceProps } from './types/interface';
|
|
5
|
-
import { IncyclistDeviceAdapter, Bike as Controllable } from './types/adapter';
|
|
6
|
-
import { ControllableDevice as ControllableDeviceAdapter } from './base/adpater';
|
|
7
3
|
import { IncyclistCapability } from './types/capabilities';
|
|
8
|
-
import {
|
|
9
|
-
import { DeviceSettings } from './types/device';
|
|
10
|
-
import
|
|
4
|
+
import { IncyclistAdapterData } from './types/data';
|
|
5
|
+
import { DeviceSettings, DeviceProperties } from './types/device';
|
|
6
|
+
import ICyclingMode from './modes/types';
|
|
11
7
|
import calc from './utils/calculations';
|
|
12
|
-
|
|
8
|
+
import IncyclistDevice, { IncyclistDeviceAdapter } from './base/adpater';
|
|
9
|
+
import { IAdapter } from './types/adapter';
|
|
10
|
+
export * from './factories';
|
|
11
|
+
export * from './modes/types';
|
|
13
12
|
export * from './serial';
|
|
14
13
|
export * from './ble';
|
|
15
14
|
export * from './antv2';
|
|
16
|
-
export {
|
|
15
|
+
export { IAdapter, IncyclistDevice, IncyclistDeviceAdapter, DeviceSettings, DeviceProperties, IncyclistInterface, INTERFACE, InterfaceProps, ICyclingMode, IncyclistAdapterData as DeviceData, IncyclistCapability, calc, };
|
package/lib/index.js
CHANGED
|
@@ -17,20 +17,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.calc = exports.IncyclistCapability = exports.
|
|
20
|
+
exports.calc = exports.IncyclistCapability = exports.INTERFACE = exports.IncyclistDevice = void 0;
|
|
21
21
|
const device_1 = require("./types/device");
|
|
22
22
|
Object.defineProperty(exports, "INTERFACE", { enumerable: true, get: function () { return device_1.INTERFACE; } });
|
|
23
|
-
const interfaces_1 = __importDefault(require("./interfaces"));
|
|
24
|
-
exports.InterfaceFactory = interfaces_1.default;
|
|
25
|
-
const adapters_1 = __importDefault(require("./adapters"));
|
|
26
|
-
exports.AdapterFactory = adapters_1.default;
|
|
27
|
-
const adpater_1 = require("./base/adpater");
|
|
28
|
-
Object.defineProperty(exports, "ControllableDeviceAdapter", { enumerable: true, get: function () { return adpater_1.ControllableDevice; } });
|
|
29
23
|
const capabilities_1 = require("./types/capabilities");
|
|
30
24
|
Object.defineProperty(exports, "IncyclistCapability", { enumerable: true, get: function () { return capabilities_1.IncyclistCapability; } });
|
|
31
25
|
const calculations_1 = __importDefault(require("./utils/calculations"));
|
|
32
26
|
exports.calc = calculations_1.default;
|
|
33
|
-
|
|
27
|
+
const adpater_1 = __importDefault(require("./base/adpater"));
|
|
28
|
+
exports.IncyclistDevice = adpater_1.default;
|
|
29
|
+
__exportStar(require("./factories"), exports);
|
|
30
|
+
__exportStar(require("./modes/types"), exports);
|
|
34
31
|
__exportStar(require("./serial"), exports);
|
|
35
32
|
__exportStar(require("./ble"), exports);
|
|
36
33
|
__exportStar(require("./antv2"), exports);
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { SerialInterface } from "./serial";
|
|
|
3
3
|
import AntInterface from "./antv2/ant-interface";
|
|
4
4
|
import { BleInterface } from "./ble";
|
|
5
5
|
export default class InterfaceFactory {
|
|
6
|
-
static create(ifaceName: string, props?: InterfaceProps):
|
|
6
|
+
static create(ifaceName: string, props?: InterfaceProps): AntInterface | BleInterface | SerialInterface;
|
|
7
7
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IncyclistDeviceAdapter } from "../base/adpater";
|
|
2
|
+
import SmartTrainerCyclingMode from "./antble-smarttrainer";
|
|
3
|
+
import { UpdateRequest } from "./types";
|
|
4
|
+
export default class AntAdvSimCyclingMode extends SmartTrainerCyclingMode {
|
|
5
|
+
constructor(adapter: IncyclistDeviceAdapter, props?: any);
|
|
6
|
+
getName(): string;
|
|
7
|
+
getDescription(): string;
|
|
8
|
+
checkForResetOrEmpty(request: UpdateRequest): UpdateRequest | undefined;
|
|
9
|
+
protected checkForTempPowerAdjustments(request: UpdateRequest, newRequest?: UpdateRequest): void;
|
|
10
|
+
protected checkEmptyRequest(newRequest: UpdateRequest): void;
|
|
11
|
+
sendBikeUpdate(incoming: UpdateRequest): UpdateRequest;
|
|
12
|
+
}
|