incyclist-devices 2.1.0 → 2.1.2
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 -15
- package/lib/antv2/adapter.d.ts +15 -15
- package/lib/antv2/adapter.js +67 -21
- package/lib/antv2/ant-interface.d.ts +3 -11
- package/lib/antv2/ant-interface.js +1 -1
- package/lib/antv2/base/adapter.d.ts +69 -0
- package/lib/antv2/base/adapter.js +439 -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/base/interface.d.ts +46 -0
- package/lib/antv2/base/interface.js +337 -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 +73 -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 +21 -30
- package/lib/antv2/fe/adapter.js +139 -251
- package/lib/antv2/hr/adapter.d.ts +6 -15
- 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 +5 -3
- package/lib/antv2/pwr/adapter.d.ts +9 -33
- package/lib/antv2/pwr/adapter.js +19 -140
- package/lib/antv2/types.d.ts +32 -4
- package/lib/base/adpater.d.ts +39 -60
- package/lib/base/adpater.js +139 -161
- package/lib/base/consts.d.ts +4 -0
- package/lib/base/consts.js +9 -0
- package/lib/ble/adapter-factory.d.ts +10 -11
- package/lib/ble/base/adapter.d.ts +7 -14
- package/lib/ble/base/adapter.js +2 -36
- package/lib/ble/ble-interface.d.ts +5 -7
- package/lib/ble/cp/adapter.d.ts +6 -8
- package/lib/ble/cp/adapter.js +8 -27
- package/lib/ble/elite/adapter.d.ts +7 -8
- package/lib/ble/elite/adapter.js +5 -25
- package/lib/ble/fm/adapter.d.ts +6 -7
- package/lib/ble/fm/adapter.js +13 -34
- package/lib/ble/hr/adapter.d.ts +5 -8
- package/lib/ble/hr/adapter.js +2 -2
- package/lib/ble/peripheral-cache.d.ts +2 -3
- 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 +5 -6
- package/lib/index.js +4 -9
- package/lib/interfaces.d.ts +1 -1
- package/lib/modes/ant-fe-adv-st-mode.d.ts +1 -1
- package/lib/modes/antble-erg.d.ts +1 -1
- package/lib/modes/antble-smarttrainer.d.ts +2 -2
- package/lib/modes/base.d.ts +5 -5
- package/lib/modes/daum-classic-standard.d.ts +3 -2
- package/lib/modes/daum-erg.d.ts +3 -3
- package/lib/modes/daum-premium-standard.d.ts +3 -2
- package/lib/modes/daum-smarttrainer.d.ts +3 -2
- package/lib/modes/kettler-erg.d.ts +3 -3
- package/lib/modes/power-base.d.ts +3 -3
- package/lib/modes/power-base.js +2 -2
- package/lib/modes/power-meter.d.ts +3 -2
- package/lib/modes/simulator.d.ts +2 -1
- package/lib/modes/types.d.ts +2 -13
- package/lib/serial/SinglePathScanner.d.ts +17 -0
- package/lib/serial/SinglePathScanner.js +87 -0
- package/lib/serial/adapter-factory.d.ts +6 -6
- package/lib/serial/adapter.d.ts +6 -11
- 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 +12 -24
- package/lib/serial/daum/DaumAdapter.js +40 -59
- 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 +8 -20
- package/lib/serial/daum/classic/adapter.js +28 -58
- package/lib/serial/daum/classic/comms.d.ts +4 -6
- package/lib/serial/daum/classic/comms.js +2 -2
- 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.js +5 -4
- 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 -19
- package/lib/serial/daum/consts.js +0 -22
- package/lib/serial/daum/premium/adapter.d.ts +8 -11
- package/lib/serial/daum/premium/adapter.js +27 -53
- package/lib/serial/daum/premium/comms.d.ts +4 -7
- package/lib/serial/daum/premium/comms.js +23 -22
- package/lib/serial/daum/premium/mock.d.ts +1 -1
- package/lib/serial/daum/premium/mock.js +2 -2
- 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 +4 -1
- package/lib/serial/daum/types.js +9 -1
- 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 -18
- package/lib/serial/kettler/ergo-racer/adapter.js +9 -21
- 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 +3 -76
- 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 +10 -13
- package/lib/simulator/Simulator.js +11 -23
- package/lib/types/Command.d.ts +8 -0
- package/lib/types/Command.js +2 -0
- package/lib/types/adapter.d.ts +22 -33
- package/lib/types/adapter.js +0 -68
- 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 -0
- package/lib/utils/utils.js +39 -4
- package/package.json +1 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import BleAdapter
|
|
2
|
-
import ICyclingMode
|
|
1
|
+
import BleAdapter from '../base/adapter';
|
|
2
|
+
import ICyclingMode from '../../modes/types';
|
|
3
3
|
import { PowerData } from '../cp';
|
|
4
|
-
import { DeviceProperties } from '../../types
|
|
5
|
-
import { DeviceData } from '../../types/data';
|
|
4
|
+
import { DeviceProperties, IncyclistAdapterData, IncyclistBikeData, ControllerConfig, IAdapter } from '../../types';
|
|
6
5
|
import { BleDeviceSettings } from '../types';
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export default class BleEliteAdapter extends BleAdapter {
|
|
7
|
+
protected static controllers: ControllerConfig;
|
|
9
8
|
distanceInternal: number;
|
|
10
9
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
11
|
-
isSame(device:
|
|
10
|
+
isSame(device: IAdapter): boolean;
|
|
12
11
|
getProfile(): string;
|
|
13
12
|
getName(): string;
|
|
14
13
|
getDefaultCyclingMode(): ICyclingMode;
|
|
15
14
|
getSupportedCyclingModes(): any[];
|
|
16
15
|
mapData(deviceData: PowerData): IncyclistBikeData;
|
|
17
|
-
transformData(bikeData: IncyclistBikeData):
|
|
16
|
+
transformData(bikeData: IncyclistBikeData): IncyclistAdapterData;
|
|
18
17
|
start(props?: any): Promise<any>;
|
|
19
18
|
sendUpdate(request: any): Promise<void>;
|
|
20
19
|
}
|
package/lib/ble/elite/adapter.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -36,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
13
|
};
|
|
37
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
15
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
39
|
-
const adapter_1 =
|
|
16
|
+
const adapter_1 = __importDefault(require("../base/adapter"));
|
|
40
17
|
const comms_1 = __importDefault(require("./comms"));
|
|
41
18
|
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
42
19
|
const capabilities_1 = require("../../types/capabilities");
|
|
@@ -44,7 +21,6 @@ class BleEliteAdapter extends adapter_1.default {
|
|
|
44
21
|
constructor(settings, props) {
|
|
45
22
|
super(settings, props);
|
|
46
23
|
this.distanceInternal = 0;
|
|
47
|
-
this.setControl(new adapter_1.BlePowerControl(this, props));
|
|
48
24
|
this.logger = new gd_eventlog_1.EventLogger('BLE-Elite');
|
|
49
25
|
const { id, address, name } = settings;
|
|
50
26
|
const logger = this.logger;
|
|
@@ -141,4 +117,8 @@ class BleEliteAdapter extends adapter_1.default {
|
|
|
141
117
|
});
|
|
142
118
|
}
|
|
143
119
|
}
|
|
120
|
+
BleEliteAdapter.controllers = {
|
|
121
|
+
modes: [power_meter_1.default],
|
|
122
|
+
default: power_meter_1.default
|
|
123
|
+
};
|
|
144
124
|
exports.default = BleEliteAdapter;
|
package/lib/ble/fm/adapter.d.ts
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import BleAdapter from '../base/adapter';
|
|
2
|
-
import ICyclingMode, { CyclingMode
|
|
2
|
+
import ICyclingMode, { CyclingMode } from '../../modes/types';
|
|
3
3
|
import { IndoorBikeData } from './types';
|
|
4
|
-
import { DeviceData } from '../../types/data';
|
|
5
4
|
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from '../types';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export default class BleFmAdapter extends BleAdapter<ControllableDevice<BleDeviceProperties>> {
|
|
5
|
+
import { IAdapter, IncyclistAdapterData, IncyclistBikeData } from '../../types';
|
|
6
|
+
export default class BleFmAdapter extends BleAdapter {
|
|
9
7
|
distanceInternal: number;
|
|
10
8
|
connectPromise: Promise<boolean>;
|
|
11
9
|
constructor(settings: BleDeviceSettings, props?: BleDeviceProperties);
|
|
12
|
-
isSame(device:
|
|
10
|
+
isSame(device: IAdapter): boolean;
|
|
13
11
|
getProfile(): string;
|
|
14
12
|
getName(): string;
|
|
15
13
|
getDisplayName(): string;
|
|
14
|
+
isControllable(): boolean;
|
|
16
15
|
getSupportedCyclingModes(): Array<typeof CyclingMode>;
|
|
17
16
|
getDefaultCyclingMode(): ICyclingMode;
|
|
18
17
|
mapData(deviceData: IndoorBikeData): IncyclistBikeData;
|
|
19
|
-
transformData(bikeData: IncyclistBikeData):
|
|
18
|
+
transformData(bikeData: IncyclistBikeData): IncyclistAdapterData;
|
|
20
19
|
start(props?: BleStartProperties): Promise<any>;
|
|
21
20
|
sendUpdate(request: any, enforced?: boolean): Promise<void>;
|
|
22
21
|
sendInitCommands(): Promise<boolean>;
|
package/lib/ble/fm/adapter.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -40,23 +17,22 @@ const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
|
40
17
|
const antble_smarttrainer_1 = __importDefault(require("../../modes/antble-smarttrainer"));
|
|
41
18
|
const antble_erg_1 = __importDefault(require("../../modes/antble-erg"));
|
|
42
19
|
const comms_1 = __importDefault(require("./comms"));
|
|
43
|
-
const adapter_1 =
|
|
20
|
+
const adapter_1 = __importDefault(require("../base/adapter"));
|
|
44
21
|
const consts_1 = require("./consts");
|
|
45
22
|
const utils_1 = require("../../utils/utils");
|
|
46
|
-
const
|
|
23
|
+
const types_1 = require("../../types");
|
|
47
24
|
class BleFmAdapter extends adapter_1.default {
|
|
48
25
|
constructor(settings, props) {
|
|
49
26
|
super(settings, props);
|
|
50
27
|
this.distanceInternal = 0;
|
|
51
|
-
this.setControl(new adapter_1.BlePowerControl(this, props));
|
|
52
28
|
this.logger = new gd_eventlog_1.EventLogger('BLE-FM');
|
|
53
29
|
const { id, address, name } = settings;
|
|
54
30
|
const logger = this.logger;
|
|
55
31
|
const ble = this.ble;
|
|
56
32
|
this.device = new comms_1.default({ id, address, name, ble, logger });
|
|
57
33
|
this.capabilities = [
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence,
|
|
35
|
+
types_1.IncyclistCapability.Control
|
|
60
36
|
];
|
|
61
37
|
}
|
|
62
38
|
isSame(device) {
|
|
@@ -73,6 +49,9 @@ class BleFmAdapter extends adapter_1.default {
|
|
|
73
49
|
getDisplayName() {
|
|
74
50
|
return this.getName();
|
|
75
51
|
}
|
|
52
|
+
isControllable() {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
76
55
|
getSupportedCyclingModes() {
|
|
77
56
|
var _a;
|
|
78
57
|
const modes = [power_meter_1.default];
|
|
@@ -209,14 +188,14 @@ class BleFmAdapter extends adapter_1.default {
|
|
|
209
188
|
comms.on('disconnected', this.emit);
|
|
210
189
|
}
|
|
211
190
|
const before = this.capabilities.join(',');
|
|
212
|
-
if (comms.features.heartrate && !this.hasCapability(
|
|
213
|
-
this.capabilities.push(
|
|
191
|
+
if (comms.features.heartrate && !this.hasCapability(types_1.IncyclistCapability.HeartRate)) {
|
|
192
|
+
this.capabilities.push(types_1.IncyclistCapability.HeartRate);
|
|
214
193
|
}
|
|
215
|
-
if (comms.features.cadence && !this.hasCapability(
|
|
216
|
-
this.capabilities.push(
|
|
194
|
+
if (comms.features.cadence && !this.hasCapability(types_1.IncyclistCapability.Cadence)) {
|
|
195
|
+
this.capabilities.push(types_1.IncyclistCapability.Cadence);
|
|
217
196
|
}
|
|
218
|
-
if (comms.features.power && !this.hasCapability(
|
|
219
|
-
this.capabilities.push(
|
|
197
|
+
if (comms.features.power && !this.hasCapability(types_1.IncyclistCapability.Power)) {
|
|
198
|
+
this.capabilities.push(types_1.IncyclistCapability.Power);
|
|
220
199
|
}
|
|
221
200
|
const after = this.capabilities.join(',');
|
|
222
201
|
if (before !== after) {
|
package/lib/ble/hr/adapter.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import BleAdapter from '../base/adapter';
|
|
2
|
-
import { DeviceProperties } from '../../types
|
|
3
|
-
import {
|
|
2
|
+
import { IncyclistAdapterData, IAdapter, DeviceProperties } from '../../types';
|
|
3
|
+
import { BleDeviceSettings } from '../types';
|
|
4
4
|
import { HrmData } from './types';
|
|
5
|
-
|
|
6
|
-
import { NonControllableDevice } from '../../base/adpater';
|
|
7
|
-
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
8
|
-
export default class HrmAdapter extends BleAdapter<NonControllableDevice<BleDeviceProperties>> {
|
|
5
|
+
export default class HrmAdapter extends BleAdapter {
|
|
9
6
|
ignore: boolean;
|
|
10
7
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
11
|
-
isSame(device:
|
|
8
|
+
isSame(device: IAdapter): boolean;
|
|
12
9
|
getProfile(): string;
|
|
13
10
|
getName(): string;
|
|
14
11
|
getDisplayName(): string;
|
|
15
|
-
mapData(deviceData: HrmData):
|
|
12
|
+
mapData(deviceData: HrmData): IncyclistAdapterData;
|
|
16
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,7 +1,6 @@
|
|
|
1
|
-
import { Controllable } from "../types/adapter";
|
|
2
1
|
import BleAdapter from "./base/adapter";
|
|
3
2
|
import BlePeripheralConnector from "./ble-peripheral";
|
|
4
|
-
import { BleCharacteristic,
|
|
3
|
+
import { BleCharacteristic, BlePeripheral } from "./types";
|
|
5
4
|
export interface PeripheralState {
|
|
6
5
|
isLoading: boolean;
|
|
7
6
|
isConfigured: boolean;
|
|
@@ -19,7 +18,7 @@ export interface PeripheralCacheItem {
|
|
|
19
18
|
}
|
|
20
19
|
export default class BlePeripheralCache {
|
|
21
20
|
peripherals: PeripheralCacheItem[];
|
|
22
|
-
findAdapter(adapter: BleAdapter
|
|
21
|
+
findAdapter(adapter: BleAdapter): PeripheralCacheItem;
|
|
23
22
|
getConnector(peripheral: BlePeripheral): BlePeripheralConnector;
|
|
24
23
|
getPeripheral(query: {
|
|
25
24
|
id?: string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BleFmAdapter } from '../fm';
|
|
2
|
-
import { DeviceProperties } from '../../types/device';
|
|
3
2
|
import { BleDeviceSettings, BleStartProperties } from '../types';
|
|
4
|
-
import {
|
|
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
2
|
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from '../types';
|
|
3
|
-
import {
|
|
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/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 interface_1 = __importDefault(require("../antv2/base/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 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, Controllable } from './types/adapter';
|
|
6
|
-
import { ControllableDevice as ControllableDeviceAdapter } from './base/adpater';
|
|
7
3
|
import { IncyclistCapability } from './types/capabilities';
|
|
8
|
-
import {
|
|
4
|
+
import { IncyclistAdapterData } from './types/data';
|
|
9
5
|
import { DeviceSettings, DeviceProperties } from './types/device';
|
|
10
6
|
import ICyclingMode from './modes/types';
|
|
11
7
|
import calc from './utils/calculations';
|
|
8
|
+
import IncyclistDevice, { IncyclistDeviceAdapter } from './base/adpater';
|
|
9
|
+
import { IAdapter } from './types/adapter';
|
|
10
|
+
export * from './factories';
|
|
12
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,21 +17,16 @@ 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 adapter_1 = require("./types/adapter");
|
|
28
|
-
Object.defineProperty(exports, "Controllable", { enumerable: true, get: function () { return adapter_1.Controllable; } });
|
|
29
|
-
const adpater_1 = require("./base/adpater");
|
|
30
|
-
Object.defineProperty(exports, "ControllableDeviceAdapter", { enumerable: true, get: function () { return adpater_1.ControllableDevice; } });
|
|
31
23
|
const capabilities_1 = require("./types/capabilities");
|
|
32
24
|
Object.defineProperty(exports, "IncyclistCapability", { enumerable: true, get: function () { return capabilities_1.IncyclistCapability; } });
|
|
33
25
|
const calculations_1 = __importDefault(require("./utils/calculations"));
|
|
34
26
|
exports.calc = calculations_1.default;
|
|
27
|
+
const adpater_1 = __importDefault(require("./base/adpater"));
|
|
28
|
+
exports.IncyclistDevice = adpater_1.default;
|
|
29
|
+
__exportStar(require("./factories"), exports);
|
|
35
30
|
__exportStar(require("./modes/types"), exports);
|
|
36
31
|
__exportStar(require("./serial"), exports);
|
|
37
32
|
__exportStar(require("./ble"), 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): AntInterface |
|
|
6
|
+
static create(ifaceName: string, props?: InterfaceProps): AntInterface | BleInterface | SerialInterface;
|
|
7
7
|
}
|