incyclist-devices 1.4.12 → 1.4.15
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/CyclingMode.js +1 -0
- package/lib/Device.js +1 -0
- package/lib/DeviceProtocol.js +1 -0
- package/lib/DeviceSupport.d.ts +1 -1
- package/lib/DeviceSupport.js +23 -10
- package/lib/ant/AntAdapter.js +1 -0
- package/lib/ant/AntScanner.js +20 -7
- package/lib/ant/antfe/AntFEAdapter.js +7 -7
- package/lib/ant/anthrm/AntHrmAdapter.js +1 -1
- package/lib/ant/utils.js +3 -1
- package/lib/calculations.js +1 -0
- package/lib/daum/DaumAdapter.js +25 -13
- package/lib/daum/SmartTrainerCyclingMode.js +1 -0
- package/lib/daum/classic/DaumClassicAdapter.js +1 -1
- package/lib/daum/classic/DaumClassicProtocol.js +19 -7
- package/lib/daum/classic/bike.js +26 -26
- package/lib/daum/classic/utils.js +1 -0
- package/lib/daum/constants.js +1 -0
- package/lib/daum/premium/DaumPremiumAdapter.js +1 -1
- package/lib/daum/premium/DaumPremiumProtocol.js +19 -7
- package/lib/daum/premium/bike.js +18 -17
- package/lib/daum/premium/utils.js +1 -0
- package/lib/kettler/comms.d.ts +12 -2
- package/lib/kettler/comms.js +35 -13
- package/lib/kettler/ergo-racer/adapter.d.ts +5 -2
- package/lib/kettler/ergo-racer/adapter.js +124 -148
- package/lib/kettler/ergo-racer/protocol.d.ts +1 -1
- package/lib/kettler/ergo-racer/protocol.js +20 -8
- package/lib/simulator/Simulator.js +15 -2
- package/lib/types/route.js +1 -0
- package/lib/types/user.js +1 -0
- package/lib/utils.js +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
22
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
23
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,13 +27,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
28
|
});
|
|
10
29
|
};
|
|
11
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
12
|
-
if (mod && mod.__esModule) return mod;
|
|
13
|
-
var result = {};
|
|
14
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
15
|
-
result["default"] = mod;
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
32
|
};
|
|
@@ -61,6 +73,12 @@ class KettlerRacerAdapter extends Device_1.default {
|
|
|
61
73
|
setIgnoreBike(ignore) {
|
|
62
74
|
this.ignoreBike = ignore;
|
|
63
75
|
}
|
|
76
|
+
_getComms() {
|
|
77
|
+
return this.comms;
|
|
78
|
+
}
|
|
79
|
+
_setComms(comms) {
|
|
80
|
+
this.comms = comms;
|
|
81
|
+
}
|
|
64
82
|
getLogger() {
|
|
65
83
|
return this.logger;
|
|
66
84
|
}
|
|
@@ -79,113 +97,117 @@ class KettlerRacerAdapter extends Device_1.default {
|
|
|
79
97
|
return bikeWeight + userWeight;
|
|
80
98
|
}
|
|
81
99
|
setComputerMode() {
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
100
|
+
return this.send('setComputerMode', 'CP').then(response => {
|
|
101
|
+
this.logger.logEvent({ response });
|
|
102
|
+
if (response === 'ACK' || response === 'RUN') {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
91
108
|
});
|
|
92
109
|
}
|
|
93
110
|
setClientMode() {
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
111
|
+
return this.send('setClientMode', 'CM').then(response => {
|
|
112
|
+
this.logger.logEvent({ response });
|
|
113
|
+
if (response === 'ACK' || response === 'RUN') {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
103
119
|
});
|
|
104
120
|
}
|
|
105
121
|
reset() {
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
122
|
+
return this.send('reset', 'RS').then(response => {
|
|
123
|
+
this.logger.logEvent({ response });
|
|
124
|
+
if (response === 'ACK' || response === 'RUN') {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
115
130
|
});
|
|
116
131
|
}
|
|
117
132
|
getIdentifier() {
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
133
|
+
return this.send('getIdentifier', 'ID').then(response => {
|
|
134
|
+
this.logger.logEvent({ response });
|
|
135
|
+
return response.substring(0, 3);
|
|
122
136
|
});
|
|
123
137
|
}
|
|
124
138
|
getInterface() {
|
|
125
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
|
|
140
|
+
const res = yield this.send('getInterface', 'KI');
|
|
141
|
+
this.logger.logEvent({ interface: res });
|
|
142
|
+
return res;
|
|
127
143
|
});
|
|
128
144
|
}
|
|
129
145
|
getVersion() {
|
|
130
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
|
|
147
|
+
const res = yield this.send('getVersion', 'VE');
|
|
148
|
+
this.logger.logEvent({ version: res });
|
|
149
|
+
return res;
|
|
132
150
|
});
|
|
133
151
|
}
|
|
134
152
|
getCalibration() {
|
|
135
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
-
return this.send('getCalibration', 'CA');
|
|
154
|
+
return yield this.send('getCalibration', 'CA');
|
|
137
155
|
});
|
|
138
156
|
}
|
|
139
157
|
startTraining() {
|
|
140
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
return this.send('startTraining', 'LB');
|
|
159
|
+
return yield this.send('startTraining', 'LB');
|
|
142
160
|
});
|
|
143
161
|
}
|
|
144
162
|
unknownSN() {
|
|
145
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
return this.send('SN', 'SN');
|
|
164
|
+
return yield this.send('SN', 'SN');
|
|
147
165
|
});
|
|
148
166
|
}
|
|
149
167
|
setBaudrate(baudrate) {
|
|
150
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
return this.send(`setBaudrate(${baudrate})`, `BR${baudrate}`);
|
|
169
|
+
return yield this.send(`setBaudrate(${baudrate})`, `BR${baudrate}`);
|
|
152
170
|
});
|
|
153
171
|
}
|
|
154
172
|
setPower(power) {
|
|
155
173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
-
return this.send(`setPower(${power})`, `PW${power}`)
|
|
174
|
+
return this.send(`setPower(${power})`, `PW${power}`).then(response => {
|
|
175
|
+
const data = this.parseStatus(response);
|
|
176
|
+
return data;
|
|
177
|
+
});
|
|
157
178
|
});
|
|
158
179
|
}
|
|
159
180
|
getExtendedStatus() {
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return data;
|
|
164
|
-
});
|
|
181
|
+
return this.send('getExtendedStatus', 'ES1').then(response => {
|
|
182
|
+
const data = this.parseExtendedStatus(response);
|
|
183
|
+
return data;
|
|
165
184
|
});
|
|
166
185
|
}
|
|
167
186
|
getStatus() {
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return data;
|
|
172
|
-
});
|
|
187
|
+
return this.send('getStatus', 'ST').then(response => {
|
|
188
|
+
const data = this.parseStatus(response);
|
|
189
|
+
return data;
|
|
173
190
|
});
|
|
174
191
|
}
|
|
175
192
|
getDB() {
|
|
176
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
-
return this.send('getDB', 'DB');
|
|
194
|
+
return yield this.send('getDB', 'DB');
|
|
178
195
|
});
|
|
179
196
|
}
|
|
180
197
|
send(logStr, message, timeout) {
|
|
181
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
try {
|
|
201
|
+
const opened = yield this.waitForOpened();
|
|
202
|
+
if (!opened) {
|
|
203
|
+
reject(new Error('connection error'));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
reject(err);
|
|
208
|
+
}
|
|
209
|
+
this.comms.send({ logStr, message, onResponse: resolve, onError: reject, timeout });
|
|
210
|
+
}));
|
|
189
211
|
});
|
|
190
212
|
}
|
|
191
213
|
parseExtendedStatus(data) {
|
|
@@ -244,94 +266,29 @@ class KettlerRacerAdapter extends Device_1.default {
|
|
|
244
266
|
try {
|
|
245
267
|
if (!info.opened)
|
|
246
268
|
info.opened = yield this.waitForOpened();
|
|
247
|
-
iv = setTimeout(() =>
|
|
269
|
+
iv = setTimeout(() => {
|
|
270
|
+
this.logger.logEvent({ message: "check() timeout", port: this.getPort() });
|
|
248
271
|
reject(new Error(`timeout`));
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
yield this.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
yield this.
|
|
256
|
-
}
|
|
257
|
-
catch (e) { }
|
|
258
|
-
try {
|
|
259
|
-
yield this.getIdentifier();
|
|
260
|
-
}
|
|
261
|
-
catch (e) { }
|
|
262
|
-
try {
|
|
263
|
-
yield this.getExtendedStatus();
|
|
264
|
-
}
|
|
265
|
-
catch (e) { }
|
|
266
|
-
try {
|
|
267
|
-
yield this.getStatus();
|
|
268
|
-
}
|
|
269
|
-
catch (e) { }
|
|
270
|
-
try {
|
|
271
|
-
yield this.setClientMode();
|
|
272
|
-
}
|
|
273
|
-
catch (e) { }
|
|
274
|
-
try {
|
|
275
|
-
yield this.getVersion();
|
|
276
|
-
}
|
|
277
|
-
catch (e) { }
|
|
278
|
-
try {
|
|
279
|
-
yield this.getInterface();
|
|
280
|
-
}
|
|
281
|
-
catch (e) { }
|
|
282
|
-
try {
|
|
283
|
-
yield this.getIdentifier();
|
|
284
|
-
}
|
|
285
|
-
catch (e) { }
|
|
286
|
-
try {
|
|
287
|
-
yield this.getExtendedStatus();
|
|
288
|
-
}
|
|
289
|
-
catch (e) { }
|
|
290
|
-
try {
|
|
291
|
-
yield this.getStatus();
|
|
292
|
-
}
|
|
293
|
-
catch (e) { }
|
|
294
|
-
try {
|
|
295
|
-
yield this.setPower(100);
|
|
296
|
-
}
|
|
297
|
-
catch (e) { }
|
|
298
|
-
try {
|
|
299
|
-
yield this.reset();
|
|
300
|
-
}
|
|
301
|
-
catch (e) { }
|
|
302
|
-
try {
|
|
303
|
-
yield this.setComputerMode();
|
|
304
|
-
}
|
|
305
|
-
catch (e) { }
|
|
306
|
-
try {
|
|
307
|
-
yield this.getVersion();
|
|
308
|
-
}
|
|
309
|
-
catch (e) { }
|
|
272
|
+
}, 5000);
|
|
273
|
+
if (!info.pcMode)
|
|
274
|
+
info.pcMode = yield this.setClientMode();
|
|
275
|
+
if (!info.id)
|
|
276
|
+
info.id = yield this.getIdentifier();
|
|
277
|
+
if (!info.version)
|
|
278
|
+
info.version = yield this.getVersion();
|
|
310
279
|
try {
|
|
311
280
|
yield this.getInterface();
|
|
312
281
|
}
|
|
313
|
-
catch (e) {
|
|
314
|
-
|
|
315
|
-
yield this.getIdentifier();
|
|
316
|
-
}
|
|
317
|
-
catch (e) { }
|
|
318
|
-
try {
|
|
319
|
-
yield this.getExtendedStatus();
|
|
320
|
-
}
|
|
321
|
-
catch (e) { }
|
|
322
|
-
try {
|
|
323
|
-
yield this.getStatus();
|
|
324
|
-
}
|
|
325
|
-
catch (e) { }
|
|
326
|
-
try {
|
|
327
|
-
yield this.setPower(100);
|
|
282
|
+
catch (e) {
|
|
283
|
+
this.logger.logEvent({ message: 'Error', error: e.message });
|
|
328
284
|
}
|
|
329
|
-
catch (e) { }
|
|
330
285
|
clearTimeout(iv);
|
|
331
286
|
resolve(info);
|
|
332
287
|
}
|
|
333
288
|
catch (err) {
|
|
334
|
-
|
|
289
|
+
this.logger.logEvent({ message: 'Error', error: err.message });
|
|
290
|
+
if (iv)
|
|
291
|
+
clearTimeout(iv);
|
|
335
292
|
iv = undefined;
|
|
336
293
|
reject(err);
|
|
337
294
|
}
|
|
@@ -340,22 +297,40 @@ class KettlerRacerAdapter extends Device_1.default {
|
|
|
340
297
|
}
|
|
341
298
|
start(props) {
|
|
342
299
|
this.logger.logEvent({ message: 'start()' });
|
|
343
|
-
const opts = props || {};
|
|
344
300
|
var info = {};
|
|
345
|
-
return utils_1.runWithRetries(() => __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
return (0, utils_1.runWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
346
302
|
try {
|
|
347
303
|
if (!info.checkDone) {
|
|
348
304
|
info.checkDone = yield this.check();
|
|
349
305
|
}
|
|
350
|
-
|
|
351
|
-
info.started
|
|
306
|
+
try {
|
|
307
|
+
if (!info.started) {
|
|
308
|
+
info.started = yield this.startTraining();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
catch (e) {
|
|
312
|
+
this.logger.logEvent({ message: 'Error', error: e.message });
|
|
313
|
+
}
|
|
314
|
+
try {
|
|
315
|
+
yield this.setPower(100);
|
|
316
|
+
}
|
|
317
|
+
catch (e) {
|
|
318
|
+
this.logger.logEvent({ message: 'Error', error: e.message });
|
|
352
319
|
}
|
|
353
320
|
if (!info.data) {
|
|
354
|
-
|
|
321
|
+
yield this.update();
|
|
322
|
+
info.data = this.data;
|
|
355
323
|
}
|
|
356
324
|
return info.data;
|
|
357
325
|
}
|
|
358
326
|
catch (err) {
|
|
327
|
+
console.log('~~~ Error', err);
|
|
328
|
+
try {
|
|
329
|
+
yield this.reset();
|
|
330
|
+
}
|
|
331
|
+
catch (e) {
|
|
332
|
+
this.logger.logEvent({ message: 'Error', error: e.message });
|
|
333
|
+
}
|
|
359
334
|
throw (new Error(`could not start device, reason:${err.message}`));
|
|
360
335
|
}
|
|
361
336
|
}), 5, 1000)
|
|
@@ -367,6 +342,7 @@ class KettlerRacerAdapter extends Device_1.default {
|
|
|
367
342
|
startUpdatePull() {
|
|
368
343
|
if (this.iv)
|
|
369
344
|
return;
|
|
345
|
+
this.logger.logEvent({ message: 'start regular device update' });
|
|
370
346
|
if (this.ignoreBike && this.ignoreHrm && this.ignorePower)
|
|
371
347
|
return;
|
|
372
348
|
const ivSync = setInterval(() => {
|
|
@@ -564,7 +540,7 @@ class KettlerRacerAdapter extends Device_1.default {
|
|
|
564
540
|
}));
|
|
565
541
|
}
|
|
566
542
|
waitForOpened() {
|
|
567
|
-
return utils_1.runWithRetries(() => {
|
|
543
|
+
return (0, utils_1.runWithRetries)(() => {
|
|
568
544
|
return new Promise((resolve, reject) => {
|
|
569
545
|
try {
|
|
570
546
|
if (this.comms.isConnected()) {
|
|
@@ -17,7 +17,7 @@ export interface ScanDescription {
|
|
|
17
17
|
state: ScanState;
|
|
18
18
|
props: KettlerRacerScanProps;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export default class KettlerRacerProtocol extends DeviceProtocolBase implements DeviceProtocol {
|
|
21
21
|
private state;
|
|
22
22
|
private logger;
|
|
23
23
|
private activeScans;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
22
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
23
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,13 +27,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
28
|
});
|
|
10
29
|
};
|
|
11
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
12
|
-
if (mod && mod.__esModule) return mod;
|
|
13
|
-
var result = {};
|
|
14
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
15
|
-
result["default"] = mod;
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
32
|
};
|
|
@@ -187,5 +199,5 @@ class KettlerRacerProtocol extends DeviceProtocol_1.default {
|
|
|
187
199
|
return this.state === ScanState.SCANNING;
|
|
188
200
|
}
|
|
189
201
|
}
|
|
190
|
-
exports.
|
|
202
|
+
exports.default = KettlerRacerProtocol;
|
|
191
203
|
DeviceRegistry_1.default.register(new KettlerRacerProtocol());
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
2
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
15
|
if (mod && mod.__esModule) return mod;
|
|
4
16
|
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
6
|
-
result
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
7
19
|
return result;
|
|
8
20
|
};
|
|
9
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
23
|
};
|
|
12
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Simulator = void 0;
|
|
13
26
|
const DeviceProtocol_1 = __importStar(require("../DeviceProtocol"));
|
|
14
27
|
const DeviceRegistry_1 = __importDefault(require("../DeviceRegistry"));
|
|
15
28
|
const Device_1 = __importDefault(require("../Device"));
|
package/lib/types/route.js
CHANGED
package/lib/types/user.js
CHANGED
package/lib/utils.js
CHANGED
|
@@ -9,9 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.sleep =
|
|
12
|
+
exports.Queue = exports.hexstr = exports.intVal = exports.floatVal = exports.runWithRetries = exports.sleep = void 0;
|
|
13
|
+
const sleep = (ms) => {
|
|
13
14
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
14
15
|
};
|
|
16
|
+
exports.sleep = sleep;
|
|
15
17
|
function runWithRetries(fn, maxRetries, timeBetween) {
|
|
16
18
|
return new Promise((resolve, reject) => {
|
|
17
19
|
let retries = 0;
|