incyclist-devices 2.0.38 → 2.1.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/lib/antv2/adapter-factory.d.ts +4 -2
- package/lib/antv2/adapter.d.ts +3 -20
- package/lib/antv2/adapter.js +2 -92
- package/lib/antv2/fe/adapter.d.ts +9 -5
- package/lib/antv2/fe/adapter.js +25 -14
- package/lib/antv2/hr/adapter.d.ts +2 -1
- package/lib/antv2/pwr/adapter.d.ts +9 -5
- package/lib/antv2/pwr/adapter.js +19 -8
- package/lib/antv2/types.d.ts +2 -1
- package/lib/base/adpater.d.ts +31 -13
- package/lib/base/adpater.js +84 -28
- package/lib/ble/adapter-factory.d.ts +10 -9
- package/lib/ble/base/adapter.d.ts +9 -20
- package/lib/ble/base/adapter.js +13 -69
- package/lib/ble/ble-interface.d.ts +5 -4
- package/lib/ble/cp/adapter.d.ts +5 -8
- package/lib/ble/cp/adapter.js +26 -10
- package/lib/ble/elite/adapter.d.ts +6 -5
- package/lib/ble/elite/adapter.js +26 -2
- package/lib/ble/fm/adapter.d.ts +10 -9
- package/lib/ble/fm/adapter.js +38 -11
- package/lib/ble/hr/adapter.d.ts +5 -3
- package/lib/ble/peripheral-cache.d.ts +3 -2
- package/lib/ble/tacx/adapter.d.ts +2 -2
- package/lib/ble/wahoo/adapter.d.ts +2 -2
- package/lib/index.d.ts +5 -5
- package/lib/index.js +4 -2
- package/lib/interfaces.d.ts +1 -1
- package/lib/modes/ant-fe-adv-st-mode.d.ts +12 -0
- package/lib/modes/ant-fe-adv-st-mode.js +83 -0
- package/lib/modes/antble-erg.d.ts +31 -0
- package/lib/modes/antble-erg.js +28 -0
- package/lib/modes/antble-smarttrainer.d.ts +23 -0
- package/lib/modes/antble-smarttrainer.js +65 -0
- package/lib/modes/base.d.ts +29 -0
- package/lib/modes/{cycling-mode.js → base.js} +23 -26
- package/lib/modes/daum-classic-standard.d.ts +16 -0
- package/lib/modes/daum-classic-standard.js +54 -0
- package/lib/modes/daum-erg.d.ts +49 -0
- package/lib/{serial/daum/ERGCyclingMode.js → modes/daum-erg.js} +45 -73
- package/lib/modes/daum-power.d.ts +5 -0
- package/lib/{serial/daum/DaumPowerMeterCyclingMode.js → modes/daum-power.js} +1 -10
- package/lib/modes/daum-premium-standard.d.ts +23 -0
- package/lib/{serial/daum/premium/modes/daum-classic.js → modes/daum-premium-standard.js} +26 -38
- package/lib/modes/daum-smarttrainer.d.ts +82 -0
- package/lib/{serial/daum/SmartTrainerCyclingMode.js → modes/daum-smarttrainer.js} +23 -26
- package/lib/modes/kettler-erg.d.ts +44 -0
- package/lib/{serial/kettler/ergo-racer/modes/erg.js → modes/kettler-erg.js} +12 -23
- package/lib/modes/power-base.d.ts +28 -3
- package/lib/modes/power-base.js +182 -5
- package/lib/modes/power-meter.d.ts +10 -16
- package/lib/modes/power-meter.js +15 -54
- package/lib/modes/simulator.d.ts +37 -10
- package/lib/modes/simulator.js +14 -46
- package/lib/modes/{cycling-mode.d.ts → types.d.ts} +22 -19
- package/lib/modes/types.js +56 -0
- package/lib/serial/adapter-factory.d.ts +7 -5
- package/lib/serial/adapter.d.ts +2 -2
- package/lib/serial/adapter.js +5 -2
- package/lib/serial/daum/DaumAdapter.d.ts +27 -24
- package/lib/serial/daum/DaumAdapter.js +200 -128
- package/lib/serial/daum/classic/adapter.d.ts +20 -21
- package/lib/serial/daum/classic/adapter.js +83 -157
- package/lib/serial/daum/classic/comms.d.ts +19 -13
- package/lib/serial/daum/classic/comms.js +39 -12
- package/lib/serial/daum/classic/mock.d.ts +4 -0
- package/lib/serial/daum/classic/mock.js +14 -4
- package/lib/serial/daum/premium/adapter.d.ts +16 -11
- package/lib/serial/daum/premium/adapter.js +98 -95
- package/lib/serial/daum/premium/comms.d.ts +4 -1
- package/lib/serial/daum/premium/comms.js +25 -17
- package/lib/serial/daum/premium/mock.d.ts +4 -0
- package/lib/serial/daum/premium/mock.js +15 -5
- package/lib/serial/daum/types.d.ts +11 -0
- package/lib/serial/daum/types.js +5 -0
- package/lib/serial/kettler/ergo-racer/adapter.d.ts +10 -8
- package/lib/serial/kettler/ergo-racer/adapter.js +17 -7
- package/lib/serial/serial-interface.js +1 -2
- package/lib/simulator/Simulator.d.ts +14 -17
- package/lib/simulator/Simulator.js +18 -47
- package/lib/types/adapter.d.ts +29 -8
- package/lib/types/adapter.js +68 -0
- package/lib/utils/utils.d.ts +1 -1
- package/package.json +3 -3
- package/lib/antv2/modes/ant-fe-adv-st-mode.d.ts +0 -9
- package/lib/antv2/modes/ant-fe-adv-st-mode.js +0 -51
- package/lib/antv2/modes/ant-fe-erg-mode.d.ts +0 -6
- package/lib/antv2/modes/ant-fe-erg-mode.js +0 -14
- package/lib/antv2/modes/ant-fe-st-mode.d.ts +0 -5
- package/lib/antv2/modes/ant-fe-st-mode.js +0 -13
- package/lib/modes/ble-erg-mode.d.ts +0 -18
- package/lib/modes/ble-erg-mode.js +0 -148
- package/lib/modes/ble-st-mode.d.ts +0 -15
- package/lib/modes/ble-st-mode.js +0 -96
- package/lib/serial/daum/DaumPowerMeterCyclingMode.d.ts +0 -8
- package/lib/serial/daum/ERGCyclingMode.d.ts +0 -26
- package/lib/serial/daum/SmartTrainerCyclingMode.d.ts +0 -42
- package/lib/serial/daum/classic/modes/daum-classic.d.ts +0 -13
- package/lib/serial/daum/classic/modes/daum-classic.js +0 -97
- package/lib/serial/daum/premium/modes/daum-classic.d.ts +0 -14
- package/lib/serial/kettler/ergo-racer/modes/erg.d.ts +0 -25
- /package/lib/serial/daum/{constants.d.ts → consts.d.ts} +0 -0
- /package/lib/serial/daum/{constants.js → consts.js} +0 -0
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { DeviceProperties } from "../types/device";
|
|
2
2
|
import BleAdapter from "./base/adapter";
|
|
3
|
-
import { BleDeviceSettings, BleProtocol } from "./types";
|
|
3
|
+
import { BleDeviceProperties, BleDeviceSettings, BleProtocol } from "./types";
|
|
4
4
|
import { BleComms } from "./base/comms";
|
|
5
|
+
import { Controllable } from "../types/adapter";
|
|
5
6
|
export interface BleAdapterInfo {
|
|
6
7
|
protocol: BleProtocol;
|
|
7
|
-
Adapter: typeof BleAdapter
|
|
8
|
+
Adapter: typeof BleAdapter<Controllable<BleDeviceProperties>>;
|
|
8
9
|
Comm: typeof BleComms;
|
|
9
10
|
}
|
|
10
11
|
export default class BleAdapterFactory {
|
|
11
12
|
static _instance: BleAdapterFactory;
|
|
12
13
|
implementations: BleAdapterInfo[];
|
|
13
|
-
instances: BleAdapter
|
|
14
|
+
instances: Array<BleAdapter<Controllable<BleDeviceProperties>>>;
|
|
14
15
|
static getInstance(): BleAdapterFactory;
|
|
15
16
|
constructor();
|
|
16
17
|
getAdapterInfo(protocol: BleProtocol): BleAdapterInfo;
|
|
17
18
|
getAll(): BleAdapterInfo[];
|
|
18
|
-
createInstance(settings: BleDeviceSettings, props?: DeviceProperties): BleAdapter
|
|
19
|
+
createInstance(settings: BleDeviceSettings, props?: DeviceProperties): BleAdapter<Controllable<BleDeviceProperties>>;
|
|
19
20
|
removeInstance(query: {
|
|
20
21
|
settings?: BleDeviceSettings;
|
|
21
|
-
adapter?: BleAdapter
|
|
22
|
+
adapter?: BleAdapter<Controllable<DeviceProperties>>;
|
|
22
23
|
}): void;
|
|
23
|
-
find(settings?: BleDeviceSettings): BleAdapter
|
|
24
|
-
register(protocol: BleProtocol, Adapter: typeof BleAdapter
|
|
25
|
-
getAllInstances(): BleAdapter
|
|
24
|
+
find(settings?: BleDeviceSettings): BleAdapter<Controllable<BleDeviceProperties>>;
|
|
25
|
+
register(protocol: BleProtocol, Adapter: typeof BleAdapter<Controllable<BleDeviceProperties>>, Comm: typeof BleComms): void;
|
|
26
|
+
getAllInstances(): Array<BleAdapter<Controllable<DeviceProperties>>>;
|
|
26
27
|
getAllSupportedComms(): (typeof BleComms)[];
|
|
27
|
-
getAllSupportedAdapters(): (typeof BleAdapter)
|
|
28
|
+
getAllSupportedAdapters(): Array<(typeof BleAdapter<Controllable<BleDeviceProperties>>)>;
|
|
28
29
|
getAllSupportedServices(): string[];
|
|
29
30
|
getDeviceClasses(peripheral: any, props?: {
|
|
30
31
|
protocol?: BleProtocol;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import IncyclistDevice from "../../base/adpater";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import IncyclistDevice, { ControllableDevice } from "../../base/adpater";
|
|
2
|
+
import ICyclingMode, { IncyclistBikeData } from "../../modes/types";
|
|
3
|
+
import { Controllable, IncyclistDeviceAdapter } from "../../types/adapter";
|
|
4
4
|
import { DeviceData } from "../../types/data";
|
|
5
5
|
import { DeviceProperties } from "../../types/device";
|
|
6
|
-
import { User } from "../../types/user";
|
|
7
6
|
import { BleComms } from "./comms";
|
|
8
7
|
import BleInterface from "../ble-interface";
|
|
9
8
|
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from "../types";
|
|
10
|
-
export
|
|
9
|
+
export declare class BlePowerControl extends ControllableDevice<BleDeviceProperties> {
|
|
10
|
+
getDefaultCyclingMode(): ICyclingMode;
|
|
11
|
+
getSupportedCyclingModes(): any[];
|
|
12
|
+
}
|
|
13
|
+
export default class BleAdapter<DC extends Controllable<BleDeviceProperties>> extends IncyclistDevice<DC, BleDeviceProperties> {
|
|
11
14
|
ble: BleInterface;
|
|
12
15
|
deviceData: any;
|
|
13
16
|
data: DeviceData;
|
|
@@ -20,7 +23,7 @@ export default class BleAdapter extends IncyclistDevice {
|
|
|
20
23
|
close(): Promise<boolean>;
|
|
21
24
|
getComms(): BleComms;
|
|
22
25
|
isEqual(settings: BleDeviceSettings): boolean;
|
|
23
|
-
isSame(adapter:
|
|
26
|
+
isSame(adapter: IncyclistDeviceAdapter): boolean;
|
|
24
27
|
isConnected(): boolean;
|
|
25
28
|
resetData(): void;
|
|
26
29
|
getInterface(): string;
|
|
@@ -38,17 +41,3 @@ export default class BleAdapter extends IncyclistDevice {
|
|
|
38
41
|
pause(): Promise<boolean>;
|
|
39
42
|
resume(): Promise<boolean>;
|
|
40
43
|
}
|
|
41
|
-
export declare class BleControllableAdapter extends BleAdapter implements Bike {
|
|
42
|
-
cyclingMode: CyclingMode;
|
|
43
|
-
user?: User;
|
|
44
|
-
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
45
|
-
setUser(user: User): void;
|
|
46
|
-
isControllable(): boolean;
|
|
47
|
-
setBikeProps(props: DeviceProperties): void;
|
|
48
|
-
getWeight(): number;
|
|
49
|
-
getSupportedCyclingModes(): any[];
|
|
50
|
-
getDefaultCyclingMode(): CyclingMode;
|
|
51
|
-
setCyclingMode(mode: CyclingMode | string, settings?: any): void;
|
|
52
|
-
sendInitCommands(): Promise<boolean>;
|
|
53
|
-
getCyclingMode(): CyclingMode;
|
|
54
|
-
}
|
package/lib/ble/base/adapter.js
CHANGED
|
@@ -35,10 +35,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
38
|
+
exports.BlePowerControl = void 0;
|
|
39
39
|
const adpater_1 = __importStar(require("../../base/adpater"));
|
|
40
40
|
const ble_interface_1 = __importDefault(require("../ble-interface"));
|
|
41
|
+
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
41
42
|
const INTERFACE_NAME = 'ble';
|
|
43
|
+
class BlePowerControl extends adpater_1.ControllableDevice {
|
|
44
|
+
getDefaultCyclingMode() {
|
|
45
|
+
return new power_meter_1.default(this.adapter);
|
|
46
|
+
}
|
|
47
|
+
getSupportedCyclingModes() {
|
|
48
|
+
return [power_meter_1.default];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.BlePowerControl = BlePowerControl;
|
|
42
52
|
class BleAdapter extends adpater_1.default {
|
|
43
53
|
constructor(settings, props) {
|
|
44
54
|
super(settings, props);
|
|
@@ -136,8 +146,8 @@ class BleAdapter extends adpater_1.default {
|
|
|
136
146
|
this.deviceData = Object.assign({}, deviceData);
|
|
137
147
|
if (!this.started || !this.canSendUpdate())
|
|
138
148
|
return;
|
|
139
|
-
this.logEvent({ message: 'onDeviceData', data: deviceData, isControllable: (
|
|
140
|
-
if (this
|
|
149
|
+
this.logEvent({ message: 'onDeviceData', data: deviceData, isControllable: this.isControllable() });
|
|
150
|
+
if (this.isControllable()) {
|
|
141
151
|
const mappedData = this.mapData(deviceData);
|
|
142
152
|
const incyclistData = this.getCyclingMode().updateData(mappedData);
|
|
143
153
|
this.data = this.transformData(incyclistData);
|
|
@@ -232,69 +242,3 @@ class BleAdapter extends adpater_1.default {
|
|
|
232
242
|
}
|
|
233
243
|
}
|
|
234
244
|
exports.default = BleAdapter;
|
|
235
|
-
class BleControllableAdapter extends BleAdapter {
|
|
236
|
-
constructor(settings, props) {
|
|
237
|
-
super(settings, props);
|
|
238
|
-
this.cyclingMode = this.getDefaultCyclingMode();
|
|
239
|
-
this.user = {};
|
|
240
|
-
}
|
|
241
|
-
setUser(user) {
|
|
242
|
-
this.user = user;
|
|
243
|
-
if (!user.weight)
|
|
244
|
-
this.user.weight = adpater_1.DEFAULT_USER_WEIGHT;
|
|
245
|
-
}
|
|
246
|
-
isControllable() {
|
|
247
|
-
return true;
|
|
248
|
-
}
|
|
249
|
-
setBikeProps(props) {
|
|
250
|
-
const { user, userWeight } = props || {};
|
|
251
|
-
if (user)
|
|
252
|
-
this.setUser(user);
|
|
253
|
-
if (userWeight)
|
|
254
|
-
this.user.weight = userWeight;
|
|
255
|
-
const keys = Object.keys(props);
|
|
256
|
-
keys.forEach(k => {
|
|
257
|
-
const p = props[k];
|
|
258
|
-
if (p === null)
|
|
259
|
-
delete this.props[k];
|
|
260
|
-
else if (p !== undefined)
|
|
261
|
-
this.props[k] = p;
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
getWeight() {
|
|
265
|
-
const { user = {}, props = adpater_1.DEFAULT_PROPS } = this;
|
|
266
|
-
const userWeight = user.weight || props.userWeight || adpater_1.DEFAULT_USER_WEIGHT;
|
|
267
|
-
const bikeWeight = props.bikeWeight || adpater_1.DEFAULT_BIKE_WEIGHT;
|
|
268
|
-
return userWeight + bikeWeight;
|
|
269
|
-
}
|
|
270
|
-
getSupportedCyclingModes() { throw new Error('not implemented'); }
|
|
271
|
-
getDefaultCyclingMode() { throw new Error('not implemented'); }
|
|
272
|
-
setCyclingMode(mode, settings) {
|
|
273
|
-
let selectedMode;
|
|
274
|
-
if (typeof mode === 'string') {
|
|
275
|
-
const supported = this.getSupportedCyclingModes();
|
|
276
|
-
const CyclingModeClass = supported.find(M => { const m = new M(this); return m.getName() === mode; });
|
|
277
|
-
if (CyclingModeClass) {
|
|
278
|
-
this.cyclingMode = new CyclingModeClass(this, settings);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
selectedMode = this.getDefaultCyclingMode();
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
selectedMode = mode;
|
|
285
|
-
}
|
|
286
|
-
this.cyclingMode = selectedMode;
|
|
287
|
-
this.cyclingMode.setSettings(settings);
|
|
288
|
-
}
|
|
289
|
-
sendInitCommands() {
|
|
290
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
-
return true;
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
getCyclingMode() {
|
|
295
|
-
if (!this.cyclingMode)
|
|
296
|
-
this.setCyclingMode(this.getDefaultCyclingMode());
|
|
297
|
-
return this.cyclingMode;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
exports.BleControllableAdapter = BleControllableAdapter;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { EventLogger } from 'gd-eventlog';
|
|
4
4
|
import BleAdapterFactory from './adapter-factory';
|
|
5
|
-
import { BleInterfaceProps, BlePeripheral, BleDeviceSettings, BleProtocol, BleBinding, BleInterfaceState, BleScanProps, BleCharacteristic } from './types';
|
|
5
|
+
import { BleInterfaceProps, BlePeripheral, BleDeviceSettings, BleProtocol, BleBinding, BleInterfaceState, BleScanProps, BleCharacteristic, BleDeviceProperties } from './types';
|
|
6
6
|
import { BleComms } from './base/comms';
|
|
7
7
|
import { IncyclistInterface } from '../types/interface';
|
|
8
8
|
import BleAdapter from './base/adapter';
|
|
9
9
|
import { IncyclistScanProps } from '../types/device';
|
|
10
10
|
import BlePeripheralCache from './peripheral-cache';
|
|
11
11
|
import EventEmitter from 'events';
|
|
12
|
+
import { Controllable } from '..';
|
|
12
13
|
export interface ScanState {
|
|
13
14
|
isScanning: boolean;
|
|
14
15
|
isConnecting: boolean;
|
|
@@ -40,7 +41,7 @@ export default class BleInterface extends EventEmitter implements IncyclistInter
|
|
|
40
41
|
logger: EventLogger;
|
|
41
42
|
props: BleInterfaceProps;
|
|
42
43
|
binding: BleBinding;
|
|
43
|
-
connectedDevices: BleAdapter
|
|
44
|
+
connectedDevices: Array<BleAdapter<Controllable<BleDeviceProperties>>>;
|
|
44
45
|
sensorIsConnecting: boolean;
|
|
45
46
|
emittingAdapters: {
|
|
46
47
|
comms: BleComms;
|
|
@@ -79,6 +80,6 @@ export default class BleInterface extends EventEmitter implements IncyclistInter
|
|
|
79
80
|
scan(props?: BleScanProps): Promise<BleDeviceSettings[]>;
|
|
80
81
|
stopScan(): Promise<boolean>;
|
|
81
82
|
isScanning(): boolean;
|
|
82
|
-
addConnectedDevice(device: BleAdapter): void;
|
|
83
|
-
removeConnectedDevice(device: BleAdapter): void;
|
|
83
|
+
addConnectedDevice(device: BleAdapter<Controllable<BleDeviceProperties>>): void;
|
|
84
|
+
removeConnectedDevice(device: BleAdapter<Controllable<BleDeviceProperties>>): void;
|
|
84
85
|
}
|
package/lib/ble/cp/adapter.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { BleControllableAdapter } from '../base/adapter';
|
|
1
|
+
import { IncyclistBikeData } from '../../modes/types';
|
|
2
|
+
import BleAdapter, { BlePowerControl } from '../base/adapter';
|
|
4
3
|
import { DeviceProperties } from '../../types/device';
|
|
5
4
|
import { PowerData } from './types';
|
|
6
5
|
import { DeviceData } from '../../types/data';
|
|
7
6
|
import { BleDeviceSettings } from '../types';
|
|
8
|
-
import
|
|
9
|
-
export default class PwrAdapter extends
|
|
7
|
+
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
8
|
+
export default class PwrAdapter extends BleAdapter<BlePowerControl> {
|
|
10
9
|
distanceInternal: number;
|
|
11
10
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
12
|
-
isSame(device:
|
|
11
|
+
isSame(device: IncyclistDeviceAdapter): boolean;
|
|
13
12
|
getProfile(): string;
|
|
14
13
|
getName(): string;
|
|
15
14
|
getDisplayName(): string;
|
|
16
|
-
getDefaultCyclingMode(): CyclingMode;
|
|
17
|
-
getSupportedCyclingModes(): any[];
|
|
18
15
|
mapData(deviceData: PowerData): IncyclistBikeData;
|
|
19
16
|
transformData(bikeData: IncyclistBikeData): DeviceData;
|
|
20
17
|
sendUpdate(request: any): Promise<void>;
|
package/lib/ble/cp/adapter.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -13,18 +36,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
36
|
};
|
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
38
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
|
-
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
17
39
|
const comm_1 = __importDefault(require("./comm"));
|
|
18
|
-
const adapter_1 = require("../base/adapter");
|
|
40
|
+
const adapter_1 = __importStar(require("../base/adapter"));
|
|
19
41
|
const capabilities_1 = require("../../types/capabilities");
|
|
20
|
-
class PwrAdapter extends adapter_1.
|
|
42
|
+
class PwrAdapter extends adapter_1.default {
|
|
21
43
|
constructor(settings, props) {
|
|
22
44
|
super(settings, props);
|
|
23
45
|
this.distanceInternal = 0;
|
|
46
|
+
this.setControl(new adapter_1.BlePowerControl(this, props));
|
|
24
47
|
this.logger = new gd_eventlog_1.EventLogger('Ble-CP');
|
|
25
48
|
const { id, address, name } = settings;
|
|
26
49
|
const logger = this.logger;
|
|
27
|
-
const ble = this.ble;
|
|
28
50
|
this.device = new comm_1.default({ id, address, name, logger });
|
|
29
51
|
this.capabilities = [
|
|
30
52
|
capabilities_1.IncyclistCapability.Power, capabilities_1.IncyclistCapability.Cadence, capabilities_1.IncyclistCapability.Speed
|
|
@@ -47,12 +69,6 @@ class PwrAdapter extends adapter_1.BleControllableAdapter {
|
|
|
47
69
|
const powerStr = power ? ` (${power})` : '';
|
|
48
70
|
return `${name}${powerStr}`;
|
|
49
71
|
}
|
|
50
|
-
getDefaultCyclingMode() {
|
|
51
|
-
return new power_meter_1.default(this);
|
|
52
|
-
}
|
|
53
|
-
getSupportedCyclingModes() {
|
|
54
|
-
return [power_meter_1.default];
|
|
55
|
-
}
|
|
56
72
|
mapData(deviceData) {
|
|
57
73
|
const data = {
|
|
58
74
|
isPedalling: false,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import BleAdapter, {
|
|
2
|
-
import
|
|
1
|
+
import BleAdapter, { BlePowerControl } from '../base/adapter';
|
|
2
|
+
import ICyclingMode, { IncyclistBikeData } from '../../modes/types';
|
|
3
3
|
import { PowerData } from '../cp';
|
|
4
4
|
import { DeviceProperties } from '../../types/device';
|
|
5
5
|
import { DeviceData } from '../../types/data';
|
|
6
6
|
import { BleDeviceSettings } from '../types';
|
|
7
|
-
|
|
7
|
+
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
8
|
+
export default class BleEliteAdapter extends BleAdapter<BlePowerControl> {
|
|
8
9
|
distanceInternal: number;
|
|
9
10
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
10
|
-
isSame(device:
|
|
11
|
+
isSame(device: IncyclistDeviceAdapter): boolean;
|
|
11
12
|
getProfile(): string;
|
|
12
13
|
getName(): string;
|
|
13
|
-
getDefaultCyclingMode():
|
|
14
|
+
getDefaultCyclingMode(): ICyclingMode;
|
|
14
15
|
getSupportedCyclingModes(): any[];
|
|
15
16
|
mapData(deviceData: PowerData): IncyclistBikeData;
|
|
16
17
|
transformData(bikeData: IncyclistBikeData): DeviceData;
|
package/lib/ble/elite/adapter.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -13,14 +36,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
36
|
};
|
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
38
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
|
-
const adapter_1 = require("../base/adapter");
|
|
39
|
+
const adapter_1 = __importStar(require("../base/adapter"));
|
|
17
40
|
const comms_1 = __importDefault(require("./comms"));
|
|
18
41
|
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
19
42
|
const capabilities_1 = require("../../types/capabilities");
|
|
20
|
-
class BleEliteAdapter extends adapter_1.
|
|
43
|
+
class BleEliteAdapter extends adapter_1.default {
|
|
21
44
|
constructor(settings, props) {
|
|
22
45
|
super(settings, props);
|
|
23
46
|
this.distanceInternal = 0;
|
|
47
|
+
this.setControl(new adapter_1.BlePowerControl(this, props));
|
|
24
48
|
this.logger = new gd_eventlog_1.EventLogger('BLE-Elite');
|
|
25
49
|
const { id, address, name } = settings;
|
|
26
50
|
const logger = this.logger;
|
package/lib/ble/fm/adapter.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import BleAdapter
|
|
2
|
-
import
|
|
3
|
-
import { DeviceProperties } from '../../types/device';
|
|
1
|
+
import BleAdapter from '../base/adapter';
|
|
2
|
+
import ICyclingMode, { CyclingMode, IncyclistBikeData } from '../../modes/types';
|
|
4
3
|
import { IndoorBikeData } from './types';
|
|
5
4
|
import { DeviceData } from '../../types/data';
|
|
6
|
-
import { BleDeviceSettings, BleStartProperties } from '../types';
|
|
7
|
-
|
|
5
|
+
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from '../types';
|
|
6
|
+
import { ControllableDevice } from '../../base/adpater';
|
|
7
|
+
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
8
|
+
export default class BleFmAdapter extends BleAdapter<ControllableDevice<BleDeviceProperties>> {
|
|
8
9
|
distanceInternal: number;
|
|
9
10
|
connectPromise: Promise<boolean>;
|
|
10
|
-
constructor(settings: BleDeviceSettings, props?:
|
|
11
|
-
isSame(device:
|
|
11
|
+
constructor(settings: BleDeviceSettings, props?: BleDeviceProperties);
|
|
12
|
+
isSame(device: IncyclistDeviceAdapter): boolean;
|
|
12
13
|
getProfile(): string;
|
|
13
14
|
getName(): string;
|
|
14
15
|
getDisplayName(): string;
|
|
15
|
-
getSupportedCyclingModes(): Array<
|
|
16
|
-
getDefaultCyclingMode():
|
|
16
|
+
getSupportedCyclingModes(): Array<typeof CyclingMode>;
|
|
17
|
+
getDefaultCyclingMode(): ICyclingMode;
|
|
17
18
|
mapData(deviceData: IndoorBikeData): IncyclistBikeData;
|
|
18
19
|
transformData(bikeData: IncyclistBikeData): DeviceData;
|
|
19
20
|
start(props?: BleStartProperties): Promise<any>;
|
package/lib/ble/fm/adapter.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14,17 +37,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
38
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
39
|
const power_meter_1 = __importDefault(require("../../modes/power-meter"));
|
|
17
|
-
const
|
|
18
|
-
const
|
|
40
|
+
const antble_smarttrainer_1 = __importDefault(require("../../modes/antble-smarttrainer"));
|
|
41
|
+
const antble_erg_1 = __importDefault(require("../../modes/antble-erg"));
|
|
19
42
|
const comms_1 = __importDefault(require("./comms"));
|
|
20
|
-
const adapter_1 = require("../base/adapter");
|
|
43
|
+
const adapter_1 = __importStar(require("../base/adapter"));
|
|
21
44
|
const consts_1 = require("./consts");
|
|
22
45
|
const utils_1 = require("../../utils/utils");
|
|
23
46
|
const capabilities_1 = require("../../types/capabilities");
|
|
24
|
-
class BleFmAdapter extends adapter_1.
|
|
47
|
+
class BleFmAdapter extends adapter_1.default {
|
|
25
48
|
constructor(settings, props) {
|
|
26
49
|
super(settings, props);
|
|
27
50
|
this.distanceInternal = 0;
|
|
51
|
+
this.setControl(new adapter_1.BlePowerControl(this, props));
|
|
28
52
|
this.logger = new gd_eventlog_1.EventLogger('BLE-FM');
|
|
29
53
|
const { id, address, name } = settings;
|
|
30
54
|
const logger = this.logger;
|
|
@@ -54,22 +78,22 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
54
78
|
const modes = [power_meter_1.default];
|
|
55
79
|
const features = (_a = this.getComms()) === null || _a === void 0 ? void 0 : _a.features;
|
|
56
80
|
if (!features)
|
|
57
|
-
return [power_meter_1.default,
|
|
81
|
+
return [power_meter_1.default, antble_smarttrainer_1.default, antble_erg_1.default];
|
|
58
82
|
if (features.setPower === undefined || features.setPower)
|
|
59
|
-
modes.push(
|
|
83
|
+
modes.push(antble_erg_1.default);
|
|
60
84
|
if (features.setSlope === undefined || features.setSlope)
|
|
61
|
-
modes.push(
|
|
85
|
+
modes.push(antble_smarttrainer_1.default);
|
|
62
86
|
return modes;
|
|
63
87
|
}
|
|
64
88
|
getDefaultCyclingMode() {
|
|
65
89
|
var _a;
|
|
66
90
|
const features = (_a = this.getComms()) === null || _a === void 0 ? void 0 : _a.features;
|
|
67
91
|
if (!features)
|
|
68
|
-
return new
|
|
92
|
+
return new antble_smarttrainer_1.default(this);
|
|
69
93
|
if (features.setSlope === undefined || features.setSlope)
|
|
70
|
-
return new
|
|
94
|
+
return new antble_smarttrainer_1.default(this);
|
|
71
95
|
if (features.setPower === undefined || features.setPower)
|
|
72
|
-
return new
|
|
96
|
+
return new antble_erg_1.default(this);
|
|
73
97
|
return new power_meter_1.default(this);
|
|
74
98
|
}
|
|
75
99
|
mapData(deviceData) {
|
|
@@ -227,6 +251,9 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
227
251
|
}
|
|
228
252
|
}
|
|
229
253
|
catch (err) {
|
|
254
|
+
if (err.message === 'not connected') {
|
|
255
|
+
this.logEvent({ message: 'send bike update failed', reason: 'not connected' });
|
|
256
|
+
}
|
|
230
257
|
this.logEvent({ message: 'error', fn: 'sendUpdate()', request, error: err.message, stack: err.stack });
|
|
231
258
|
}
|
|
232
259
|
});
|
|
@@ -235,7 +262,7 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
235
262
|
return __awaiter(this, void 0, void 0, function* () {
|
|
236
263
|
if (this.started && !this.stopped) {
|
|
237
264
|
try {
|
|
238
|
-
if (this.getCyclingMode() instanceof
|
|
265
|
+
if (this.getCyclingMode() instanceof antble_erg_1.default) {
|
|
239
266
|
const power = this.data.power;
|
|
240
267
|
const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
|
|
241
268
|
yield this.sendUpdate(request, true);
|
package/lib/ble/hr/adapter.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import BleAdapter from '../base/adapter';
|
|
2
2
|
import { DeviceProperties } from '../../types/device';
|
|
3
|
-
import { BleDeviceSettings } from '../types';
|
|
3
|
+
import { BleDeviceProperties, BleDeviceSettings } from '../types';
|
|
4
4
|
import { HrmData } from './types';
|
|
5
5
|
import { DeviceData } from '../../types/data';
|
|
6
|
-
|
|
6
|
+
import { NonControllableDevice } from '../../base/adpater';
|
|
7
|
+
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
8
|
+
export default class HrmAdapter extends BleAdapter<NonControllableDevice<BleDeviceProperties>> {
|
|
7
9
|
ignore: boolean;
|
|
8
10
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
9
|
-
isSame(device:
|
|
11
|
+
isSame(device: IncyclistDeviceAdapter): boolean;
|
|
10
12
|
getProfile(): string;
|
|
11
13
|
getName(): string;
|
|
12
14
|
getDisplayName(): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Controllable } from "../types/adapter";
|
|
1
2
|
import BleAdapter from "./base/adapter";
|
|
2
3
|
import BlePeripheralConnector from "./ble-peripheral";
|
|
3
|
-
import { BleCharacteristic, BlePeripheral } from "./types";
|
|
4
|
+
import { BleCharacteristic, BleDeviceProperties, BlePeripheral } from "./types";
|
|
4
5
|
export interface PeripheralState {
|
|
5
6
|
isLoading: boolean;
|
|
6
7
|
isConfigured: boolean;
|
|
@@ -18,7 +19,7 @@ export interface PeripheralCacheItem {
|
|
|
18
19
|
}
|
|
19
20
|
export default class BlePeripheralCache {
|
|
20
21
|
peripherals: PeripheralCacheItem[];
|
|
21
|
-
findAdapter(adapter: BleAdapter): PeripheralCacheItem;
|
|
22
|
+
findAdapter(adapter: BleAdapter<Controllable<BleDeviceProperties>>): PeripheralCacheItem;
|
|
22
23
|
getConnector(peripheral: BlePeripheral): BlePeripheralConnector;
|
|
23
24
|
getPeripheral(query: {
|
|
24
25
|
id?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BleFmAdapter } from '../fm';
|
|
2
|
-
import BleAdapter from '../base/adapter';
|
|
3
2
|
import { DeviceProperties } from '../../types/device';
|
|
4
3
|
import { BleDeviceSettings, BleStartProperties } from '../types';
|
|
4
|
+
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
5
5
|
export default class BleTacxFEAdapter extends BleFmAdapter {
|
|
6
6
|
constructor(settings: BleDeviceSettings, props?: DeviceProperties);
|
|
7
|
-
isSame(device:
|
|
7
|
+
isSame(device: IncyclistDeviceAdapter): boolean;
|
|
8
8
|
getProfile(): string;
|
|
9
9
|
start(props?: BleStartProperties): Promise<any>;
|
|
10
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BleFmAdapter } from '../fm';
|
|
2
|
-
import BleAdapter from '../base/adapter';
|
|
3
2
|
import { BleDeviceProperties, BleDeviceSettings, BleStartProperties } from '../types';
|
|
3
|
+
import { IncyclistDeviceAdapter } from '../../types/adapter';
|
|
4
4
|
export default class BleWahooAdapter extends BleFmAdapter {
|
|
5
5
|
constructor(settings: BleDeviceSettings, props?: BleDeviceProperties);
|
|
6
|
-
isSame(device:
|
|
6
|
+
isSame(device: IncyclistDeviceAdapter): boolean;
|
|
7
7
|
getProfile(): string;
|
|
8
8
|
start(props?: BleStartProperties): Promise<any>;
|
|
9
9
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { INTERFACE } from './types/device';
|
|
|
2
2
|
import InterfaceFactory from './interfaces';
|
|
3
3
|
import AdapterFactory from './adapters';
|
|
4
4
|
import { IncyclistInterface, InterfaceProps } from './types/interface';
|
|
5
|
-
import { IncyclistDeviceAdapter,
|
|
5
|
+
import { IncyclistDeviceAdapter, Controllable } from './types/adapter';
|
|
6
6
|
import { ControllableDevice as ControllableDeviceAdapter } from './base/adpater';
|
|
7
7
|
import { IncyclistCapability } from './types/capabilities';
|
|
8
8
|
import { DeviceData } from './types/data';
|
|
9
|
-
import { DeviceSettings } from './types/device';
|
|
10
|
-
import
|
|
9
|
+
import { DeviceSettings, DeviceProperties } from './types/device';
|
|
10
|
+
import ICyclingMode from './modes/types';
|
|
11
11
|
import calc from './utils/calculations';
|
|
12
|
-
export * from './modes/
|
|
12
|
+
export * from './modes/types';
|
|
13
13
|
export * from './serial';
|
|
14
14
|
export * from './ble';
|
|
15
15
|
export * from './antv2';
|
|
16
|
-
export { IncyclistInterface, INTERFACE, InterfaceFactory, InterfaceProps, DeviceSettings,
|
|
16
|
+
export { IncyclistInterface, INTERFACE, InterfaceFactory, InterfaceProps, DeviceSettings, DeviceProperties, ICyclingMode, AdapterFactory, IncyclistDeviceAdapter, Controllable, ControllableDeviceAdapter, DeviceData, IncyclistCapability, calc, };
|
package/lib/index.js
CHANGED
|
@@ -17,20 +17,22 @@ 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.ControllableDeviceAdapter = exports.AdapterFactory = exports.InterfaceFactory = exports.INTERFACE = void 0;
|
|
20
|
+
exports.calc = exports.IncyclistCapability = exports.ControllableDeviceAdapter = exports.Controllable = exports.AdapterFactory = exports.InterfaceFactory = exports.INTERFACE = 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
23
|
const interfaces_1 = __importDefault(require("./interfaces"));
|
|
24
24
|
exports.InterfaceFactory = interfaces_1.default;
|
|
25
25
|
const adapters_1 = __importDefault(require("./adapters"));
|
|
26
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; } });
|
|
27
29
|
const adpater_1 = require("./base/adpater");
|
|
28
30
|
Object.defineProperty(exports, "ControllableDeviceAdapter", { enumerable: true, get: function () { return adpater_1.ControllableDevice; } });
|
|
29
31
|
const capabilities_1 = require("./types/capabilities");
|
|
30
32
|
Object.defineProperty(exports, "IncyclistCapability", { enumerable: true, get: function () { return capabilities_1.IncyclistCapability; } });
|
|
31
33
|
const calculations_1 = __importDefault(require("./utils/calculations"));
|
|
32
34
|
exports.calc = calculations_1.default;
|
|
33
|
-
__exportStar(require("./modes/
|
|
35
|
+
__exportStar(require("./modes/types"), exports);
|
|
34
36
|
__exportStar(require("./serial"), exports);
|
|
35
37
|
__exportStar(require("./ble"), exports);
|
|
36
38
|
__exportStar(require("./antv2"), exports);
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { SerialInterface } from "./serial";
|
|
|
3
3
|
import AntInterface from "./antv2/ant-interface";
|
|
4
4
|
import { BleInterface } from "./ble";
|
|
5
5
|
export default class InterfaceFactory {
|
|
6
|
-
static create(ifaceName: string, props?: InterfaceProps):
|
|
6
|
+
static create(ifaceName: string, props?: InterfaceProps): AntInterface | SerialInterface | BleInterface;
|
|
7
7
|
}
|