incyclist-devices 1.5.38 → 2.0.0
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/README.MD +238 -0
- package/lib/adapters.d.ts +7 -0
- package/lib/adapters.js +49 -0
- package/lib/antv2/adapter-factory.d.ts +21 -10
- package/lib/antv2/adapter-factory.js +51 -33
- package/lib/antv2/adapter.d.ts +65 -0
- package/lib/antv2/adapter.js +310 -0
- package/lib/antv2/ant-interface.d.ts +17 -11
- package/lib/antv2/ant-interface.js +41 -31
- package/lib/antv2/{ant-binding.d.ts → binding.d.ts} +1 -1
- package/lib/antv2/{ant-binding.js → binding.js} +1 -1
- package/lib/antv2/fe/adapter.d.ts +28 -0
- package/lib/antv2/{fe.js → fe/adapter.js} +106 -90
- package/lib/antv2/fe/index.d.ts +2 -0
- package/lib/antv2/fe/index.js +7 -0
- package/lib/antv2/hr/adapter.d.ts +15 -0
- package/lib/antv2/hr/adapter.js +76 -0
- package/lib/antv2/hr/index.d.ts +2 -0
- package/lib/antv2/hr/index.js +7 -0
- package/lib/antv2/index.d.ts +7 -0
- package/lib/antv2/index.js +20 -0
- package/lib/antv2/modes/ant-fe-adv-st-mode.d.ts +9 -0
- package/lib/{ant/antfe → antv2/modes}/ant-fe-adv-st-mode.js +1 -1
- package/lib/antv2/modes/ant-fe-erg-mode.d.ts +6 -0
- package/lib/{ant/antfe → antv2/modes}/ant-fe-erg-mode.js +1 -1
- package/lib/antv2/modes/ant-fe-st-mode.d.ts +5 -0
- package/lib/{ant/antfe → antv2/modes}/ant-fe-st-mode.js +1 -1
- package/lib/antv2/pwr/adapter.d.ts +24 -0
- package/lib/antv2/pwr/adapter.js +141 -0
- package/lib/antv2/pwr/index.d.ts +2 -0
- package/lib/antv2/pwr/index.js +7 -0
- package/lib/antv2/sensor-factory.d.ts +2 -2
- package/lib/antv2/types.d.ts +22 -0
- package/lib/antv2/types.js +5 -0
- package/lib/antv2/utils.d.ts +4 -0
- package/lib/antv2/utils.js +192 -0
- package/lib/base/adpater.d.ts +68 -0
- package/lib/base/adpater.js +183 -0
- package/lib/ble/adapter-factory.d.ts +33 -0
- package/lib/ble/adapter-factory.js +105 -0
- package/lib/ble/base/adapter.d.ts +53 -0
- package/lib/ble/base/adapter.js +290 -0
- package/lib/ble/base/comms-utils.d.ts +7 -0
- package/lib/ble/base/comms-utils.js +91 -0
- package/lib/ble/{ble-device.d.ts → base/comms.d.ts} +31 -16
- package/lib/ble/{ble-device.js → base/comms.js} +193 -55
- package/lib/ble/bindings/index.d.ts +2 -0
- package/lib/ble/bindings/index.js +8 -0
- package/lib/ble/bindings/linux.d.ts +15 -0
- package/lib/ble/bindings/linux.js +39 -0
- package/lib/ble/bindings/mock.d.ts +9 -0
- package/lib/ble/bindings/mock.js +108 -0
- package/lib/ble/bindings/types.d.ts +57 -0
- package/lib/ble/bindings/types.js +96 -0
- package/lib/ble/ble-interface.d.ts +38 -59
- package/lib/ble/ble-interface.js +254 -462
- package/lib/ble/ble-peripheral.d.ts +7 -5
- package/lib/ble/ble-peripheral.js +52 -21
- package/lib/ble/consts.d.ts +3 -0
- package/lib/ble/consts.js +4 -1
- package/lib/ble/cp/adapter.d.ts +22 -0
- package/lib/ble/cp/adapter.js +111 -0
- package/lib/ble/cp/comm.d.ts +31 -0
- package/lib/ble/cp/comm.js +125 -0
- package/lib/ble/cp/index.d.ts +4 -0
- package/lib/ble/cp/index.js +10 -0
- package/lib/ble/cp/types.d.ts +13 -0
- package/lib/ble/cp/types.js +2 -0
- package/lib/ble/elite/adapter.d.ts +19 -0
- package/lib/ble/elite/adapter.js +120 -0
- package/lib/ble/elite/comms.d.ts +32 -0
- package/lib/ble/elite/comms.js +126 -0
- package/lib/ble/elite/index.d.ts +3 -0
- package/lib/ble/elite/index.js +10 -0
- package/lib/ble/fm/adapter.d.ts +22 -0
- package/lib/ble/fm/adapter.js +249 -0
- package/lib/ble/fm/comms.d.ts +50 -0
- package/lib/ble/{fm.js → fm/comms.js} +34 -277
- package/lib/ble/fm/consts.d.ts +6 -0
- package/lib/ble/fm/consts.js +9 -0
- package/lib/ble/fm/index.d.ts +5 -0
- package/lib/ble/fm/index.js +13 -0
- package/lib/ble/fm/types.d.ts +30 -0
- package/lib/ble/fm/types.js +2 -0
- package/lib/ble/hr/adapter.d.ts +14 -0
- package/lib/ble/hr/adapter.js +45 -0
- package/lib/ble/hr/comm.d.ts +19 -0
- package/lib/ble/hr/comm.js +56 -0
- package/lib/ble/hr/index.d.ts +4 -0
- package/lib/ble/hr/index.js +10 -0
- package/lib/ble/hr/mock.d.ts +7 -0
- package/lib/ble/hr/mock.js +47 -0
- package/lib/ble/hr/types.d.ts +5 -0
- package/lib/ble/hr/types.js +2 -0
- package/lib/ble/index.d.ts +9 -0
- package/lib/ble/index.js +26 -0
- package/lib/ble/peripheral-cache.d.ts +43 -0
- package/lib/ble/peripheral-cache.js +107 -0
- package/lib/ble/tacx/adapter.d.ts +10 -0
- package/lib/ble/tacx/adapter.js +99 -0
- package/lib/ble/{tacx.d.ts → tacx/comms.d.ts} +11 -43
- package/lib/ble/{tacx.js → tacx/comms.js} +23 -155
- package/lib/ble/tacx/index.d.ts +4 -0
- package/lib/ble/tacx/index.js +10 -0
- package/lib/ble/tacx/types.d.ts +25 -0
- package/lib/ble/tacx/types.js +2 -0
- package/lib/ble/types.d.ts +128 -0
- package/lib/ble/types.js +2 -0
- package/lib/ble/utils.d.ts +17 -0
- package/lib/ble/utils.js +54 -0
- package/lib/ble/wahoo/adapter.d.ts +9 -0
- package/lib/ble/wahoo/adapter.js +95 -0
- package/lib/ble/{wahoo-kickr.d.ts → wahoo/comms.d.ts} +11 -44
- package/lib/ble/{wahoo-kickr.js → wahoo/comms.js} +29 -129
- package/lib/ble/wahoo/index.d.ts +4 -0
- package/lib/ble/wahoo/index.js +10 -0
- package/lib/ble/wahoo/types.d.ts +19 -0
- package/lib/ble/wahoo/types.js +2 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +34 -0
- package/lib/interfaces.d.ts +7 -0
- package/lib/interfaces.js +27 -0
- package/lib/{ble → modes}/ble-erg-mode.d.ts +4 -4
- package/lib/{ble → modes}/ble-erg-mode.js +2 -2
- package/lib/{ble → modes}/ble-st-mode.d.ts +3 -3
- package/lib/{ble → modes}/ble-st-mode.js +1 -1
- package/lib/{cycling-mode.d.ts → modes/cycling-mode.d.ts} +8 -8
- package/lib/modes/power-base.d.ts +3 -3
- package/lib/modes/power-base.js +8 -4
- package/lib/modes/power-meter.d.ts +3 -3
- package/lib/modes/simulator.d.ts +2 -2
- package/lib/modes/simulator.js +1 -1
- package/lib/serial/adapter-factory.d.ts +12 -0
- package/lib/serial/adapter-factory.js +30 -0
- package/lib/serial/adapter.d.ts +21 -0
- package/lib/serial/adapter.js +61 -0
- package/lib/serial/bindings/tcp.d.ts +45 -0
- package/lib/serial/bindings/tcp.js +284 -0
- package/lib/serial/comm.d.ts +7 -0
- package/lib/serial/comm.js +2 -0
- package/lib/{daum → serial/daum}/DaumAdapter.d.ts +14 -23
- package/lib/{daum → serial/daum}/DaumAdapter.js +57 -97
- package/lib/{daum → serial/daum}/DaumPowerMeterCyclingMode.d.ts +2 -2
- package/lib/{daum → serial/daum}/DaumPowerMeterCyclingMode.js +1 -1
- package/lib/{daum → serial/daum}/ERGCyclingMode.d.ts +3 -3
- package/lib/{daum → serial/daum}/ERGCyclingMode.js +3 -3
- package/lib/{daum → serial/daum}/SmartTrainerCyclingMode.d.ts +3 -3
- package/lib/{daum → serial/daum}/SmartTrainerCyclingMode.js +4 -3
- package/lib/serial/daum/classic/adapter.d.ts +29 -0
- package/lib/{daum/classic/DaumClassicAdapter.js → serial/daum/classic/adapter.js} +77 -50
- package/lib/{daum/classic/bike.d.ts → serial/daum/classic/comms.d.ts} +14 -16
- package/lib/{daum/classic/bike.js → serial/daum/classic/comms.js} +68 -152
- package/lib/serial/daum/classic/mock.d.ts +96 -0
- package/lib/serial/daum/classic/mock.js +365 -0
- package/lib/{daum/classic/DaumClassicCyclingMode.d.ts → serial/daum/classic/modes/daum-classic.d.ts} +3 -3
- package/lib/{daum/classic/DaumClassicCyclingMode.js → serial/daum/classic/modes/daum-classic.js} +2 -2
- package/lib/{daum → serial/daum}/classic/utils.d.ts +1 -1
- package/lib/serial/daum/premium/adapter.d.ts +25 -0
- package/lib/{daum/premium/DaumPremiumAdapter.js → serial/daum/premium/adapter.js} +107 -47
- package/lib/{daum/premium/bike.d.ts → serial/daum/premium/comms.d.ts} +26 -54
- package/lib/{daum/premium/bike.js → serial/daum/premium/comms.js} +215 -420
- package/lib/serial/daum/premium/mock.d.ts +75 -0
- package/lib/serial/daum/premium/mock.js +289 -0
- package/lib/{daum/premium/DaumClassicCyclingMode.d.ts → serial/daum/premium/modes/daum-classic.d.ts} +3 -3
- package/lib/{daum/premium/DaumClassicCyclingMode.js → serial/daum/premium/modes/daum-classic.js} +2 -2
- package/lib/serial/daum/premium/types.d.ts +12 -0
- package/lib/serial/daum/premium/types.js +2 -0
- package/lib/{daum → serial/daum}/premium/utils.d.ts +8 -11
- package/lib/{daum → serial/daum}/premium/utils.js +22 -63
- package/lib/serial/index.d.ts +9 -0
- package/lib/serial/index.js +49 -0
- package/lib/{kettler → serial/kettler}/comms.d.ts +8 -6
- package/lib/{kettler → serial/kettler}/comms.js +71 -32
- package/lib/{kettler → serial/kettler}/ergo-racer/adapter.d.ts +14 -28
- package/lib/{kettler → serial/kettler}/ergo-racer/adapter.js +102 -169
- package/lib/serial/kettler/ergo-racer/mock.d.ts +66 -0
- package/lib/serial/kettler/ergo-racer/mock.js +216 -0
- package/lib/{kettler/ergo-racer/ERGCyclingMode.d.ts → serial/kettler/ergo-racer/modes/erg.d.ts} +4 -4
- package/lib/{kettler/ergo-racer/ERGCyclingMode.js → serial/kettler/ergo-racer/modes/erg.js} +2 -2
- package/lib/serial/serial-interface.d.ts +60 -0
- package/lib/serial/serial-interface.js +309 -0
- package/lib/simulator/Simulator.d.ts +12 -25
- package/lib/simulator/Simulator.js +26 -87
- package/lib/types/adapter.d.ts +39 -0
- package/lib/types/adapter.js +2 -0
- package/lib/types/capabilities.d.ts +8 -0
- package/lib/types/capabilities.js +12 -0
- package/lib/types/data.d.ts +12 -0
- package/lib/types/data.js +2 -0
- package/lib/types/device.d.ts +32 -0
- package/lib/types/device.js +11 -0
- package/lib/types/interface.d.ts +18 -0
- package/lib/types/interface.js +2 -0
- package/lib/types/route.d.ts +2 -2
- package/lib/types/user.d.ts +1 -1
- package/lib/{utils.d.ts → utils/utils.d.ts} +1 -0
- package/lib/{utils.js → utils/utils.js} +5 -1
- package/package.json +16 -14
- package/lib/DeviceSupport.d.ts +0 -36
- package/lib/DeviceSupport.js +0 -82
- package/lib/ant/AntAdapter.d.ts +0 -50
- package/lib/ant/AntAdapter.js +0 -109
- package/lib/ant/AntScanner.d.ts +0 -60
- package/lib/ant/AntScanner.js +0 -651
- package/lib/ant/antfe/AntFEAdapter.d.ts +0 -83
- package/lib/ant/antfe/AntFEAdapter.js +0 -652
- package/lib/ant/antfe/ant-fe-adv-st-mode.d.ts +0 -9
- package/lib/ant/antfe/ant-fe-erg-mode.d.ts +0 -6
- package/lib/ant/antfe/ant-fe-st-mode.d.ts +0 -5
- package/lib/ant/anthrm/AntHrmAdapter.d.ts +0 -16
- package/lib/ant/anthrm/AntHrmAdapter.js +0 -130
- package/lib/ant/antpwr/pwr-adapter.d.ts +0 -49
- package/lib/ant/antpwr/pwr-adapter.js +0 -251
- package/lib/ant/utils.d.ts +0 -1
- package/lib/ant/utils.js +0 -23
- package/lib/antv2/AntAdapter.d.ts +0 -48
- package/lib/antv2/AntAdapter.js +0 -104
- package/lib/antv2/ant-device.d.ts +0 -59
- package/lib/antv2/ant-device.js +0 -161
- package/lib/antv2/fe.d.ts +0 -32
- package/lib/antv2/hr.d.ts +0 -18
- package/lib/antv2/hr.js +0 -102
- package/lib/antv2/incyclist-protocol.d.ts +0 -37
- package/lib/antv2/incyclist-protocol.js +0 -126
- package/lib/antv2/pwr.d.ts +0 -28
- package/lib/antv2/pwr.js +0 -171
- package/lib/ble/ble.d.ts +0 -129
- package/lib/ble/ble.js +0 -86
- package/lib/ble/elite.d.ts +0 -90
- package/lib/ble/elite.js +0 -322
- package/lib/ble/fm.d.ts +0 -125
- package/lib/ble/hrm.d.ts +0 -48
- package/lib/ble/hrm.js +0 -134
- package/lib/ble/incyclist-protocol.d.ts +0 -31
- package/lib/ble/incyclist-protocol.js +0 -153
- package/lib/ble/pwr.d.ts +0 -89
- package/lib/ble/pwr.js +0 -322
- package/lib/daum/classic/DaumClassicAdapter.d.ts +0 -28
- package/lib/daum/classic/DaumClassicProtocol.d.ts +0 -27
- package/lib/daum/classic/DaumClassicProtocol.js +0 -185
- package/lib/daum/premium/DaumPremiumAdapter.d.ts +0 -16
- package/lib/daum/premium/DaumPremiumProtocol.d.ts +0 -32
- package/lib/daum/premium/DaumPremiumProtocol.js +0 -207
- package/lib/daum/premium/tcpserial.d.ts +0 -33
- package/lib/daum/premium/tcpserial.js +0 -123
- package/lib/device.d.ts +0 -94
- package/lib/device.js +0 -76
- package/lib/kettler/ergo-racer/protocol.d.ts +0 -41
- package/lib/kettler/ergo-racer/protocol.js +0 -203
- package/lib/protocol.d.ts +0 -74
- package/lib/protocol.js +0 -41
- package/lib/registry.d.ts +0 -8
- package/lib/registry.js +0 -33
- package/lib/serialport/bindings/tcp.d.ts +0 -20
- package/lib/serialport/bindings/tcp.js +0 -33
- package/lib/serialport/index.d.ts +0 -2
- package/lib/serialport/index.js +0 -29
- package/lib/serialport/serialport.d.ts +0 -29
- package/lib/serialport/serialport.js +0 -87
- /package/lib/{cycling-mode.js → modes/cycling-mode.js} +0 -0
- /package/lib/{daum → serial/daum}/classic/utils.js +0 -0
- /package/lib/{daum → serial/daum}/constants.d.ts +0 -0
- /package/lib/{daum → serial/daum}/constants.js +0 -0
- /package/lib/{serialport.d.ts → serial/serialport.d.ts} +0 -0
- /package/lib/{serialport.js → serial/serialport.js} +0 -0
- /package/lib/{calculations.d.ts → utils/calculations.d.ts} +0 -0
- /package/lib/{calculations.js → utils/calculations.js} +0 -0
|
@@ -12,64 +12,65 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const
|
|
16
|
-
const utils_1 = require("../
|
|
15
|
+
const adapter_1 = require("../adapter");
|
|
16
|
+
const utils_1 = require("../utils");
|
|
17
17
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
18
|
-
const ant_fe_st_mode_1 = __importDefault(require("../
|
|
19
|
-
const ant_fe_erg_mode_1 = __importDefault(require("../
|
|
20
|
-
const ant_fe_adv_st_mode_1 = __importDefault(require("../
|
|
21
|
-
const utils_2 = require("
|
|
22
|
-
const
|
|
23
|
-
const
|
|
18
|
+
const ant_fe_st_mode_1 = __importDefault(require("../modes/ant-fe-st-mode"));
|
|
19
|
+
const ant_fe_erg_mode_1 = __importDefault(require("../modes/ant-fe-erg-mode"));
|
|
20
|
+
const ant_fe_adv_st_mode_1 = __importDefault(require("../modes/ant-fe-adv-st-mode"));
|
|
21
|
+
const utils_2 = require("../../utils/utils");
|
|
22
|
+
const sensor_factory_1 = __importDefault(require("../sensor-factory"));
|
|
23
|
+
const capabilities_1 = require("../../types/capabilities");
|
|
24
|
+
const adpater_1 = require("../../base/adpater");
|
|
24
25
|
const DEFAULT_BIKE_WEIGHT_MOUNTAIN = 14.5;
|
|
25
26
|
const MAX_RETRIES = 3;
|
|
26
|
-
class AntFEAdapter extends
|
|
27
|
-
constructor(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
class AntFEAdapter extends adapter_1.ControllableAntAdapter {
|
|
28
|
+
constructor(settings, props) {
|
|
29
|
+
if (settings.protocol && settings.profile !== AntFEAdapter.INCYCLIST_PROFILE_NAME)
|
|
30
|
+
throw new Error('Incorrect Profile');
|
|
31
|
+
if (!settings.protocol && settings.profile !== AntFEAdapter.ANT_PROFILE_NAME)
|
|
32
|
+
throw new Error('Incorrect Profile');
|
|
33
|
+
super(settings, props);
|
|
30
34
|
this.deviceData = {
|
|
31
|
-
DeviceID: sensor.getDeviceID()
|
|
35
|
+
DeviceID: this.sensor.getDeviceID()
|
|
32
36
|
};
|
|
33
37
|
this.dataMsgCount = 0;
|
|
34
38
|
this.logger = new gd_eventlog_1.EventLogger('Ant+FE');
|
|
35
39
|
this.isReconnecting = false;
|
|
40
|
+
this.startProps = {};
|
|
41
|
+
this.capabilities = [
|
|
42
|
+
capabilities_1.IncyclistCapability.Power, capabilities_1.IncyclistCapability.Speed, capabilities_1.IncyclistCapability.Cadence,
|
|
43
|
+
capabilities_1.IncyclistCapability.Control
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
createSensor(settings) {
|
|
47
|
+
const sensor = sensor_factory_1.default.create(AntFEAdapter.ANT_PROFILE_NAME, Number(settings.deviceID));
|
|
48
|
+
return sensor;
|
|
36
49
|
}
|
|
37
|
-
isBike() { return true; }
|
|
38
|
-
isHrm() { return false; }
|
|
39
|
-
isPower() { return true; }
|
|
40
50
|
getName() {
|
|
51
|
+
if (this.settings.name)
|
|
52
|
+
return this.settings.name;
|
|
41
53
|
const deviceID = this.sensor.getDeviceID();
|
|
42
54
|
return `Ant+FE ${deviceID}`;
|
|
43
55
|
}
|
|
44
|
-
|
|
56
|
+
getUniqueName() {
|
|
57
|
+
if (this.settings.name)
|
|
58
|
+
return this.settings.name;
|
|
45
59
|
const { DeviceID, ManId } = this.deviceData;
|
|
46
|
-
|
|
60
|
+
const brand = (0, utils_1.getBrand)(ManId);
|
|
61
|
+
if (brand)
|
|
62
|
+
return `${brand} FE ${DeviceID}`;
|
|
63
|
+
else
|
|
64
|
+
return `${this.getName()}`;
|
|
65
|
+
}
|
|
66
|
+
getDisplayName() {
|
|
67
|
+
const { InstantaneousPower } = this.deviceData;
|
|
68
|
+
const pwrStr = InstantaneousPower ? ` (${InstantaneousPower})` : '';
|
|
69
|
+
return `${this.getUniqueName()}${pwrStr}`;
|
|
47
70
|
}
|
|
48
71
|
getSupportedCyclingModes() {
|
|
49
72
|
return [ant_fe_st_mode_1.default, ant_fe_erg_mode_1.default, ant_fe_adv_st_mode_1.default];
|
|
50
73
|
}
|
|
51
|
-
setCyclingMode(mode, settings) {
|
|
52
|
-
let selectedMode;
|
|
53
|
-
if (typeof mode === 'string') {
|
|
54
|
-
const supported = this.getSupportedCyclingModes();
|
|
55
|
-
const CyclingModeClass = supported.find(M => { const m = new M(this); return m.getName() === mode; });
|
|
56
|
-
if (CyclingModeClass) {
|
|
57
|
-
this.cyclingMode = new CyclingModeClass(this, settings);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
selectedMode = this.getDefaultCyclingMode();
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
selectedMode = mode;
|
|
64
|
-
}
|
|
65
|
-
this.cyclingMode = selectedMode;
|
|
66
|
-
this.cyclingMode.setSettings(settings);
|
|
67
|
-
}
|
|
68
|
-
getCyclingMode() {
|
|
69
|
-
if (!this.cyclingMode)
|
|
70
|
-
this.cyclingMode = this.getDefaultCyclingMode();
|
|
71
|
-
return this.cyclingMode;
|
|
72
|
-
}
|
|
73
74
|
getDefaultCyclingMode() {
|
|
74
75
|
return new ant_fe_st_mode_1.default(this);
|
|
75
76
|
}
|
|
@@ -80,17 +81,17 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
80
81
|
});
|
|
81
82
|
return logData;
|
|
82
83
|
}
|
|
83
|
-
sendUpdate(request) {
|
|
84
|
+
sendUpdate(request, forced = false) {
|
|
84
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
if (this.paused || this.isReconnecting)
|
|
86
|
+
if ((this.paused || this.isReconnecting) && !forced)
|
|
87
|
+
return;
|
|
88
|
+
let isReset = request.reset && Object.keys(request).length === 1;
|
|
89
|
+
const update = isReset ? this.getCyclingMode().getBikeInitRequest() : this.getCyclingMode().sendBikeUpdate(request);
|
|
90
|
+
if (!update)
|
|
86
91
|
return;
|
|
87
|
-
const update = this.getCyclingMode().sendBikeUpdate(request);
|
|
88
92
|
this.logger.logEvent({ message: 'send bike update requested', update, request });
|
|
89
93
|
try {
|
|
90
94
|
const fe = this.sensor;
|
|
91
|
-
const isReset = (!update || update.reset || Object.keys(update).length === 0);
|
|
92
|
-
if (isReset)
|
|
93
|
-
yield fe.sendTrackResistance(0);
|
|
94
95
|
if (update.slope !== undefined) {
|
|
95
96
|
yield fe.sendTrackResistance(update.slope);
|
|
96
97
|
}
|
|
@@ -112,30 +113,32 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
112
113
|
onDeviceData(deviceData) {
|
|
113
114
|
this.dataMsgCount++;
|
|
114
115
|
this.lastDataTS = Date.now();
|
|
115
|
-
|
|
116
|
+
super.onDeviceData(deviceData);
|
|
117
|
+
if (!this.started || this.isStopped() || this.paused)
|
|
116
118
|
return;
|
|
117
|
-
this.
|
|
118
|
-
if (this.dataMsgCount === 1) {
|
|
119
|
+
if (!this.ivDataTimeout && this.dataMsgCount > 0) {
|
|
119
120
|
this.startDataTimeoutCheck();
|
|
120
121
|
}
|
|
121
122
|
try {
|
|
122
123
|
const logData = this.getLogData(deviceData, ['PairedDevices', 'RawData']);
|
|
123
124
|
this.logger.logEvent({ message: 'onDeviceData', data: logData });
|
|
124
|
-
if (this.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
this.lastUpdate = Date.now();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
125
|
+
if (!this.canSendUpdate())
|
|
126
|
+
return;
|
|
127
|
+
let incyclistData = this.mapToCycleModeData(deviceData);
|
|
128
|
+
incyclistData = this.getCyclingMode().updateData(incyclistData);
|
|
129
|
+
this.data = this.transformData(incyclistData);
|
|
130
|
+
this.emitData(this.data);
|
|
133
131
|
}
|
|
134
132
|
catch (err) {
|
|
135
133
|
this.logger.logEvent({ message: 'error', fn: 'onDeviceData()', error: err.message || err, stack: err.stack });
|
|
136
134
|
}
|
|
137
135
|
}
|
|
138
|
-
|
|
136
|
+
canSendUpdate() {
|
|
137
|
+
if (!this.hasDataListeners() || this.paused)
|
|
138
|
+
return false;
|
|
139
|
+
return super.canSendUpdate();
|
|
140
|
+
}
|
|
141
|
+
mapToCycleModeData(deviceData) {
|
|
139
142
|
const data = {
|
|
140
143
|
isPedalling: false,
|
|
141
144
|
power: 0,
|
|
@@ -172,25 +175,20 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
172
175
|
distance,
|
|
173
176
|
timestamp: Date.now()
|
|
174
177
|
};
|
|
175
|
-
if (this.ignorePower) {
|
|
176
|
-
delete data.power;
|
|
177
|
-
delete data.cadence;
|
|
178
|
-
}
|
|
179
|
-
if (this.ignoreBike) {
|
|
180
|
-
data = { heartrate: data.heartrate };
|
|
181
|
-
}
|
|
182
|
-
if (this.ignoreHrm || !this.isHrm())
|
|
183
|
-
delete data.heartrate;
|
|
184
178
|
return data;
|
|
185
179
|
}
|
|
186
180
|
start(props) {
|
|
187
|
-
const _super = Object.create(null, {
|
|
188
|
-
start: { get: () => super.start }
|
|
189
|
-
});
|
|
190
181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
|
|
182
|
+
const wasPaused = this.paused;
|
|
183
|
+
this.paused = false;
|
|
184
|
+
if (this.started && !wasPaused) {
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
const connected = yield this.connect();
|
|
188
|
+
if (!connected)
|
|
189
|
+
throw new Error(`could not start device, reason:could not connect`);
|
|
192
190
|
this.startProps = props;
|
|
193
|
-
this.
|
|
191
|
+
this.logEvent({ message: 'starting device', props, isStarted: this.started, isReconnecting: this.isReconnecting });
|
|
194
192
|
const opts = props || {};
|
|
195
193
|
const { args = {}, user = {} } = opts;
|
|
196
194
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -216,8 +214,10 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
216
214
|
while (!success && retry < MAX_RETRIES) {
|
|
217
215
|
retry++;
|
|
218
216
|
if (!this.started) {
|
|
217
|
+
this.logger.logEvent({ message: 'start sensor', props });
|
|
219
218
|
this.started = yield this.ant.startSensor(this.sensor, this.onDeviceData.bind(this));
|
|
220
219
|
if (this.started) {
|
|
220
|
+
this.logger.logEvent({ message: 'sensor started', props });
|
|
221
221
|
startSuccess++;
|
|
222
222
|
}
|
|
223
223
|
if (this.started && startSuccess === 1) {
|
|
@@ -231,7 +231,7 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
231
231
|
}
|
|
232
232
|
catch (_a) { }
|
|
233
233
|
this.started = false;
|
|
234
|
-
return reject(new Error(
|
|
234
|
+
return reject(new Error('could not start device, reason:timeout'));
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
status = { userSent: false, slopeSent: false };
|
|
@@ -245,11 +245,26 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
245
245
|
const fe = this.sensor;
|
|
246
246
|
const mode = this.getCyclingMode();
|
|
247
247
|
const bikeType = mode ? mode.getSetting('bikeType').toLowerCase() : 'race';
|
|
248
|
-
const defaultBikeWeight = bikeType === 'mountain' ? DEFAULT_BIKE_WEIGHT_MOUNTAIN : DEFAULT_BIKE_WEIGHT;
|
|
249
|
-
const userWeight = args.userWeight || user.weight || DEFAULT_USER_WEIGHT;
|
|
248
|
+
const defaultBikeWeight = bikeType === 'mountain' ? DEFAULT_BIKE_WEIGHT_MOUNTAIN : adpater_1.DEFAULT_BIKE_WEIGHT;
|
|
249
|
+
const userWeight = args.userWeight || user.weight || adpater_1.DEFAULT_USER_WEIGHT;
|
|
250
250
|
const bikeWeight = args.bikeWeight || defaultBikeWeight;
|
|
251
251
|
status.userSent = status.userSent || (yield fe.sendUserConfiguration(userWeight, bikeWeight, args.wheelDiameter, args.gearRatio));
|
|
252
|
-
|
|
252
|
+
if (!status.slopeSent) {
|
|
253
|
+
const startRequest = this.getCyclingMode().getBikeInitRequest();
|
|
254
|
+
if (startRequest) {
|
|
255
|
+
if (startRequest.targetPower !== undefined && startRequest.targetPower !== null) {
|
|
256
|
+
status.slopeSent = yield fe.sendTargetPower(startRequest.targetPower);
|
|
257
|
+
}
|
|
258
|
+
else if (startRequest.slope !== undefined && startRequest.slope !== null) {
|
|
259
|
+
status.slopeSent = yield fe.sendTrackResistance(startRequest.slope);
|
|
260
|
+
}
|
|
261
|
+
else
|
|
262
|
+
status.slopeSent = true;
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
status.slopeSent = yield fe.sendTrackResistance(0.0);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
253
268
|
}
|
|
254
269
|
catch (err) {
|
|
255
270
|
this.logger.logEvent({ message: 'sending FE message error', error: err.message });
|
|
@@ -288,19 +303,6 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
288
303
|
const fe = this.sensor;
|
|
289
304
|
fe.setSendTimeout(5000);
|
|
290
305
|
}
|
|
291
|
-
stop() {
|
|
292
|
-
const _super = Object.create(null, {
|
|
293
|
-
stop: { get: () => super.stop }
|
|
294
|
-
});
|
|
295
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
296
|
-
this.logger.logEvent({ message: 'stopping device' });
|
|
297
|
-
let stopped = yield this.ant.stopSensor(this.sensor);
|
|
298
|
-
this.started = false;
|
|
299
|
-
yield _super.stop.call(this);
|
|
300
|
-
this.logger.logEvent({ message: 'stopping device done', success: stopped });
|
|
301
|
-
return stopped;
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
306
|
reconnect() {
|
|
305
307
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
308
|
this.logger.logEvent({ message: 'reconnect to device' });
|
|
@@ -320,5 +322,19 @@ class AntFEAdapter extends ant_device_1.default {
|
|
|
320
322
|
}
|
|
321
323
|
});
|
|
322
324
|
}
|
|
325
|
+
setCyclingMode(mode, settings) {
|
|
326
|
+
const modeChange = this.cyclingMode.getName() !== mode;
|
|
327
|
+
super.setCyclingMode(mode, settings);
|
|
328
|
+
console.log('~~~ setCyclingMode', mode, modeChange, this.started, this.stopped, this.paused, this.isReconnecting, this.data);
|
|
329
|
+
if (modeChange && this.started && !this.stopped) {
|
|
330
|
+
if (this.getCyclingMode() instanceof ant_fe_erg_mode_1.default) {
|
|
331
|
+
const power = this.data.power;
|
|
332
|
+
const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
|
|
333
|
+
this.sendUpdate(request, true);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
323
337
|
}
|
|
324
338
|
exports.default = AntFEAdapter;
|
|
339
|
+
AntFEAdapter.INCYCLIST_PROFILE_NAME = 'Smart Trainer';
|
|
340
|
+
AntFEAdapter.ANT_PROFILE_NAME = 'FE';
|
|
@@ -0,0 +1,7 @@
|
|
|
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 adapter_1 = __importDefault(require("./adapter"));
|
|
7
|
+
exports.default = adapter_1.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HeartRateSensorState, ISensor, Profile } from "incyclist-ant-plus";
|
|
2
|
+
import AntAdapter from "../adapter";
|
|
3
|
+
import { AntDeviceProperties, AntDeviceSettings, LegacyProfile } from "../types";
|
|
4
|
+
export default class AntHrAdapter extends AntAdapter {
|
|
5
|
+
static INCYCLIST_PROFILE_NAME: LegacyProfile;
|
|
6
|
+
static ANT_PROFILE_NAME: Profile;
|
|
7
|
+
constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
|
|
8
|
+
createSensor(settings: AntDeviceSettings): ISensor;
|
|
9
|
+
getName(): string;
|
|
10
|
+
getUniqueName(): string;
|
|
11
|
+
getDisplayName(): string;
|
|
12
|
+
onDeviceData(deviceData: HeartRateSensorState): void;
|
|
13
|
+
mapData(deviceData: HeartRateSensorState): void;
|
|
14
|
+
hasData(): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 adapter_1 = __importDefault(require("../adapter"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const gd_eventlog_1 = require("gd-eventlog");
|
|
9
|
+
const sensor_factory_1 = __importDefault(require("../sensor-factory"));
|
|
10
|
+
const capabilities_1 = require("../../types/capabilities");
|
|
11
|
+
class AntHrAdapter extends adapter_1.default {
|
|
12
|
+
constructor(settings, props) {
|
|
13
|
+
if (settings.protocol && settings.profile !== AntHrAdapter.INCYCLIST_PROFILE_NAME)
|
|
14
|
+
throw new Error('Incorrect Profile');
|
|
15
|
+
if (!settings.protocol && settings.profile !== AntHrAdapter.ANT_PROFILE_NAME)
|
|
16
|
+
throw new Error('Incorrect Profile');
|
|
17
|
+
super(settings, props);
|
|
18
|
+
this.deviceData = {
|
|
19
|
+
DeviceID: this.sensor.getDeviceID()
|
|
20
|
+
};
|
|
21
|
+
this.logger = new gd_eventlog_1.EventLogger('Ant+Hrm');
|
|
22
|
+
this.capabilities = [capabilities_1.IncyclistCapability.HeartRate];
|
|
23
|
+
}
|
|
24
|
+
createSensor(settings) {
|
|
25
|
+
return sensor_factory_1.default.create(AntHrAdapter.ANT_PROFILE_NAME, Number(settings.deviceID));
|
|
26
|
+
}
|
|
27
|
+
getName() {
|
|
28
|
+
if (this.settings.name)
|
|
29
|
+
return this.settings.name;
|
|
30
|
+
const deviceID = this.sensor.getDeviceID();
|
|
31
|
+
return `Ant+HR ${deviceID}`;
|
|
32
|
+
}
|
|
33
|
+
getUniqueName() {
|
|
34
|
+
if (this.settings.name)
|
|
35
|
+
return this.settings.name;
|
|
36
|
+
const { DeviceID, ManId } = this.deviceData;
|
|
37
|
+
const brand = (0, utils_1.getBrand)(ManId);
|
|
38
|
+
if (brand)
|
|
39
|
+
return `${brand} HR ${DeviceID}`;
|
|
40
|
+
else
|
|
41
|
+
return `${this.getName()}`;
|
|
42
|
+
}
|
|
43
|
+
getDisplayName() {
|
|
44
|
+
const { ComputedHeartRate } = this.deviceData;
|
|
45
|
+
const hrmStr = ComputedHeartRate ? ` (${ComputedHeartRate})` : '';
|
|
46
|
+
return `${this.getUniqueName()}${hrmStr}`;
|
|
47
|
+
}
|
|
48
|
+
onDeviceData(deviceData) {
|
|
49
|
+
this.dataMsgCount++;
|
|
50
|
+
this.lastDataTS = Date.now();
|
|
51
|
+
super.onDeviceData(deviceData);
|
|
52
|
+
if (!this.started)
|
|
53
|
+
return;
|
|
54
|
+
if (!this.ivDataTimeout)
|
|
55
|
+
this.startDataTimeoutCheck();
|
|
56
|
+
try {
|
|
57
|
+
if (!this.canSendUpdate())
|
|
58
|
+
return;
|
|
59
|
+
this.logEvent({ message: 'onDeviceData', data: deviceData });
|
|
60
|
+
this.mapData(deviceData);
|
|
61
|
+
this.emitData(this.data);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
mapData(deviceData) {
|
|
67
|
+
if (deviceData.ComputedHeartRate)
|
|
68
|
+
this.data.heartrate = deviceData.ComputedHeartRate;
|
|
69
|
+
}
|
|
70
|
+
hasData() {
|
|
71
|
+
return this.deviceData.ComputedHeartRate !== undefined && this.deviceData.ComputedHeartRate !== null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.default = AntHrAdapter;
|
|
75
|
+
AntHrAdapter.INCYCLIST_PROFILE_NAME = 'Heartrate Monitor';
|
|
76
|
+
AntHrAdapter.ANT_PROFILE_NAME = 'HR';
|
|
@@ -0,0 +1,7 @@
|
|
|
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 adapter_1 = __importDefault(require("./adapter"));
|
|
7
|
+
exports.default = adapter_1.default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AntPwrAdapter from "./pwr";
|
|
2
|
+
import AntFEAdapter from "./fe";
|
|
3
|
+
import AntHrAdapter from "./hr";
|
|
4
|
+
import AntAdapterFactory from "./adapter-factory";
|
|
5
|
+
import AntInterface, { AntInterfaceProps } from "./ant-interface";
|
|
6
|
+
import { AntDeviceSettings, AntScanProps } from "./types";
|
|
7
|
+
export { AntAdapterFactory, AntFEAdapter, AntHrAdapter, AntPwrAdapter, AntDeviceSettings, AntScanProps, AntInterface, AntInterfaceProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
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.AntInterface = exports.AntPwrAdapter = exports.AntHrAdapter = exports.AntFEAdapter = exports.AntAdapterFactory = void 0;
|
|
7
|
+
const pwr_1 = __importDefault(require("./pwr"));
|
|
8
|
+
exports.AntPwrAdapter = pwr_1.default;
|
|
9
|
+
const fe_1 = __importDefault(require("./fe"));
|
|
10
|
+
exports.AntFEAdapter = fe_1.default;
|
|
11
|
+
const hr_1 = __importDefault(require("./hr"));
|
|
12
|
+
exports.AntHrAdapter = hr_1.default;
|
|
13
|
+
const adapter_factory_1 = __importDefault(require("./adapter-factory"));
|
|
14
|
+
exports.AntAdapterFactory = adapter_factory_1.default;
|
|
15
|
+
const ant_interface_1 = __importDefault(require("./ant-interface"));
|
|
16
|
+
exports.AntInterface = ant_interface_1.default;
|
|
17
|
+
const af = adapter_factory_1.default.getInstance();
|
|
18
|
+
af.register('PWR', 'Power Meter', pwr_1.default);
|
|
19
|
+
af.register('HR', 'Heartrate Monitor', hr_1.default);
|
|
20
|
+
af.register('FE', 'Smart Trainer', fe_1.default);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import FtmsCyclingMode from "../../modes/ble-st-mode";
|
|
2
|
+
import { UpdateRequest } from "../../modes/cycling-mode";
|
|
3
|
+
import { IncyclistDeviceAdapter } from "../../types/adapter";
|
|
4
|
+
export default class AntAdvSimCyclingMode extends FtmsCyclingMode {
|
|
5
|
+
constructor(adapter: IncyclistDeviceAdapter, props?: any);
|
|
6
|
+
getName(): string;
|
|
7
|
+
getDescription(): string;
|
|
8
|
+
sendBikeUpdate(request: UpdateRequest): UpdateRequest;
|
|
9
|
+
}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ble_st_mode_1 = __importDefault(require("../../
|
|
6
|
+
const ble_st_mode_1 = __importDefault(require("../../modes/ble-st-mode"));
|
|
7
7
|
const MAX_DEVIATION = 10;
|
|
8
8
|
class AntAdvSimCyclingMode extends ble_st_mode_1.default {
|
|
9
9
|
constructor(adapter, props) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import BleERGCyclingMode from "../../modes/ble-erg-mode";
|
|
2
|
+
import { IncyclistDeviceAdapter } from "../../types/adapter";
|
|
3
|
+
export default class AntFeERGCyclingMode extends BleERGCyclingMode {
|
|
4
|
+
static isERG: boolean;
|
|
5
|
+
constructor(adapter: IncyclistDeviceAdapter, props?: any);
|
|
6
|
+
}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ble_erg_mode_1 = __importDefault(require("../../
|
|
6
|
+
const ble_erg_mode_1 = __importDefault(require("../../modes/ble-erg-mode"));
|
|
7
7
|
class AntFeERGCyclingMode extends ble_erg_mode_1.default {
|
|
8
8
|
constructor(adapter, props) {
|
|
9
9
|
super(adapter, props);
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ble_st_mode_1 = __importDefault(require("../../
|
|
6
|
+
const ble_st_mode_1 = __importDefault(require("../../modes/ble-st-mode"));
|
|
7
7
|
class AntStCyclingMode extends ble_st_mode_1.default {
|
|
8
8
|
constructor(adapter, props) {
|
|
9
9
|
super(adapter, props);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ISensor, Profile } from "incyclist-ant-plus";
|
|
2
|
+
import { ControllableAntAdapter } from "../adapter";
|
|
3
|
+
import CyclingMode, { IncyclistBikeData } from '../../modes/cycling-mode';
|
|
4
|
+
import { AntDeviceProperties, AntDeviceSettings, LegacyProfile } from "../types";
|
|
5
|
+
import { DeviceData } from "../../types/data";
|
|
6
|
+
export default class AntPwrAdapter extends ControllableAntAdapter {
|
|
7
|
+
static INCYCLIST_PROFILE_NAME: LegacyProfile;
|
|
8
|
+
static ANT_PROFILE_NAME: Profile;
|
|
9
|
+
protected distanceInternal?: number;
|
|
10
|
+
constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
|
|
11
|
+
createSensor(settings: AntDeviceSettings): ISensor;
|
|
12
|
+
getName(): string;
|
|
13
|
+
getUniqueName(): string;
|
|
14
|
+
getDisplayName(): string;
|
|
15
|
+
getDefaultCyclingMode(): CyclingMode;
|
|
16
|
+
getSupportedCyclingModes(): any[];
|
|
17
|
+
getLogData(data: any, excludeList: any): any;
|
|
18
|
+
onDeviceData(deviceData: any): void;
|
|
19
|
+
canSendUpdate(): boolean;
|
|
20
|
+
sendUpdate(request: any): void;
|
|
21
|
+
mapData(deviceData: any): IncyclistBikeData;
|
|
22
|
+
transformData(bikeData: IncyclistBikeData): DeviceData;
|
|
23
|
+
hasData(): boolean;
|
|
24
|
+
}
|