incyclist-devices 1.5.37 → 2.0.0-beta.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/README.MD +0 -0
- package/lib/adapters.d.ts +6 -0
- package/lib/adapters.js +30 -0
- package/lib/antv2/adapter-factory.d.ts +20 -10
- package/lib/antv2/adapter-factory.js +49 -33
- package/lib/antv2/adapter.d.ts +64 -0
- package/lib/antv2/adapter.js +299 -0
- package/lib/antv2/ant-interface.d.ts +11 -9
- package/lib/antv2/ant-interface.js +15 -11
- package/lib/antv2/fe/adapter.d.ts +25 -0
- package/lib/antv2/{fe.js → fe/adapter.js} +48 -72
- package/lib/antv2/fe/index.d.ts +2 -0
- package/lib/antv2/fe/index.js +7 -0
- package/lib/antv2/hr/adapter.d.ts +14 -0
- package/lib/antv2/hr/adapter.js +73 -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 +22 -0
- package/lib/antv2/{pwr.js → pwr/adapter.js} +38 -76
- package/lib/antv2/pwr/index.d.ts +2 -0
- package/lib/antv2/pwr/index.js +7 -0
- package/lib/antv2/types.d.ts +19 -0
- package/lib/antv2/types.js +2 -0
- package/lib/antv2/utils.d.ts +1 -0
- package/lib/antv2/utils.js +181 -0
- package/lib/base/adpater.d.ts +56 -0
- package/lib/base/adpater.js +144 -0
- package/lib/ble/adapter-factory.d.ts +31 -0
- package/lib/ble/adapter-factory.js +96 -0
- package/lib/ble/adapter.d.ts +41 -0
- package/lib/ble/adapter.js +188 -0
- package/lib/ble/{ble-device.d.ts → ble-comms.d.ts} +9 -4
- package/lib/ble/{ble-device.js → ble-comms.js} +23 -11
- package/lib/ble/ble-interface.d.ts +15 -24
- package/lib/ble/ble-interface.js +32 -137
- package/lib/ble/ble-peripheral.d.ts +3 -3
- package/lib/ble/ble-peripheral.js +14 -14
- package/lib/ble/ble.d.ts +9 -81
- package/lib/ble/ble.js +1 -39
- package/lib/ble/consts.d.ts +2 -0
- package/lib/ble/consts.js +3 -1
- package/lib/ble/cp/adapter.d.ts +23 -0
- package/lib/ble/cp/adapter.js +124 -0
- package/lib/ble/cp/comm.d.ts +28 -0
- package/lib/ble/cp/comm.js +140 -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 +20 -0
- package/lib/ble/elite/adapter.js +127 -0
- package/lib/ble/elite/comms.d.ts +28 -0
- package/lib/ble/elite/comms.js +139 -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 +21 -0
- package/lib/ble/fm/adapter.js +190 -0
- package/lib/ble/fm/comms.d.ts +50 -0
- package/lib/ble/{fm.js → fm/comms.js} +3 -224
- 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 +25 -0
- package/lib/ble/fm/types.js +2 -0
- package/lib/ble/hr/adapter.d.ts +17 -0
- package/lib/ble/hr/adapter.js +62 -0
- package/lib/ble/hr/comm.d.ts +15 -0
- package/lib/ble/hr/comm.js +52 -0
- package/lib/ble/hr/index.d.ts +4 -0
- package/lib/ble/hr/index.js +10 -0
- package/lib/ble/hr/types.d.ts +5 -0
- package/lib/ble/hr/types.js +2 -0
- package/lib/ble/index.d.ts +8 -0
- package/lib/ble/index.js +26 -0
- package/lib/ble/tacx/adapter.d.ts +10 -0
- package/lib/ble/tacx/adapter.js +93 -0
- package/lib/ble/{tacx.d.ts → tacx/comms.d.ts} +6 -38
- package/lib/ble/{tacx.js → tacx/comms.js} +13 -112
- 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 +101 -0
- package/lib/ble/types.js +19 -0
- package/lib/ble/utils.d.ts +7 -0
- package/lib/ble/utils.js +95 -0
- package/lib/ble/wahoo/adapter.d.ts +9 -0
- package/lib/ble/wahoo/adapter.js +93 -0
- package/lib/ble/{wahoo-kickr.d.ts → wahoo/comms.d.ts} +5 -39
- package/lib/ble/{wahoo-kickr.js → wahoo/comms.js} +14 -112
- 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/device.d.ts +0 -94
- package/lib/device.js +0 -76
- package/lib/index.d.ts +12 -0
- package/lib/index.js +38 -0
- package/lib/interfaces.d.ts +6 -0
- package/lib/interfaces.js +23 -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 +4 -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 +16 -0
- package/lib/serial/adapter.js +42 -0
- package/lib/serial/bindings/tcp.d.ts +44 -0
- package/lib/serial/bindings/tcp.js +270 -0
- package/lib/serial/comm.d.ts +7 -0
- package/lib/serial/comm.js +2 -0
- package/lib/{daum → serial/daum}/DaumAdapter.d.ts +13 -22
- package/lib/{daum → serial/daum}/DaumAdapter.js +44 -90
- 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 +24 -0
- package/lib/{daum/premium/DaumPremiumAdapter.js → serial/daum/premium/adapter.js} +99 -46
- 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} +214 -420
- package/lib/serial/daum/premium/mock.d.ts +75 -0
- package/lib/serial/daum/premium/mock.js +290 -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 +13 -24
- package/lib/{kettler → serial/kettler}/ergo-racer/adapter.js +87 -130
- 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 +58 -0
- package/lib/serial/serial-interface.js +283 -0
- package/lib/simulator/Simulator.d.ts +10 -25
- package/lib/simulator/Simulator.js +19 -83
- package/lib/types/adapter.d.ts +32 -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 +29 -0
- package/lib/types/device.js +11 -0
- package/lib/types/interface.d.ts +14 -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 +15 -11
- 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/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/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/antv2/{ant-binding.d.ts → binding.d.ts} +0 -0
- /package/lib/antv2/{ant-binding.js → binding.js} +0 -0
- /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
package/lib/antv2/ant-device.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.DEFAULT_UPDATE_FREQUENCY = void 0;
|
|
16
|
-
const incyclist_protocol_1 = require("./incyclist-protocol");
|
|
17
|
-
const ant_interface_1 = __importDefault(require("./ant-interface"));
|
|
18
|
-
const device_1 = __importDefault(require("../device"));
|
|
19
|
-
exports.DEFAULT_UPDATE_FREQUENCY = 1000;
|
|
20
|
-
const NO_DATA_TIMEOUT = 5000;
|
|
21
|
-
class AntAdapter extends device_1.default {
|
|
22
|
-
constructor(sensor, protocol, settings) {
|
|
23
|
-
super(protocol, settings);
|
|
24
|
-
this.sensor = sensor;
|
|
25
|
-
this.protocol = protocol;
|
|
26
|
-
this.ignoreHrm = false;
|
|
27
|
-
this.ignoreBike = false;
|
|
28
|
-
this.ignorePower = false;
|
|
29
|
-
this.deviceData = {};
|
|
30
|
-
this.data = {};
|
|
31
|
-
this.dataMsgCount = 0;
|
|
32
|
-
this.updateFrequency = exports.DEFAULT_UPDATE_FREQUENCY;
|
|
33
|
-
this.channel = undefined;
|
|
34
|
-
this.paused = false;
|
|
35
|
-
this.stopped = false;
|
|
36
|
-
this.ant = ant_interface_1.default.getInstance();
|
|
37
|
-
}
|
|
38
|
-
isBike() {
|
|
39
|
-
throw new Error('Method not implemented.');
|
|
40
|
-
}
|
|
41
|
-
isPower() {
|
|
42
|
-
throw new Error('Method not implemented.');
|
|
43
|
-
}
|
|
44
|
-
isHrm() {
|
|
45
|
-
throw new Error('Method not implemented.');
|
|
46
|
-
}
|
|
47
|
-
getDisplayName() {
|
|
48
|
-
throw new Error('Method not implemented.');
|
|
49
|
-
}
|
|
50
|
-
isSame(device) {
|
|
51
|
-
if (!(device instanceof AntAdapter))
|
|
52
|
-
return false;
|
|
53
|
-
const adapter = device;
|
|
54
|
-
return (adapter.getID() === this.getID() && adapter.getProfile() === this.getProfile());
|
|
55
|
-
}
|
|
56
|
-
waitForData(timeout) {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const startTs = Date.now();
|
|
59
|
-
const timeoutTs = startTs + timeout;
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
if (this.ivWaitForData)
|
|
62
|
-
return reject(new Error('busy'));
|
|
63
|
-
this.ivWaitForData = setInterval(() => {
|
|
64
|
-
const nowTs = Date.now();
|
|
65
|
-
if (nowTs > timeoutTs && this.dataMsgCount === 0) {
|
|
66
|
-
clearInterval(this.ivWaitForData);
|
|
67
|
-
this.ivWaitForData = undefined;
|
|
68
|
-
reject(new Error('No Data Received'));
|
|
69
|
-
}
|
|
70
|
-
if (this.dataMsgCount > 0) {
|
|
71
|
-
clearInterval(this.ivWaitForData);
|
|
72
|
-
this.ivWaitForData = undefined;
|
|
73
|
-
resolve(nowTs - startTs);
|
|
74
|
-
}
|
|
75
|
-
}, 500);
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
getID() {
|
|
80
|
-
return this.sensor.getDeviceID().toString();
|
|
81
|
-
}
|
|
82
|
-
getName() {
|
|
83
|
-
const deviceID = this.sensor.getDeviceID();
|
|
84
|
-
const profile = this.sensor.getProfile();
|
|
85
|
-
return `Ant+${profile} ${deviceID}`;
|
|
86
|
-
}
|
|
87
|
-
getProfile() {
|
|
88
|
-
return (0, incyclist_protocol_1.mapAntProfile)(this.sensor.getProfile());
|
|
89
|
-
}
|
|
90
|
-
getPort() {
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
getProtocol() {
|
|
94
|
-
return this.protocol;
|
|
95
|
-
}
|
|
96
|
-
getProtocolName() {
|
|
97
|
-
return this.protocol.getName();
|
|
98
|
-
}
|
|
99
|
-
setIgnoreHrm(ignore) {
|
|
100
|
-
this.ignoreHrm = ignore;
|
|
101
|
-
}
|
|
102
|
-
setIgnoreBike(ignore) {
|
|
103
|
-
this.ignoreBike = ignore;
|
|
104
|
-
}
|
|
105
|
-
setIgnorePower(ignore) {
|
|
106
|
-
this.ignorePower = ignore;
|
|
107
|
-
}
|
|
108
|
-
pause() {
|
|
109
|
-
return new Promise(resolve => {
|
|
110
|
-
this.paused = true;
|
|
111
|
-
resolve(true);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
resume() {
|
|
115
|
-
return new Promise(resolve => {
|
|
116
|
-
this.paused = false;
|
|
117
|
-
resolve(true);
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
startDataTimeoutCheck() {
|
|
121
|
-
if (this.ivDataTimeout)
|
|
122
|
-
return;
|
|
123
|
-
this.ivDataTimeout = setInterval(() => {
|
|
124
|
-
if (!this.lastDataTS)
|
|
125
|
-
return;
|
|
126
|
-
if (this.lastDataTS + NO_DATA_TIMEOUT < Date.now()) {
|
|
127
|
-
this.emit('disconnected', Date.now() - this.lastDataTS);
|
|
128
|
-
}
|
|
129
|
-
}, 1000);
|
|
130
|
-
}
|
|
131
|
-
stopDataTimeoutCheck() {
|
|
132
|
-
if (!this.ivDataTimeout)
|
|
133
|
-
return;
|
|
134
|
-
clearInterval(this.ivDataTimeout);
|
|
135
|
-
this.ivDataTimeout = undefined;
|
|
136
|
-
this.lastDataTS = undefined;
|
|
137
|
-
this.dataMsgCount = 0;
|
|
138
|
-
}
|
|
139
|
-
start(props) {
|
|
140
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
this.dataMsgCount = 0;
|
|
142
|
-
if (props && props.user)
|
|
143
|
-
this.userSettings = props.user;
|
|
144
|
-
if (props && props.bikeSettings)
|
|
145
|
-
this.bikeSettings = props.bikeSettings;
|
|
146
|
-
this.stopped = false;
|
|
147
|
-
return true;
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
stop() {
|
|
151
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
-
this.stopDataTimeoutCheck();
|
|
153
|
-
this.stopped = true;
|
|
154
|
-
return true;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
isStopped() {
|
|
158
|
-
return this.stopped;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
exports.default = AntAdapter;
|
package/lib/antv2/fe.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ISensor } from "incyclist-ant-plus";
|
|
2
|
-
import AntAdapter from "./ant-device";
|
|
3
|
-
import AntProtocol from "./incyclist-protocol";
|
|
4
|
-
import { EventLogger } from "gd-eventlog";
|
|
5
|
-
import CyclingMode, { IncyclistBikeData } from '../cycling-mode';
|
|
6
|
-
export default class AntFEAdapter extends AntAdapter {
|
|
7
|
-
protected started: boolean;
|
|
8
|
-
protected logger: EventLogger;
|
|
9
|
-
protected cyclingMode: CyclingMode;
|
|
10
|
-
protected distanceInternal?: number;
|
|
11
|
-
protected startProps: any;
|
|
12
|
-
protected isReconnecting: boolean;
|
|
13
|
-
constructor(sensor: ISensor, protocol: AntProtocol);
|
|
14
|
-
isBike(): boolean;
|
|
15
|
-
isHrm(): boolean;
|
|
16
|
-
isPower(): boolean;
|
|
17
|
-
getName(): string;
|
|
18
|
-
getDisplayName(): string;
|
|
19
|
-
getSupportedCyclingModes(): Array<any>;
|
|
20
|
-
setCyclingMode(mode: string | CyclingMode, settings?: any): void;
|
|
21
|
-
getCyclingMode(): CyclingMode;
|
|
22
|
-
getDefaultCyclingMode(): CyclingMode;
|
|
23
|
-
getLogData(data: any, excludeList: any): any;
|
|
24
|
-
sendUpdate(request: any): Promise<void>;
|
|
25
|
-
onDeviceData(deviceData: any): void;
|
|
26
|
-
mapData(deviceData: any): IncyclistBikeData;
|
|
27
|
-
transformData(bikeData: any): any;
|
|
28
|
-
start(props?: any): Promise<any>;
|
|
29
|
-
setFEDefaultTimeout(): void;
|
|
30
|
-
stop(): Promise<boolean>;
|
|
31
|
-
reconnect(): Promise<boolean>;
|
|
32
|
-
}
|
package/lib/antv2/hr.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ISensor } from "incyclist-ant-plus";
|
|
2
|
-
import AntAdapter from "./ant-device";
|
|
3
|
-
import AntProtocol from "./incyclist-protocol";
|
|
4
|
-
import { EventLogger } from "gd-eventlog";
|
|
5
|
-
export default class AntHrAdapter extends AntAdapter {
|
|
6
|
-
protected started: boolean;
|
|
7
|
-
protected logger: EventLogger;
|
|
8
|
-
constructor(sensor: ISensor, protocol: AntProtocol);
|
|
9
|
-
isBike(): boolean;
|
|
10
|
-
isHrm(): boolean;
|
|
11
|
-
isPower(): boolean;
|
|
12
|
-
getName(): string;
|
|
13
|
-
getDisplayName(): string;
|
|
14
|
-
onDeviceData(deviceData: any): void;
|
|
15
|
-
updateData(data: any, deviceData: any): any;
|
|
16
|
-
start(props?: any): Promise<any>;
|
|
17
|
-
stop(): Promise<boolean>;
|
|
18
|
-
}
|
package/lib/antv2/hr.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const ant_device_1 = __importDefault(require("./ant-device"));
|
|
16
|
-
const utils_1 = require("../ant/utils");
|
|
17
|
-
const gd_eventlog_1 = require("gd-eventlog");
|
|
18
|
-
class AntHrAdapter extends ant_device_1.default {
|
|
19
|
-
constructor(sensor, protocol) {
|
|
20
|
-
super(sensor, protocol);
|
|
21
|
-
this.started = false;
|
|
22
|
-
this.deviceData = {
|
|
23
|
-
DeviceID: sensor.getDeviceID()
|
|
24
|
-
};
|
|
25
|
-
this.logger = new gd_eventlog_1.EventLogger('Ant+Hrm');
|
|
26
|
-
}
|
|
27
|
-
isBike() { return false; }
|
|
28
|
-
isHrm() { return true; }
|
|
29
|
-
isPower() { return false; }
|
|
30
|
-
getName() {
|
|
31
|
-
const deviceID = this.sensor.getDeviceID();
|
|
32
|
-
return `Ant+Hrm ${deviceID}`;
|
|
33
|
-
}
|
|
34
|
-
getDisplayName() {
|
|
35
|
-
const { DeviceID, manID, ComputedHeartRate } = this.deviceData;
|
|
36
|
-
const hrmStr = ComputedHeartRate ? ` (${ComputedHeartRate})` : '';
|
|
37
|
-
return `${(0, utils_1.getBrand)(manID)} Hrm ${DeviceID}${hrmStr}`;
|
|
38
|
-
}
|
|
39
|
-
onDeviceData(deviceData) {
|
|
40
|
-
this.dataMsgCount++;
|
|
41
|
-
this.lastDataTS = Date.now();
|
|
42
|
-
if (!this.started)
|
|
43
|
-
return;
|
|
44
|
-
this.deviceData = deviceData;
|
|
45
|
-
if (!this.ivDataTimeout)
|
|
46
|
-
this.startDataTimeoutCheck();
|
|
47
|
-
try {
|
|
48
|
-
if (this.onDataFn && !this.ignoreHrm && !this.paused) {
|
|
49
|
-
if (this.lastUpdate === undefined || (Date.now() - this.lastUpdate) > this.updateFrequency) {
|
|
50
|
-
this.logger.logEvent({ message: 'onDeviceData', data: deviceData });
|
|
51
|
-
const data = this.updateData(this.data, deviceData);
|
|
52
|
-
this.onDataFn(data);
|
|
53
|
-
this.lastUpdate = Date.now();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
updateData(data, deviceData) {
|
|
61
|
-
data.heartrate = deviceData.ComputedHeartRate;
|
|
62
|
-
return data;
|
|
63
|
-
}
|
|
64
|
-
start(props) {
|
|
65
|
-
const _super = Object.create(null, {
|
|
66
|
-
start: { get: () => super.start }
|
|
67
|
-
});
|
|
68
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
_super.start.call(this, props);
|
|
70
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
const { timeout = 20000 } = props || {};
|
|
72
|
-
let to;
|
|
73
|
-
if (timeout) {
|
|
74
|
-
to = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
yield this.stop();
|
|
76
|
-
reject(new Error(`could not start device, reason:timeout`));
|
|
77
|
-
}), timeout);
|
|
78
|
-
}
|
|
79
|
-
this.started = yield this.ant.startSensor(this.sensor, this.onDeviceData.bind(this));
|
|
80
|
-
try {
|
|
81
|
-
yield this.waitForData(timeout - 100);
|
|
82
|
-
if (to)
|
|
83
|
-
clearTimeout(to);
|
|
84
|
-
resolve(this.started);
|
|
85
|
-
}
|
|
86
|
-
catch (err) {
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
stop() {
|
|
92
|
-
const _super = Object.create(null, {
|
|
93
|
-
stop: { get: () => super.stop }
|
|
94
|
-
});
|
|
95
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
const stopped = yield this.ant.stopSensor(this.sensor);
|
|
97
|
-
_super.stop.call(this);
|
|
98
|
-
return stopped;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.default = AntHrAdapter;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { EventLogger } from "gd-eventlog";
|
|
2
|
-
import DeviceProtocolBase, { DeviceProtocol, DeviceSettings, ScanProps } from "../protocol";
|
|
3
|
-
import AntDeviceBinding from './ant-binding';
|
|
4
|
-
import AntAdapter from "./ant-device";
|
|
5
|
-
import AntInterface from "./ant-interface";
|
|
6
|
-
export declare const mapAntProfile: (antProfile: any) => "Heartrate Monitor" | "Power Meter" | "Smart Trainer";
|
|
7
|
-
export declare const mapIncyclistProfile: (incyclistProfile: any) => "PWR" | "HR" | "FE";
|
|
8
|
-
export interface AntDeviceSettings extends DeviceSettings {
|
|
9
|
-
deviceID?: string;
|
|
10
|
-
profile: string;
|
|
11
|
-
}
|
|
12
|
-
export interface AntScanProps extends ScanProps {
|
|
13
|
-
timeout?: number;
|
|
14
|
-
profiles?: string[];
|
|
15
|
-
}
|
|
16
|
-
export interface AntScannerProps {
|
|
17
|
-
timeout?: number;
|
|
18
|
-
profiles?: string[];
|
|
19
|
-
}
|
|
20
|
-
export default class AntProtocol extends DeviceProtocolBase implements DeviceProtocol {
|
|
21
|
-
logger: EventLogger;
|
|
22
|
-
ant: AntInterface;
|
|
23
|
-
binding: typeof AntDeviceBinding;
|
|
24
|
-
getAnt(): AntInterface;
|
|
25
|
-
constructor();
|
|
26
|
-
logEvent(event: any): void;
|
|
27
|
-
scan(props: AntScanProps): Promise<void>;
|
|
28
|
-
stopScan(): Promise<void>;
|
|
29
|
-
isScanning(): boolean;
|
|
30
|
-
createDevice(request: AntDeviceSettings | AntAdapter): AntAdapter;
|
|
31
|
-
add(settings: AntDeviceSettings): AntAdapter;
|
|
32
|
-
getName(): string;
|
|
33
|
-
getInterfaces(): Array<string>;
|
|
34
|
-
isBike(): boolean;
|
|
35
|
-
isHrm(): boolean;
|
|
36
|
-
isPower(): boolean;
|
|
37
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
-
};
|
|
33
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.mapIncyclistProfile = exports.mapAntProfile = void 0;
|
|
35
|
-
const gd_eventlog_1 = require("gd-eventlog");
|
|
36
|
-
const protocol_1 = __importStar(require("../protocol"));
|
|
37
|
-
const registry_1 = __importDefault(require("../registry"));
|
|
38
|
-
const adapter_factory_1 = __importDefault(require("./adapter-factory"));
|
|
39
|
-
const ant_device_1 = __importDefault(require("./ant-device"));
|
|
40
|
-
const ant_interface_1 = __importDefault(require("./ant-interface"));
|
|
41
|
-
const mapAntProfile = (antProfile) => {
|
|
42
|
-
switch (antProfile) {
|
|
43
|
-
case 'HR': return 'Heartrate Monitor';
|
|
44
|
-
case 'PWR': return 'Power Meter';
|
|
45
|
-
case 'FE': return 'Smart Trainer';
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
exports.mapAntProfile = mapAntProfile;
|
|
49
|
-
const mapIncyclistProfile = (incyclistProfile) => {
|
|
50
|
-
switch (incyclistProfile) {
|
|
51
|
-
case 'Heartrate Monitor': return 'HR';
|
|
52
|
-
case 'Power Meter': return 'PWR';
|
|
53
|
-
case 'Smart Trainer': return 'FE';
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.mapIncyclistProfile = mapIncyclistProfile;
|
|
57
|
-
class AntProtocol extends protocol_1.default {
|
|
58
|
-
constructor() {
|
|
59
|
-
super();
|
|
60
|
-
}
|
|
61
|
-
getAnt() {
|
|
62
|
-
if (this.ant)
|
|
63
|
-
return this.ant;
|
|
64
|
-
this.ant = ant_interface_1.default.getInstance();
|
|
65
|
-
this.logger = new gd_eventlog_1.EventLogger('Ant+');
|
|
66
|
-
return this.ant;
|
|
67
|
-
}
|
|
68
|
-
logEvent(event) {
|
|
69
|
-
if (!this.logger)
|
|
70
|
-
this.logger = new gd_eventlog_1.EventLogger('Ant+');
|
|
71
|
-
if (this.logger)
|
|
72
|
-
this.logger.logEvent(event);
|
|
73
|
-
}
|
|
74
|
-
scan(props) {
|
|
75
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
const { id, onDeviceFound, onScanFinished } = props || {};
|
|
77
|
-
const ant = this.getAnt();
|
|
78
|
-
ant.on('detected', (profile, deviceID) => {
|
|
79
|
-
console.log('detected', profile, deviceID);
|
|
80
|
-
if (onDeviceFound) {
|
|
81
|
-
const detected = { profile, deviceID };
|
|
82
|
-
const device = adapter_factory_1.default.create({ detected }, this);
|
|
83
|
-
onDeviceFound(device, this);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
this.logEvent({ message: 'scan' });
|
|
87
|
-
yield ant.scan(props);
|
|
88
|
-
if (onScanFinished) {
|
|
89
|
-
onScanFinished(id);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
stopScan() {
|
|
94
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
const ant = this.getAnt();
|
|
96
|
-
yield ant.stopScan();
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
isScanning() {
|
|
100
|
-
const ant = this.getAnt();
|
|
101
|
-
return ant.isScanning();
|
|
102
|
-
}
|
|
103
|
-
createDevice(request) {
|
|
104
|
-
const fromAdapter = request instanceof ant_device_1.default;
|
|
105
|
-
let device = undefined;
|
|
106
|
-
if (fromAdapter)
|
|
107
|
-
device = request;
|
|
108
|
-
else {
|
|
109
|
-
device = adapter_factory_1.default.create({ configuration: request }, this);
|
|
110
|
-
}
|
|
111
|
-
return device;
|
|
112
|
-
}
|
|
113
|
-
add(settings) {
|
|
114
|
-
this.logEvent({ message: 'adding device', settings });
|
|
115
|
-
const device = this.createDevice(settings);
|
|
116
|
-
this.devices.push(device);
|
|
117
|
-
return device;
|
|
118
|
-
}
|
|
119
|
-
getName() { return 'Ant'; }
|
|
120
|
-
getInterfaces() { return [protocol_1.INTERFACE.ANT]; }
|
|
121
|
-
isBike() { return true; }
|
|
122
|
-
isHrm() { return true; }
|
|
123
|
-
isPower() { return true; }
|
|
124
|
-
}
|
|
125
|
-
exports.default = AntProtocol;
|
|
126
|
-
registry_1.default.register(new AntProtocol());
|
package/lib/antv2/pwr.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ISensor } from "incyclist-ant-plus";
|
|
2
|
-
import AntAdapter from "./ant-device";
|
|
3
|
-
import AntProtocol from "./incyclist-protocol";
|
|
4
|
-
import { EventLogger } from "gd-eventlog";
|
|
5
|
-
import CyclingMode, { IncyclistBikeData } from '../cycling-mode';
|
|
6
|
-
import { DeviceData } from "../device";
|
|
7
|
-
export default class AntPwrAdapter extends AntAdapter {
|
|
8
|
-
protected started: boolean;
|
|
9
|
-
protected logger: EventLogger;
|
|
10
|
-
protected mode: CyclingMode;
|
|
11
|
-
protected distanceInternal?: number;
|
|
12
|
-
constructor(sensor: ISensor, protocol: AntProtocol);
|
|
13
|
-
isBike(): boolean;
|
|
14
|
-
isHrm(): boolean;
|
|
15
|
-
isPower(): boolean;
|
|
16
|
-
getName(): string;
|
|
17
|
-
getDisplayName(): string;
|
|
18
|
-
getCyclingMode(): CyclingMode;
|
|
19
|
-
getDefaultCyclingMode(): CyclingMode;
|
|
20
|
-
getSupportedCyclingModes(): any[];
|
|
21
|
-
getLogData(data: any, excludeList: any): any;
|
|
22
|
-
onDeviceData(deviceData: any): void;
|
|
23
|
-
sendUpdate(request: any): void;
|
|
24
|
-
mapData(deviceData: any): IncyclistBikeData;
|
|
25
|
-
transformData(bikeData: IncyclistBikeData): DeviceData;
|
|
26
|
-
start(props?: any): Promise<any>;
|
|
27
|
-
stop(): Promise<boolean>;
|
|
28
|
-
}
|
package/lib/ble/elite.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { BleDevice } from './ble-device';
|
|
3
|
-
import BleInterface from './ble-interface';
|
|
4
|
-
import BleProtocol from './incyclist-protocol';
|
|
5
|
-
import { BleDeviceClass } from './ble';
|
|
6
|
-
import DeviceAdapter, { DeviceData } from '../device';
|
|
7
|
-
import { DeviceProtocol } from '../protocol';
|
|
8
|
-
import { EventLogger } from 'gd-eventlog';
|
|
9
|
-
import CyclingMode from '../cycling-mode';
|
|
10
|
-
import { IncyclistBikeData } from '../cycling-mode';
|
|
11
|
-
export declare const ELITE_TRAINER_SVC = "347b0001";
|
|
12
|
-
declare type PowerData = {
|
|
13
|
-
instantaneousPower?: number;
|
|
14
|
-
balance?: number;
|
|
15
|
-
accTorque?: number;
|
|
16
|
-
time: number;
|
|
17
|
-
rpm: number;
|
|
18
|
-
raw?: string;
|
|
19
|
-
};
|
|
20
|
-
declare type CrankData = {
|
|
21
|
-
revolutions?: number;
|
|
22
|
-
time?: number;
|
|
23
|
-
cntUpdateMissing?: number;
|
|
24
|
-
};
|
|
25
|
-
export default class BleEliteDevice extends BleDevice {
|
|
26
|
-
static services: string[];
|
|
27
|
-
static characteristics: string[];
|
|
28
|
-
static detectionPriority: number;
|
|
29
|
-
instantaneousPower: number;
|
|
30
|
-
balance: number;
|
|
31
|
-
accTorque: number;
|
|
32
|
-
rpm: number;
|
|
33
|
-
timeOffset: number;
|
|
34
|
-
time: number;
|
|
35
|
-
currentCrankData: CrankData;
|
|
36
|
-
prevCrankData: CrankData;
|
|
37
|
-
constructor(props?: any);
|
|
38
|
-
isMatching(characteristics: string[]): boolean;
|
|
39
|
-
init(): Promise<boolean>;
|
|
40
|
-
getProfile(): string;
|
|
41
|
-
getServiceUUids(): string[];
|
|
42
|
-
parseCrankData(crankData: any): {
|
|
43
|
-
rpm: number;
|
|
44
|
-
time: any;
|
|
45
|
-
};
|
|
46
|
-
parsePower(_data: Uint8Array): PowerData;
|
|
47
|
-
onData(characteristic: string, data: Buffer): boolean;
|
|
48
|
-
reset(): void;
|
|
49
|
-
}
|
|
50
|
-
export declare class EliteAdapter extends DeviceAdapter {
|
|
51
|
-
device: BleEliteDevice;
|
|
52
|
-
ignore: boolean;
|
|
53
|
-
ble: BleInterface;
|
|
54
|
-
protocol: DeviceProtocol;
|
|
55
|
-
paused: boolean;
|
|
56
|
-
logger: EventLogger;
|
|
57
|
-
mode: CyclingMode;
|
|
58
|
-
distanceInternal: number;
|
|
59
|
-
prevDataTS: number;
|
|
60
|
-
userSettings: {
|
|
61
|
-
weight?: number;
|
|
62
|
-
};
|
|
63
|
-
bikeSettings: {
|
|
64
|
-
weight?: number;
|
|
65
|
-
};
|
|
66
|
-
constructor(device: BleDeviceClass, protocol: BleProtocol);
|
|
67
|
-
isBike(): boolean;
|
|
68
|
-
isHrm(): boolean;
|
|
69
|
-
isPower(): boolean;
|
|
70
|
-
isSame(device: DeviceAdapter): boolean;
|
|
71
|
-
getProfile(): string;
|
|
72
|
-
getName(): string;
|
|
73
|
-
getDisplayName(): string;
|
|
74
|
-
getCyclingMode(): CyclingMode;
|
|
75
|
-
getDefaultCyclingMode(): CyclingMode;
|
|
76
|
-
getSupportedCyclingModes(): any[];
|
|
77
|
-
getPort(): string;
|
|
78
|
-
getWeight(): number;
|
|
79
|
-
setIgnoreBike(ignore: any): void;
|
|
80
|
-
setIgnorePower(ignore: any): void;
|
|
81
|
-
onDeviceData(deviceData: PowerData): void;
|
|
82
|
-
mapData(deviceData: PowerData): IncyclistBikeData;
|
|
83
|
-
transformData(bikeData: IncyclistBikeData): DeviceData;
|
|
84
|
-
start(props?: any): Promise<any>;
|
|
85
|
-
stop(): Promise<boolean>;
|
|
86
|
-
sendUpdate(request: any): Promise<void>;
|
|
87
|
-
pause(): Promise<boolean>;
|
|
88
|
-
resume(): Promise<boolean>;
|
|
89
|
-
}
|
|
90
|
-
export {};
|