incyclist-devices 2.0.35 → 2.0.36
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/modes/ant-fe-adv-st-mode.d.ts +2 -2
- package/lib/antv2/modes/ant-fe-erg-mode.d.ts +2 -2
- package/lib/antv2/modes/ant-fe-st-mode.d.ts +2 -2
- package/lib/base/adpater.d.ts +2 -1
- package/lib/base/adpater.js +7 -6
- package/lib/interfaces.d.ts +1 -1
- package/lib/modes/ble-erg-mode.d.ts +2 -2
- package/lib/modes/ble-st-mode.d.ts +2 -2
- package/lib/modes/cycling-mode.d.ts +7 -7
- package/lib/modes/power-base.d.ts +3 -3
- package/lib/modes/power-base.js +3 -2
- package/lib/modes/power-meter.d.ts +2 -2
- package/lib/serial/comms.d.ts +62 -0
- package/lib/serial/comms.js +280 -0
- package/lib/serial/daum/DaumAdapter.d.ts +13 -8
- package/lib/serial/daum/DaumAdapter.js +49 -12
- package/lib/serial/daum/ERGCyclingMode.d.ts +2 -2
- package/lib/serial/daum/ERGCyclingMode.js +1 -1
- package/lib/serial/daum/SmartTrainerCyclingMode.d.ts +3 -2
- package/lib/serial/daum/SmartTrainerCyclingMode.js +10 -5
- package/lib/serial/daum/classic/adapter.d.ts +4 -6
- package/lib/serial/daum/classic/adapter.js +5 -23
- package/lib/serial/daum/classic/comms.d.ts +33 -65
- package/lib/serial/daum/classic/comms.js +148 -332
- package/lib/serial/daum/classic/mock.js +5 -3
- package/lib/serial/daum/classic/modes/daum-classic.d.ts +2 -2
- package/lib/serial/daum/classic/modes/daum-classic.js +1 -1
- package/lib/serial/daum/classic/types.d.ts +59 -0
- package/lib/serial/daum/classic/types.js +2 -0
- package/lib/serial/daum/classic/utils.d.ts +11 -10
- package/lib/serial/daum/classic/utils.js +33 -68
- package/lib/serial/daum/premium/adapter.d.ts +4 -7
- package/lib/serial/daum/premium/adapter.js +7 -30
- package/lib/serial/daum/premium/comms.d.ts +28 -105
- package/lib/serial/daum/premium/comms.js +262 -466
- package/lib/serial/daum/premium/consts.d.ts +6 -0
- package/lib/serial/daum/premium/consts.js +9 -0
- package/lib/serial/daum/premium/mock.d.ts +32 -1
- package/lib/serial/daum/premium/mock.js +131 -8
- package/lib/serial/daum/premium/modes/daum-classic.d.ts +2 -2
- package/lib/serial/daum/premium/modes/daum-classic.js +1 -1
- package/lib/serial/daum/premium/types.d.ts +35 -1
- package/lib/serial/daum/premium/types.js +29 -0
- package/lib/serial/daum/premium/utils.d.ts +11 -18
- package/lib/serial/daum/premium/utils.js +25 -18
- package/lib/serial/serial-interface.js +3 -2
- package/lib/types/adapter.d.ts +2 -0
- package/lib/types/device.d.ts +11 -0
- package/lib/types/route.d.ts +0 -5
- package/lib/types/route.js +0 -7
- package/lib/utils/calculations.js +1 -5
- package/lib/utils/utils.d.ts +2 -1
- package/lib/utils/utils.js +39 -3
- package/package.json +3 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { IncyclistBikeData } from '../../..';
|
|
2
|
+
import { DeviceType } from '../../../types/device';
|
|
1
3
|
export declare const DEFAULT_AGE = 30;
|
|
2
4
|
export declare const DEFAULT_USER_WEIGHT = 75;
|
|
3
5
|
export declare const DEFAULT_BIKE_WEIGHT = 10;
|
|
4
|
-
export declare function getCockpit(c:
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function Float32ToIntArray(float32: any): any[];
|
|
6
|
+
export declare function getCockpit(c: number): "Cardio" | "Fitness" | "Vita De Luxe" | "8008" | "8008 TRS" | "8080" | "Therapie" | "8008 TRS Pro" | "8008 TRS3" | "ergo_lyps Cardio Pro" | "Unknown";
|
|
7
|
+
export declare function getSerialNo(arr: Uint8Array, start: number, length: number): string;
|
|
8
|
+
export declare function getBikeType(type?: DeviceType): number;
|
|
9
|
+
export declare function getGender(sex: any): 0 | 1 | 2;
|
|
10
|
+
export declare function getLength(length?: number): number;
|
|
11
|
+
export declare function getWeight(weight?: number): number;
|
|
12
|
+
export declare function parseRunData(data: any): IncyclistBikeData;
|
|
13
|
+
export declare function between(v: number, min: number, max: number): number;
|
|
14
|
+
export declare function buildSetSlopeCommand(bikeNo: any, slope: any): number[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildSetSlopeCommand = exports.between = exports.parseRunData = exports.getWeight = exports.getLength = exports.getGender = exports.getBikeType = exports.getSerialNo = exports.getCockpit = exports.DEFAULT_BIKE_WEIGHT = exports.DEFAULT_USER_WEIGHT = exports.DEFAULT_AGE = void 0;
|
|
4
4
|
exports.DEFAULT_AGE = 30;
|
|
5
5
|
exports.DEFAULT_USER_WEIGHT = 75;
|
|
6
6
|
exports.DEFAULT_BIKE_WEIGHT = 10;
|
|
@@ -31,18 +31,23 @@ function getCockpit(c) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
exports.getCockpit = getCockpit;
|
|
34
|
+
function getSerialNo(arr, start, length) {
|
|
35
|
+
const buffer = Buffer.from(arr.subarray(start, start + length));
|
|
36
|
+
return buffer.toString('hex');
|
|
37
|
+
}
|
|
38
|
+
exports.getSerialNo = getSerialNo;
|
|
34
39
|
function getBikeType(type) {
|
|
40
|
+
const DAUM_CLASSIC_BT_MOUNTAIN = 1;
|
|
41
|
+
const DAUM_CLASSIC_BT_RACE = 0;
|
|
35
42
|
if (type === undefined)
|
|
36
|
-
return
|
|
43
|
+
return DAUM_CLASSIC_BT_RACE;
|
|
37
44
|
switch (type) {
|
|
38
|
-
case
|
|
39
|
-
return
|
|
40
|
-
case
|
|
41
|
-
return
|
|
42
|
-
case
|
|
43
|
-
return
|
|
44
|
-
default:
|
|
45
|
-
return 1;
|
|
45
|
+
case 'triathlon':
|
|
46
|
+
return DAUM_CLASSIC_BT_RACE;
|
|
47
|
+
case 'race':
|
|
48
|
+
return DAUM_CLASSIC_BT_RACE;
|
|
49
|
+
case 'mountain':
|
|
50
|
+
return DAUM_CLASSIC_BT_MOUNTAIN;
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
exports.getBikeType = getBikeType;
|
|
@@ -51,7 +56,7 @@ function getGender(sex) {
|
|
|
51
56
|
return 2;
|
|
52
57
|
switch (sex) {
|
|
53
58
|
case "M":
|
|
54
|
-
return
|
|
59
|
+
return 0;
|
|
55
60
|
case "F":
|
|
56
61
|
return 1;
|
|
57
62
|
default:
|
|
@@ -62,82 +67,42 @@ exports.getGender = getGender;
|
|
|
62
67
|
function getLength(length) {
|
|
63
68
|
if (length === undefined || length === null)
|
|
64
69
|
return 180;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return 100;
|
|
68
|
-
if (l > 220)
|
|
69
|
-
return 220;
|
|
70
|
-
return l;
|
|
70
|
+
const l = Math.round(length);
|
|
71
|
+
return between(l, 100, 220);
|
|
71
72
|
}
|
|
72
73
|
exports.getLength = getLength;
|
|
73
74
|
function getWeight(weight) {
|
|
74
75
|
if (weight === undefined || weight === null)
|
|
75
76
|
return 80;
|
|
76
77
|
let m = Math.round(weight);
|
|
77
|
-
|
|
78
|
-
return 80;
|
|
79
|
-
if (m < 10)
|
|
80
|
-
return 10;
|
|
81
|
-
if (m > 250)
|
|
82
|
-
return 250;
|
|
83
|
-
return m;
|
|
78
|
+
return between(m, 10, 250);
|
|
84
79
|
}
|
|
85
80
|
exports.getWeight = getWeight;
|
|
86
81
|
function parseRunData(data) {
|
|
87
82
|
const bikeData = {};
|
|
88
83
|
bikeData.isPedalling = (data[4] > 0);
|
|
89
84
|
bikeData.power = data[5] * 5;
|
|
90
|
-
bikeData.
|
|
85
|
+
bikeData.pedalRpm = data[6];
|
|
91
86
|
bikeData.speed = data[7];
|
|
92
87
|
bikeData.heartrate = data[14];
|
|
93
|
-
bikeData.distance = (data[9] * 256 + data[8]) / 10;
|
|
94
88
|
bikeData.distanceInternal = (data[9] * 256 + data[8]) * 100;
|
|
95
89
|
bikeData.time = (data[11] * 256 + data[10]);
|
|
96
90
|
bikeData.gear = data[16];
|
|
97
91
|
return bikeData;
|
|
98
92
|
}
|
|
99
93
|
exports.parseRunData = parseRunData;
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
function between(v, min, max) {
|
|
95
|
+
if (v < min)
|
|
96
|
+
return min;
|
|
97
|
+
if (v > max)
|
|
98
|
+
return max;
|
|
99
|
+
return v;
|
|
105
100
|
}
|
|
106
|
-
exports.
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
len = arr.length;
|
|
113
|
-
}
|
|
114
|
-
if (len - start > arr.length) {
|
|
115
|
-
len = arr.length - start;
|
|
116
|
-
}
|
|
117
|
-
var j = start;
|
|
118
|
-
for (var i = 0; i < len; i++) {
|
|
119
|
-
var hex = Math.abs(arr[j++]).toString(16);
|
|
120
|
-
if (i !== 0)
|
|
121
|
-
str += " ";
|
|
122
|
-
str += hex;
|
|
123
|
-
}
|
|
124
|
-
return str;
|
|
125
|
-
}
|
|
126
|
-
exports.hexstr = hexstr;
|
|
127
|
-
function Float32ToHex(float32) {
|
|
128
|
-
function getHex(i) { return ('00' + i.toString(16)).slice(-2).toUpperCase(); }
|
|
129
|
-
var view = new DataView(new ArrayBuffer(4));
|
|
130
|
-
view.setFloat32(0, float32);
|
|
131
|
-
return Array.apply(null, { length: 4 }).map((_, i) => getHex(view.getUint8(i))).join('');
|
|
132
|
-
}
|
|
133
|
-
exports.Float32ToHex = Float32ToHex;
|
|
134
|
-
function Float32ToIntArray(float32) {
|
|
135
|
-
var view = new DataView(new ArrayBuffer(4));
|
|
136
|
-
view.setFloat32(0, float32);
|
|
137
|
-
var arr = [];
|
|
138
|
-
for (let i = 0; i < 4; i++) {
|
|
139
|
-
arr.push(view.getUint8(i));
|
|
140
|
-
}
|
|
141
|
-
return arr;
|
|
101
|
+
exports.between = between;
|
|
102
|
+
function buildSetSlopeCommand(bikeNo, slope) {
|
|
103
|
+
const buffer = Buffer.from([0x55, bikeNo, 0, 0, 0, 0]);
|
|
104
|
+
buffer.writeFloatLE(slope, 2);
|
|
105
|
+
const cmd = Array.from(buffer);
|
|
106
|
+
return cmd;
|
|
142
107
|
}
|
|
143
|
-
exports.
|
|
108
|
+
exports.buildSetSlopeCommand = buildSetSlopeCommand;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { DeviceProperties } from '../../../types/device';
|
|
2
1
|
import { SerialInterface } from '../..';
|
|
3
2
|
import { SerialDeviceSettings } from '../../adapter';
|
|
4
3
|
import { SerialCommProps } from '../../comm';
|
|
5
4
|
import DaumAdapter from '../DaumAdapter';
|
|
6
5
|
import { Daum8iDeviceProperties } from './types';
|
|
7
|
-
|
|
6
|
+
import { IncyclistBikeData } from '../../..';
|
|
7
|
+
export default class DaumPremiumAdapter extends DaumAdapter<SerialDeviceSettings, Daum8iDeviceProperties> {
|
|
8
8
|
static NAME: string;
|
|
9
9
|
commProps: SerialCommProps;
|
|
10
10
|
_startRetryTimeout: number;
|
|
11
|
-
constructor(settings: SerialDeviceSettings, props?:
|
|
12
|
-
logEvent(event: any): void;
|
|
11
|
+
constructor(settings: SerialDeviceSettings, props?: Daum8iDeviceProperties);
|
|
13
12
|
getName(): string;
|
|
14
13
|
getUniqueName(): string;
|
|
15
14
|
getPort(): any;
|
|
@@ -19,10 +18,8 @@ export default class DaumPremiumAdapter extends DaumAdapter {
|
|
|
19
18
|
isEqual(settings: SerialDeviceSettings): boolean;
|
|
20
19
|
getSupportedCyclingModes(): Array<any>;
|
|
21
20
|
check(): Promise<boolean>;
|
|
22
|
-
pause(): Promise<boolean>;
|
|
23
|
-
resume(): Promise<boolean>;
|
|
24
21
|
startRide(props?: Daum8iDeviceProperties): Promise<boolean>;
|
|
25
22
|
start(props?: Daum8iDeviceProperties): Promise<boolean>;
|
|
26
23
|
launch(props?: Daum8iDeviceProperties, isRelaunch?: boolean): Promise<boolean>;
|
|
27
|
-
getCurrentBikeData(): Promise<
|
|
24
|
+
getCurrentBikeData(): Promise<IncyclistBikeData>;
|
|
28
25
|
}
|
|
@@ -60,15 +60,6 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
60
60
|
this.distanceInternal = undefined;
|
|
61
61
|
this.initData();
|
|
62
62
|
}
|
|
63
|
-
logEvent(event) {
|
|
64
|
-
if (this.logger) {
|
|
65
|
-
this.logger.logEvent(event);
|
|
66
|
-
}
|
|
67
|
-
const w = global.window;
|
|
68
|
-
if ((w === null || w === void 0 ? void 0 : w.DEVICE_DEBUG) || process.env.BLE_DEBUG) {
|
|
69
|
-
console.log('~~~ DaumPremium', event);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
63
|
getName() {
|
|
73
64
|
return 'Daum8i';
|
|
74
65
|
}
|
|
@@ -136,26 +127,6 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
136
127
|
}));
|
|
137
128
|
});
|
|
138
129
|
}
|
|
139
|
-
pause() {
|
|
140
|
-
const _super = Object.create(null, {
|
|
141
|
-
pause: { get: () => super.pause }
|
|
142
|
-
});
|
|
143
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
const paused = yield _super.pause.call(this);
|
|
145
|
-
this.bike.pauseLogging();
|
|
146
|
-
return paused;
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
resume() {
|
|
150
|
-
const _super = Object.create(null, {
|
|
151
|
-
resume: { get: () => super.resume }
|
|
152
|
-
});
|
|
153
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
const resumed = yield _super.resume.call(this);
|
|
155
|
-
this.bike.resumeLogging();
|
|
156
|
-
return resumed;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
130
|
startRide(props = {}) {
|
|
160
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
132
|
this.logEvent({ message: 'relaunch of device' });
|
|
@@ -193,7 +164,9 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
193
164
|
yield this.stop();
|
|
194
165
|
return (0, utils_1.runWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
195
166
|
try {
|
|
196
|
-
yield this.connect();
|
|
167
|
+
const connected = yield this.connect();
|
|
168
|
+
if (!connected)
|
|
169
|
+
throw new Error('not connected');
|
|
197
170
|
if (!info.deviceType) {
|
|
198
171
|
info.deviceType = yield this.bike.getDeviceType();
|
|
199
172
|
}
|
|
@@ -224,6 +197,10 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
|
|
|
224
197
|
return;
|
|
225
198
|
}
|
|
226
199
|
catch (err) {
|
|
200
|
+
if (!info.deviceType) {
|
|
201
|
+
yield (0, utils_1.sleep)(500);
|
|
202
|
+
yield this.reconnect();
|
|
203
|
+
}
|
|
227
204
|
throw (new Error(`could not start device, reason:${err.message}`));
|
|
228
205
|
}
|
|
229
206
|
}), 5, this._startRetryTimeout)
|
|
@@ -1,123 +1,46 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ReservedCommands } from './utils';
|
|
3
|
-
import { SerialInterface, SerialPortProvider } from '../..';
|
|
4
|
-
import { EventLogger } from 'gd-eventlog';
|
|
5
3
|
import { User } from "../../../types/user";
|
|
6
4
|
import { Route } from "../../../types/route";
|
|
7
|
-
import { SerialCommProps } from "../../comm";
|
|
8
|
-
import { SerialPortStream } from "@serialport/stream";
|
|
9
5
|
import { OnDeviceStartCallback } from "./types";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
partialCmd?: any;
|
|
22
|
-
data: Queue<ResponseObject>;
|
|
23
|
-
};
|
|
24
|
-
export type ConnectionState = 'Connecting' | 'Connected' | 'Disconnected' | 'Disconnecting';
|
|
25
|
-
export declare class CheckSumError extends Error {
|
|
26
|
-
constructor();
|
|
27
|
-
}
|
|
28
|
-
export declare class ACKTimeout extends Error {
|
|
29
|
-
constructor();
|
|
30
|
-
}
|
|
31
|
-
export declare class BusyTimeout extends Error {
|
|
32
|
-
constructor();
|
|
33
|
-
}
|
|
34
|
-
export declare class ResponseTimeout extends Error {
|
|
35
|
-
constructor();
|
|
36
|
-
}
|
|
37
|
-
export default class Daum8i {
|
|
38
|
-
logger: EventLogger;
|
|
39
|
-
serial: SerialInterface;
|
|
40
|
-
path: string;
|
|
41
|
-
tcpipConnection: {
|
|
42
|
-
host: string;
|
|
43
|
-
port: string;
|
|
44
|
-
};
|
|
45
|
-
port: string;
|
|
46
|
-
settings: any;
|
|
47
|
-
props: any;
|
|
48
|
-
protected sp: SerialPortStream;
|
|
49
|
-
protected connectState: ConnectionState;
|
|
50
|
-
protected connectPromise: Promise<SerialPortStream>;
|
|
51
|
-
protected disconnectPromise: Promise<boolean>;
|
|
52
|
-
protected writePromise: Promise<void>;
|
|
53
|
-
protected sendCmdPromise: Promise<string>;
|
|
54
|
-
protected actualBikeType?: string;
|
|
55
|
-
protected recvState: Daum8iCommsState;
|
|
56
|
-
bikeData: any;
|
|
57
|
-
isLoggingPaused: boolean;
|
|
58
|
-
spp: SerialPortProvider;
|
|
59
|
-
serialportProps: any;
|
|
60
|
-
constructor(props: SerialCommProps);
|
|
61
|
-
getInterface(): string;
|
|
62
|
-
getPort(): string;
|
|
63
|
-
isConnected(): boolean;
|
|
64
|
-
pauseLogging(): void;
|
|
65
|
-
resumeLogging(): void;
|
|
66
|
-
logEvent(e: any): void;
|
|
67
|
-
connect(): Promise<boolean>;
|
|
68
|
-
closePort(): Promise<boolean>;
|
|
69
|
-
cleanupPort(): void;
|
|
70
|
-
close(): Promise<boolean>;
|
|
71
|
-
flush(): Promise<void>;
|
|
72
|
-
onPortClose(): Promise<void>;
|
|
73
|
-
onPortError(error: Error): Promise<void>;
|
|
74
|
-
isSending(): boolean;
|
|
75
|
-
rejectCurrent(error: Error): void;
|
|
76
|
-
getTimeoutValue(cmd?: any): number;
|
|
6
|
+
import SerialPortComms from "../../comms";
|
|
7
|
+
import { DaumPremiumCommsState, DaumPremiumRequest, ResponseObject } from "./types";
|
|
8
|
+
import { IncyclistBikeData } from "../../..";
|
|
9
|
+
export default class Daum8i extends SerialPortComms<DaumPremiumCommsState, DaumPremiumRequest, ResponseObject> {
|
|
10
|
+
validatePath(path: string): string;
|
|
11
|
+
getDefaultLoggerName(): string;
|
|
12
|
+
getAckTimeoutValue(): number;
|
|
13
|
+
getTimeoutValue(): number;
|
|
14
|
+
onConnected(): void;
|
|
15
|
+
getInitialCommsState(): DaumPremiumCommsState;
|
|
16
|
+
setState(ack: boolean, start: boolean, end: boolean): void;
|
|
77
17
|
onData(data: any, depth?: number): any;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
onACK(): void;
|
|
82
|
-
onNAK: () => void;
|
|
18
|
+
send(request: DaumPremiumRequest): Promise<ResponseObject>;
|
|
19
|
+
sendStrCommand(logString: string, command: string, payload?: string | Uint8Array): Promise<string>;
|
|
20
|
+
sendBinaryCommand(logString: string, command: string, payload?: string | Uint8Array): Promise<string>;
|
|
83
21
|
waitForACK(): Promise<boolean>;
|
|
84
|
-
waitForResponse(): Promise<
|
|
85
|
-
portWrite(buffer: Buffer): Promise<void>;
|
|
22
|
+
waitForResponse(): Promise<ResponseObject>;
|
|
86
23
|
write(buffer: Buffer, ackExpected?: boolean): Promise<void>;
|
|
87
|
-
sendACK(): Promise<void>;
|
|
88
|
-
sendNAK(): Promise<void>;
|
|
89
|
-
sendReservedDaum8iCommand(command: ReservedCommands, data?: Buffer): Promise<any[]>;
|
|
24
|
+
sendACK(logPayload: any): Promise<void>;
|
|
25
|
+
sendNAK(logPayload: any): Promise<void>;
|
|
90
26
|
getProtocolVersion(): Promise<string>;
|
|
91
27
|
getDashboardVersion(): Promise<string>;
|
|
92
|
-
getDeviceType(): Promise<
|
|
93
|
-
getActualBikeType(): Promise<
|
|
94
|
-
setActualBikeType(actualBikeType: any): Promise<
|
|
95
|
-
getTrainingData(): Promise<
|
|
96
|
-
|
|
97
|
-
heartrate: number;
|
|
98
|
-
speed: number;
|
|
99
|
-
slope: number;
|
|
100
|
-
distanceInternal: number;
|
|
101
|
-
cadence: number;
|
|
102
|
-
power: number;
|
|
103
|
-
physEnergy: number;
|
|
104
|
-
realEnergy: number;
|
|
105
|
-
torque: number;
|
|
106
|
-
gear: number;
|
|
107
|
-
deviceState: number;
|
|
108
|
-
speedStatus: string;
|
|
109
|
-
}>;
|
|
110
|
-
setLoadControl(enabled: any): Promise<boolean>;
|
|
28
|
+
getDeviceType(): Promise<string>;
|
|
29
|
+
getActualBikeType(): Promise<string>;
|
|
30
|
+
setActualBikeType(actualBikeType: any): Promise<string>;
|
|
31
|
+
getTrainingData(): Promise<IncyclistBikeData>;
|
|
32
|
+
setLoadControl(enabled: boolean): Promise<boolean>;
|
|
111
33
|
getLoadControl(): Promise<boolean>;
|
|
112
|
-
setPower(power:
|
|
113
|
-
getPower(
|
|
34
|
+
setPower(power: number | string): Promise<number>;
|
|
35
|
+
getPower(): Promise<number>;
|
|
36
|
+
setGear(gear: number): Promise<number>;
|
|
37
|
+
getGear(): Promise<number>;
|
|
38
|
+
sendReservedDaum8iCommand(logString: string, command: ReservedCommands, data?: Buffer): Promise<Uint8Array>;
|
|
114
39
|
setPerson(person: User): Promise<boolean>;
|
|
115
40
|
programUploadInit(): Promise<boolean>;
|
|
116
41
|
programUploadStart(bikeType: string, route?: Route): Promise<Uint8Array>;
|
|
117
42
|
programUploadSendBlock(epp: Uint8Array, offset: number): Promise<boolean>;
|
|
118
43
|
programUploadDone(): Promise<boolean>;
|
|
119
|
-
programUpload(bikeType: string, route: Route, onStatusUpdate?: OnDeviceStartCallback): Promise<boolean>;
|
|
120
44
|
startProgram(programId?: number): Promise<boolean>;
|
|
121
|
-
|
|
122
|
-
getGear(): Promise<number>;
|
|
45
|
+
programUpload(bikeType: string, route: Route, onStatusUpdate?: OnDeviceStartCallback): Promise<boolean>;
|
|
123
46
|
}
|