incyclist-devices 1.4.42 → 1.4.45

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.
Files changed (47) hide show
  1. package/lib/CyclingMode.js +1 -0
  2. package/lib/Device.js +1 -0
  3. package/lib/DeviceProtocol.js +1 -0
  4. package/lib/DeviceSupport.js +25 -8
  5. package/lib/ant/AntAdapter.js +1 -0
  6. package/lib/ant/AntScanner.js +24 -7
  7. package/lib/ant/antfe/AntFEAdapter.js +7 -7
  8. package/lib/ant/anthrm/AntHrmAdapter.js +1 -1
  9. package/lib/ant/antpwr/pwr-adapter.js +1 -1
  10. package/lib/ant/utils.js +3 -1
  11. package/lib/ble/ble-device.d.ts +10 -3
  12. package/lib/ble/ble-device.js +144 -32
  13. package/lib/ble/ble-interface.d.ts +22 -4
  14. package/lib/ble/ble-interface.js +224 -167
  15. package/lib/ble/ble.d.ts +20 -1
  16. package/lib/ble/ble.js +3 -1
  17. package/lib/ble/fm.d.ts +11 -1
  18. package/lib/ble/fm.js +109 -11
  19. package/lib/ble/hrm.d.ts +0 -1
  20. package/lib/ble/hrm.js +1 -4
  21. package/lib/ble/incyclist-protocol.js +24 -8
  22. package/lib/ble/pwr.d.ts +1 -1
  23. package/lib/ble/pwr.js +14 -4
  24. package/lib/calculations.js +1 -0
  25. package/lib/daum/DaumAdapter.js +29 -13
  26. package/lib/daum/SmartTrainerCyclingMode.js +1 -0
  27. package/lib/daum/classic/DaumClassicAdapter.js +1 -1
  28. package/lib/daum/classic/DaumClassicProtocol.js +23 -7
  29. package/lib/daum/classic/bike.js +26 -26
  30. package/lib/daum/classic/utils.js +1 -0
  31. package/lib/daum/constants.js +1 -0
  32. package/lib/daum/premium/DaumPremiumAdapter.js +1 -1
  33. package/lib/daum/premium/DaumPremiumProtocol.js +23 -7
  34. package/lib/daum/premium/bike.js +18 -17
  35. package/lib/daum/premium/utils.js +1 -0
  36. package/lib/kettler/comms.d.ts +1 -0
  37. package/lib/kettler/comms.js +2 -1
  38. package/lib/kettler/ergo-racer/adapter.js +25 -9
  39. package/lib/kettler/ergo-racer/protocol.d.ts +1 -1
  40. package/lib/kettler/ergo-racer/protocol.js +23 -7
  41. package/lib/modes/power-meter.js +1 -0
  42. package/lib/simulator/Simulator.d.ts +1 -1
  43. package/lib/simulator/Simulator.js +24 -7
  44. package/lib/types/route.js +1 -0
  45. package/lib/types/user.js +1 -0
  46. package/lib/utils.js +3 -1
  47. package/package.json +1 -1
@@ -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) {
@@ -8,13 +31,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
32
  });
10
33
  };
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
34
  var __importDefault = (this && this.__importDefault) || function (mod) {
19
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
20
36
  };
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Daum8iSerial = exports.Daum8iTcp = void 0;
15
16
  const constants_1 = require("../constants");
16
17
  const tcpserial_1 = __importDefault(require("./tcpserial"));
17
18
  const utils_1 = require("./utils");
@@ -407,7 +408,7 @@ class Daum8i {
407
408
  incoming = bufferData;
408
409
  }
409
410
  const response = [...incoming];
410
- this.logger.logEvent({ message: 'sendCommand:RECV', data: utils_1.hexstr(response) });
411
+ this.logger.logEvent({ message: 'sendCommand:RECV', data: (0, utils_1.hexstr)(response) });
411
412
  for (let i = 0; i < incoming.length; i++) {
412
413
  const getRemaining = () => {
413
414
  let remaining = '';
@@ -440,11 +441,11 @@ class Daum8i {
440
441
  }
441
442
  else if (c === 0x17) {
442
443
  const remaining = getRemaining();
443
- this.logger.logEvent({ message: "sendCommand:received:", duration: Date.now() - this.state.sending.tsRequest, port: portName, cmd: `${cmd} [${utils_1.hexstr(cmd)}]`, remaining: utils_1.hexstr(remaining) });
444
+ this.logger.logEvent({ message: "sendCommand:received:", duration: Date.now() - this.state.sending.tsRequest, port: portName, cmd: `${cmd} [${(0, utils_1.hexstr)(cmd)}]`, remaining: (0, utils_1.hexstr)(remaining) });
444
445
  this.state.waitingForEnd = false;
445
446
  const cmdStr = cmd.substring(0, cmd.length - 2);
446
447
  const checksumExtracted = cmd.slice(-2);
447
- const checksumCalculated = utils_1.checkSum(utils_1.getAsciiArrayFromStr(cmdStr), []);
448
+ const checksumCalculated = (0, utils_1.checkSum)((0, utils_1.getAsciiArrayFromStr)(cmdStr), []);
448
449
  if (checksumExtracted === checksumCalculated) {
449
450
  this.sendACK();
450
451
  if (this.state.sending && this.state.sending.responseCheckIv) {
@@ -486,8 +487,8 @@ class Daum8i {
486
487
  this.state.busy = true;
487
488
  }
488
489
  else {
489
- const message = utils_1.buildMessage(command, payload);
490
- this.logger.logEvent({ message: 'sendCommand:waiting', port: this.portName, cmd: command, hex: utils_1.hexstr(message) });
490
+ const message = (0, utils_1.buildMessage)(command, payload);
491
+ this.logger.logEvent({ message: 'sendCommand:waiting', port: this.portName, cmd: command, hex: (0, utils_1.hexstr)(message) });
491
492
  const busyWait = () => {
492
493
  return new Promise((done) => {
493
494
  let start = Date.now();
@@ -508,7 +509,7 @@ class Daum8i {
508
509
  };
509
510
  const res = yield busyWait();
510
511
  if (!res) {
511
- this.logger.logEvent({ message: 'sendCommand:busy timeout', port: this.portName, cmd: command, hex: utils_1.hexstr(message), duration: Date.now() - tsRequest });
512
+ this.logger.logEvent({ message: 'sendCommand:busy timeout', port: this.portName, cmd: command, hex: (0, utils_1.hexstr)(message), duration: Date.now() - tsRequest });
512
513
  return reject(new Error('BUSY timeout'));
513
514
  }
514
515
  this.state.busy = true;
@@ -526,10 +527,10 @@ class Daum8i {
526
527
  const portName = this.portName;
527
528
  this.state.received = [];
528
529
  try {
529
- const message = utils_1.buildMessage(command, payload);
530
+ const message = (0, utils_1.buildMessage)(command, payload);
530
531
  const start = Date.now();
531
532
  const timeout = start + this.getTimeoutValue();
532
- this.logger.logEvent({ message: "sendCommand:sending:", port: this.portName, cmd: command, hex: utils_1.hexstr(message) });
533
+ this.logger.logEvent({ message: "sendCommand:sending:", port: this.portName, cmd: command, hex: (0, utils_1.hexstr)(message) });
533
534
  this.state.writeBusy = true;
534
535
  if (!this.connected || port === undefined) {
535
536
  this.logger.logEvent({ message: "sendCommand:error: not connected", port: this.portName });
@@ -589,10 +590,10 @@ class Daum8i {
589
590
  buffer.writeUInt16LE(0, 2);
590
591
  }
591
592
  const cmdData = Uint8Array.from(buffer);
592
- return this.sendDaum8iCommand('M70', cmdType, utils_1.bin2esc(cmdData))
593
+ return this.sendDaum8iCommand('M70', cmdType, (0, utils_1.bin2esc)(cmdData))
593
594
  .then((res) => {
594
595
  const resData = Uint8Array.from(res, x => x.charCodeAt(0));
595
- const cmd = utils_1.esc2bin(resData);
596
+ const cmd = (0, utils_1.esc2bin)(resData);
596
597
  return cmd;
597
598
  });
598
599
  }
@@ -617,7 +618,7 @@ class Daum8i {
617
618
  else if (str === '7')
618
619
  deviceType = 'lyps';
619
620
  else
620
- throw (new Error(`unknown device type ${typeof str === 'string' ? utils_1.ascii(str.charAt(0)) : str}`));
621
+ throw (new Error(`unknown device type ${typeof str === 'string' ? (0, utils_1.ascii)(str.charAt(0)) : str}`));
621
622
  return deviceType;
622
623
  });
623
624
  }
@@ -632,7 +633,7 @@ class Daum8i {
632
633
  else if (str === '2')
633
634
  deviceType = constants_1.ACTUAL_BIKE_TYPE.MOUNTAIN;
634
635
  else {
635
- throw (new Error(`unknown actual device type ${typeof str === 'string' ? utils_1.ascii(str.charAt(0)) : str}`));
636
+ throw (new Error(`unknown actual device type ${typeof str === 'string' ? (0, utils_1.ascii)(str.charAt(0)) : str}`));
636
637
  }
637
638
  this.state.actualBikeType = deviceType;
638
639
  return deviceType;
@@ -674,12 +675,12 @@ class Daum8i {
674
675
  getTrainingData() {
675
676
  return this.sendDaum8iCommand('X70', 'AF', [])
676
677
  .then((data) => {
677
- const td = utils_1.parseTrainingData(data);
678
+ const td = (0, utils_1.parseTrainingData)(data);
678
679
  return td;
679
680
  });
680
681
  }
681
682
  setLoadControl(enabled) {
682
- const val = enabled ? utils_1.ascii('1') : utils_1.ascii('0');
683
+ const val = enabled ? (0, utils_1.ascii)('1') : (0, utils_1.ascii)('0');
683
684
  return this.sendDaum8iCommand('S20', 'BF', [val])
684
685
  .then((data) => {
685
686
  const res = data === '1';
@@ -713,7 +714,7 @@ class Daum8i {
713
714
  setPerson(person) {
714
715
  const { sex, age, length, weight } = person;
715
716
  this.logger.logEvent({ message: 'setPerson() request', sex, age, length, weight });
716
- return this.sendReservedDaum8iCommand(utils_1.ReservedCommands.PERSON_SET, 'BF', utils_1.getPersonData(person))
717
+ return this.sendReservedDaum8iCommand(utils_1.ReservedCommands.PERSON_SET, 'BF', (0, utils_1.getPersonData)(person))
717
718
  .then((res) => {
718
719
  const buffer = Buffer.from(res);
719
720
  const success = buffer.readInt16LE(0) === utils_1.ReservedCommands.PERSON_SET;
@@ -737,9 +738,9 @@ class Daum8i {
737
738
  }
738
739
  programUploadStart(bikeType, route) {
739
740
  const payload = Buffer.alloc(40);
740
- const epp = route ? utils_1.routeToEpp(route) : undefined;
741
+ const epp = route ? (0, utils_1.routeToEpp)(route) : undefined;
741
742
  const eppLength = epp ? epp.length : 0;
742
- const bikeTypeVal = utils_1.getBikeType(bikeType);
743
+ const bikeTypeVal = (0, utils_1.getBikeType)(bikeType);
743
744
  const wBits = route.lapMode ? DS_BITS_ENDLESS_RACE : DS_BITS_OFF;
744
745
  payload.writeInt32LE(0, 0);
745
746
  payload.writeInt8(bikeTypeVal, 4);
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getPersonData = exports.parseTrainingData = exports.routeToEpp = exports.getBikeType = exports.BikeType = exports.ReservedCommands = exports.Int32ToIntArray = exports.Int16ToIntArray = exports.Float32ToIntArray = exports.Float32ToHex = exports.getAsciiArrayFromStr = exports.asciiArrayToString = exports.charArrayToString = exports.ascii = exports.append = exports.getHex = exports.hexstr = exports.getMessageData = exports.buildMessage = exports.checkSum = exports.esc2bin = exports.bin2esc = void 0;
6
7
  const win32filetime_1 = __importDefault(require("win32filetime"));
7
8
  const sum = (arr) => arr.reduce((a, b) => a + b, 0);
8
9
  function bin2esc(arr) {
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { DeviceProtocol } from "../DeviceProtocol";
3
4
  import { EventLogger } from "gd-eventlog";
4
5
  import { Command } from "../types/command";
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.SendState = exports.SerialCommsState = void 0;
15
16
  const gd_eventlog_1 = require("gd-eventlog");
16
17
  const utils_1 = require("../utils");
17
18
  const events_1 = __importDefault(require("events"));
@@ -193,7 +194,7 @@ class KettlerSerialComms extends events_1.default {
193
194
  write(cmd) {
194
195
  this.sendState = SendState.Sending;
195
196
  const { logStr, message, timeout = (this.settings.timeout || DEFAULT_RCV_TIMEOUT) } = cmd;
196
- const msg = typeof message === 'string' ? message : utils_1.hexstr(message);
197
+ const msg = typeof message === 'string' ? message : (0, utils_1.hexstr)(message);
197
198
  const onError = (err) => {
198
199
  this.logger.logEvent({ message: "sendCommand:error:", cmd: logStr, error: err.message, port: this.getPort() });
199
200
  if (cmd.onError)
@@ -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) {
@@ -8,13 +31,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
32
  });
10
33
  };
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
34
  var __importDefault = (this && this.__importDefault) || function (mod) {
19
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
20
36
  };
@@ -288,7 +304,7 @@ class KettlerRacerAdapter extends Device_1.default {
288
304
  this.logger.logEvent({ message: 'start()' });
289
305
  var info = {};
290
306
  yield this.waitForOpened(true);
291
- return utils_1.runWithRetries(() => __awaiter(this, void 0, void 0, function* () {
307
+ return (0, utils_1.runWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
292
308
  try {
293
309
  if (!info.checkDone) {
294
310
  info.checkDone = yield this.check();
@@ -573,7 +589,7 @@ class KettlerRacerAdapter extends Device_1.default {
573
589
  if (!retries) {
574
590
  return new Promise((resolve, reject) => run(resolve, reject));
575
591
  }
576
- return utils_1.runWithRetries(() => {
592
+ return (0, utils_1.runWithRetries)(() => {
577
593
  return new Promise((resolve, reject) => run(resolve, reject));
578
594
  }, 3, 1000);
579
595
  }
@@ -28,7 +28,7 @@ export default class KettlerRacerProtocol extends DeviceProtocolBase implements
28
28
  isBike(): boolean;
29
29
  isHrm(): boolean;
30
30
  isPower(): boolean;
31
- add(settings: DeviceSettings): any;
31
+ add(settings: DeviceSettings): import("../../DeviceProtocol").Device;
32
32
  scan(props: KettlerRacerScanProps): void;
33
33
  checkDevice(port: string): boolean;
34
34
  doScan(port: string): Promise<void>;
@@ -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) {
@@ -8,13 +31,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
32
  });
10
33
  };
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
34
  var __importDefault = (this && this.__importDefault) || function (mod) {
19
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
20
36
  };
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.config = void 0;
6
7
  const power_base_1 = __importDefault(require("./power-base"));
7
8
  exports.config = {
8
9
  name: 'PowerMeter',
@@ -50,7 +50,7 @@ export declare class Simulator extends DeviceAdapter {
50
50
  export default class SimulatorProtocol extends DeviceProtocolBase {
51
51
  static NAME: string;
52
52
  constructor();
53
- add(settings: SimulatorSettings): any;
53
+ add(settings: SimulatorSettings): Simulator;
54
54
  getName(): string;
55
55
  getInterfaces(): string[];
56
56
  isBike(): boolean;
@@ -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) {
@@ -8,17 +31,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
32
  });
10
33
  };
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
34
  var __importDefault = (this && this.__importDefault) || function (mod) {
19
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
20
36
  };
21
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.Simulator = void 0;
22
39
  const DeviceProtocol_1 = __importStar(require("../DeviceProtocol"));
23
40
  const DeviceRegistry_1 = __importDefault(require("../DeviceRegistry"));
24
41
  const Device_1 = __importDefault(require("../Device"));
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RouteType = void 0;
3
4
  var RouteType;
4
5
  (function (RouteType) {
5
6
  RouteType["FREE_RIDE"] = "free ride";
package/lib/types/user.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Gender = void 0;
3
4
  var Gender;
4
5
  (function (Gender) {
5
6
  Gender["MALE"] = "M";
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 = (ms) => {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.4.42",
3
+ "version": "1.4.45",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",