incyclist-devices 2.0.4 → 2.0.6

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.
@@ -65,5 +65,6 @@ export declare class ControllableAntAdapter<TDeviceData extends BaseDeviceData,
65
65
  getSupportedCyclingModes(): any[];
66
66
  getDefaultCyclingMode(): CyclingMode;
67
67
  setCyclingMode(mode: CyclingMode | string, settings?: any): void;
68
+ sendInitCommands(): Promise<boolean>;
68
69
  getCyclingMode(): CyclingMode;
69
70
  }
@@ -306,6 +306,11 @@ class ControllableAntAdapter extends AntAdapter {
306
306
  this.cyclingMode = selectedMode;
307
307
  this.cyclingMode.setSettings(settings);
308
308
  }
309
+ sendInitCommands() {
310
+ return __awaiter(this, void 0, void 0, function* () {
311
+ return true;
312
+ });
313
+ }
309
314
  getCyclingMode() {
310
315
  if (!this.cyclingMode)
311
316
  this.setCyclingMode(this.getDefaultCyclingMode());
@@ -57,6 +57,7 @@ class AntInterface extends events_1.default {
57
57
  logEvent(event) {
58
58
  if (this.logger)
59
59
  this.logger.logEvent(event);
60
+ console.log('~~~ ANT', event);
60
61
  }
61
62
  isConnected() {
62
63
  return this.connectState.connected;
@@ -17,6 +17,7 @@ export default class AntFEAdapter extends ControllableAntAdapter<FitnessEquipmen
17
17
  protected distanceInternal?: number;
18
18
  protected startProps: AntDeviceProperties;
19
19
  protected isReconnecting: boolean;
20
+ protected sensorConnected: boolean;
20
21
  constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
21
22
  createSensor(settings: AntDeviceSettings): ISensor;
22
23
  getName(): string;
@@ -32,7 +33,8 @@ export default class AntFEAdapter extends ControllableAntAdapter<FitnessEquipmen
32
33
  transformData(bikeData: IncyclistBikeData): FitnessEquipmentSensorData;
33
34
  start(props?: any): Promise<any>;
34
35
  setFEDefaultTimeout(): void;
36
+ stop(): Promise<boolean>;
35
37
  reconnect(): Promise<boolean>;
36
- setCyclingMode(mode: string | CyclingMode, settings?: any): void;
38
+ sendInitCommands(): Promise<boolean>;
37
39
  }
38
40
  export {};
@@ -38,6 +38,7 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
38
38
  this.logger = new gd_eventlog_1.EventLogger('Ant+FE');
39
39
  this.isReconnecting = false;
40
40
  this.startProps = {};
41
+ this.sensorConnected = false;
41
42
  this.capabilities = [
42
43
  capabilities_1.IncyclistCapability.Power, capabilities_1.IncyclistCapability.Speed, capabilities_1.IncyclistCapability.Cadence,
43
44
  capabilities_1.IncyclistCapability.Control
@@ -193,8 +194,8 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
193
194
  const opts = props || {};
194
195
  const { args = {}, user = {} } = opts;
195
196
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
196
- const { timeout = 20000 } = props || {};
197
- const totalTimeout = timeout + 10000;
197
+ const { startupTimeout = 20000, reconnectTimeout = 2000 } = props || {};
198
+ const totalTimeout = Math.min(startupTimeout + 10000, startupTimeout * 2);
198
199
  let to;
199
200
  const stopTimeoutCheck = () => {
200
201
  if (to) {
@@ -203,44 +204,43 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
203
204
  }
204
205
  };
205
206
  to = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
206
- yield this.stop();
207
207
  reject(new Error(`could not start device, reason:timeout`));
208
+ this.started = false;
208
209
  to = null;
209
210
  }), totalTimeout);
210
211
  this.setFEDefaultTimeout();
211
212
  let success = false;
212
213
  let status = { userSent: false, slopeSent: false };
213
214
  let retry = 0;
214
- let startSuccess = 0;
215
+ let hasData = false;
215
216
  while (!success && retry < MAX_RETRIES) {
216
217
  retry++;
217
- if (!this.started) {
218
+ if (!this.sensorConnected) {
218
219
  this.logEvent({ message: 'start sensor', props });
219
- this.started = yield this.ant.startSensor(this.sensor, this.onDeviceData.bind(this));
220
- if (this.started) {
220
+ this.sensorConnected = yield this.ant.startSensor(this.sensor, this.onDeviceData.bind(this));
221
+ if (this.sensorConnected) {
221
222
  this.logEvent({ message: 'sensor started', props });
222
- startSuccess++;
223
223
  }
224
- if (this.started && startSuccess === 1) {
224
+ }
225
+ if (this.sensorConnected && !hasData) {
226
+ try {
227
+ yield this.waitForData(startupTimeout);
228
+ hasData = true;
229
+ }
230
+ catch (err) {
231
+ stopTimeoutCheck();
225
232
  try {
226
- console.log('~~~ Device: waiting for data', 'timeout=', timeout || 'unknown');
227
- yield this.waitForData(timeout);
228
- console.log('~~~ Device: data received');
229
- }
230
- catch (err) {
231
- stopTimeoutCheck();
232
- try {
233
- yield yield this.ant.stopSensor(this.sensor);
234
- }
235
- catch (_a) { }
236
- this.started = false;
237
- return reject(new Error('could not start device, reason:timeout'));
233
+ yield yield this.ant.stopSensor(this.sensor);
234
+ this.sensorConnected = false;
238
235
  }
236
+ catch (_a) { }
237
+ this.started = false;
238
+ return reject(new Error('could not start device, reason:no data received'));
239
239
  }
240
- status = { userSent: false, slopeSent: false };
241
240
  }
242
- if (!this.started) {
243
- yield (0, utils_2.sleep)(2000);
241
+ status = { userSent: false, slopeSent: false };
242
+ if (!hasData) {
243
+ yield (0, utils_2.sleep)(reconnectTimeout);
244
244
  continue;
245
245
  }
246
246
  if (!this.isReconnecting) {
@@ -272,10 +272,6 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
272
272
  }
273
273
  catch (err) {
274
274
  this.logger.logEvent({ message: 'sending FE message error', error: err.message });
275
- try {
276
- yield this.ant.stopSensor(this.sensor);
277
- }
278
- catch (_b) { }
279
275
  this.started = false;
280
276
  }
281
277
  success = status.userSent && status.slopeSent;
@@ -284,22 +280,24 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
284
280
  success = true;
285
281
  }
286
282
  }
287
- while (success && this.dataMsgCount === 0) {
288
- yield (0, utils_2.sleep)(500);
289
- }
290
283
  if (success) {
291
284
  this.logEvent({ message: 'start success' });
285
+ this.started = true;
292
286
  stopTimeoutCheck();
293
287
  resolve(true);
294
288
  }
295
289
  else {
296
290
  this.logEvent({ message: 'start failed' });
297
291
  stopTimeoutCheck();
298
- if (this.started) {
292
+ if (!hasData) {
293
+ reject(new Error('could not start device, reason: no data received'));
294
+ }
295
+ else if (this.sensorConnected) {
299
296
  reject(new Error('could not start device, reason: could not send FE commands'));
300
297
  }
301
- else
298
+ else {
302
299
  reject(new Error('could not start device, reason: could not connect'));
300
+ }
303
301
  this.started = false;
304
302
  }
305
303
  }));
@@ -309,6 +307,11 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
309
307
  const fe = this.sensor;
310
308
  fe.setSendTimeout(5000);
311
309
  }
310
+ stop() {
311
+ const stopped = super.stop();
312
+ this.sensorConnected = false;
313
+ return stopped;
314
+ }
312
315
  reconnect() {
313
316
  return __awaiter(this, void 0, void 0, function* () {
314
317
  this.logger.logEvent({ message: 'reconnect to device' });
@@ -328,16 +331,25 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
328
331
  }
329
332
  });
330
333
  }
331
- setCyclingMode(mode, settings) {
332
- const modeChange = this.cyclingMode.getName() !== mode;
333
- super.setCyclingMode(mode, settings);
334
- if (modeChange && this.started && !this.stopped) {
335
- if (this.getCyclingMode() instanceof ant_fe_erg_mode_1.default) {
336
- const power = this.data.power;
337
- const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
338
- this.sendUpdate(request, true);
334
+ sendInitCommands() {
335
+ return __awaiter(this, void 0, void 0, function* () {
336
+ if (this.started && !this.stopped) {
337
+ try {
338
+ if (this.getCyclingMode() instanceof ant_fe_erg_mode_1.default) {
339
+ const power = this.data.power;
340
+ const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
341
+ yield this.sendUpdate(request, true);
342
+ return true;
343
+ }
344
+ }
345
+ catch (_a) {
346
+ return false;
347
+ }
339
348
  }
340
- }
349
+ else {
350
+ return false;
351
+ }
352
+ });
341
353
  }
342
354
  }
343
355
  exports.default = AntFEAdapter;
@@ -64,5 +64,6 @@ export declare class ControllableDevice extends IncyclistDevice implements Bike
64
64
  getSupportedCyclingModes(): any[];
65
65
  getDefaultCyclingMode(): CyclingMode;
66
66
  setCyclingMode(mode: CyclingMode | string, settings?: any): void;
67
+ sendInitCommands(): Promise<boolean>;
67
68
  getCyclingMode(): CyclingMode;
68
69
  }
@@ -65,6 +65,10 @@ class IncyclistDevice extends events_1.default {
65
65
  if (!this.logger || this.paused)
66
66
  return;
67
67
  this.logger.logEvent(event);
68
+ if (process.env.BLE_DEBUG || process.env.ANT_DEBUG) {
69
+ const logText = '~~~' + this.getInterface().toUpperCase();
70
+ console.log(logText, event);
71
+ }
68
72
  }
69
73
  getMaxUpdateFrequency() {
70
74
  return this.updateFrequency;
@@ -174,6 +178,11 @@ class ControllableDevice extends IncyclistDevice {
174
178
  this.cyclingMode = selectedMode;
175
179
  this.cyclingMode.setSettings(settings);
176
180
  }
181
+ sendInitCommands() {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ return true;
184
+ });
185
+ }
177
186
  getCyclingMode() {
178
187
  if (!this.cyclingMode)
179
188
  this.setCyclingMode(this.getDefaultCyclingMode());
@@ -49,5 +49,6 @@ export declare class BleControllableAdapter extends BleAdapter implements Bike {
49
49
  getSupportedCyclingModes(): any[];
50
50
  getDefaultCyclingMode(): CyclingMode;
51
51
  setCyclingMode(mode: CyclingMode | string, settings?: any): void;
52
+ sendInitCommands(): Promise<boolean>;
52
53
  getCyclingMode(): CyclingMode;
53
54
  }
@@ -281,6 +281,11 @@ class BleControllableAdapter extends BleAdapter {
281
281
  this.cyclingMode = selectedMode;
282
282
  this.cyclingMode.setSettings(settings);
283
283
  }
284
+ sendInitCommands() {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ return true;
287
+ });
288
+ }
284
289
  getCyclingMode() {
285
290
  if (!this.cyclingMode)
286
291
  this.setCyclingMode(this.getDefaultCyclingMode());
@@ -17,6 +17,6 @@ export default class BleFmAdapter extends BleControllableAdapter {
17
17
  mapData(deviceData: IndoorBikeData): IncyclistBikeData;
18
18
  transformData(bikeData: IncyclistBikeData): DeviceData;
19
19
  start(props?: BleStartProperties): Promise<any>;
20
- sendUpdate(request: any): Promise<void>;
21
- setCyclingMode(mode: string | CyclingMode, settings?: any): void;
20
+ sendUpdate(request: any, enforced?: boolean): Promise<void>;
21
+ sendInitCommands(): Promise<boolean>;
22
22
  }
@@ -113,10 +113,11 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
113
113
  start(props = {}) {
114
114
  return __awaiter(this, void 0, void 0, function* () {
115
115
  const wasPaused = this.paused;
116
- this.resume();
116
+ if (wasPaused)
117
+ this.resume();
117
118
  if (this.started && !wasPaused)
118
119
  return true;
119
- this.logEvent(Object.assign(Object.assign({ message: 'start requested' }, this.getSettings()), { protocol: this.getProtocolName(), props }));
120
+ this.logEvent(Object.assign(Object.assign({ message: 'starting device' }, this.getSettings()), { protocol: this.getProtocolName(), props, isStarted: this.started }));
120
121
  const { restart = wasPaused } = props;
121
122
  if (!restart && this.ble.isScanning() && !this.getComms().isConnected()) {
122
123
  }
@@ -172,7 +173,7 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
172
173
  if (!hasControl)
173
174
  throw new Error('could not establish control');
174
175
  const startRequest = this.getCyclingMode().getBikeInitRequest();
175
- yield this.sendUpdate(startRequest);
176
+ yield this.sendUpdate(startRequest, true);
176
177
  }
177
178
  if (!this.started && !wasPaused) {
178
179
  comms.on('data', (data) => {
@@ -207,9 +208,9 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
207
208
  }
208
209
  });
209
210
  }
210
- sendUpdate(request) {
211
+ sendUpdate(request, enforced = false) {
211
212
  return __awaiter(this, void 0, void 0, function* () {
212
- if (this.paused || !this.device)
213
+ if (!enforced && (this.paused || !this.device))
213
214
  return;
214
215
  try {
215
216
  const update = this.getCyclingMode().sendBikeUpdate(request);
@@ -227,23 +228,25 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
227
228
  }
228
229
  });
229
230
  }
230
- setCyclingMode(mode, settings) {
231
- const modeChange = this.cyclingMode.getName() !== mode;
232
- const prevMode = this.getCyclingMode();
233
- super.setCyclingMode(mode, settings);
234
- const isPaused = this.isPaused();
235
- if (modeChange && this.started && !this.stopped) {
236
- if (prevMode instanceof ble_st_mode_1.default) {
237
- const power = this.data.power;
238
- const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
239
- if (isPaused)
240
- this.resume();
241
- this.sendUpdate(request).then().catch().finally(() => {
242
- if (isPaused)
243
- this.pause();
244
- });
231
+ sendInitCommands() {
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ if (this.started && !this.stopped) {
234
+ try {
235
+ if (this.getCyclingMode() instanceof ble_erg_mode_1.default) {
236
+ const power = this.data.power;
237
+ const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
238
+ yield this.sendUpdate(request, true);
239
+ return true;
240
+ }
241
+ }
242
+ catch (_a) {
243
+ return false;
244
+ }
245
245
  }
246
- }
246
+ else {
247
+ return false;
248
+ }
249
+ });
247
250
  }
248
251
  }
249
252
  exports.default = BleFmAdapter;
@@ -228,9 +228,14 @@ class TCPPortBinding {
228
228
  }
229
229
  this.writeOperation = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
230
230
  yield resolveNextTick();
231
- this.socket.write(buffer, () => {
232
- resolve();
233
- });
231
+ try {
232
+ this.socket.write(buffer, () => {
233
+ resolve();
234
+ });
235
+ }
236
+ catch (err) {
237
+ this.onError(err);
238
+ }
234
239
  }));
235
240
  return this.writeOperation;
236
241
  }
@@ -27,6 +27,7 @@ export default class DaumAdapterBase extends SerialIncyclistDevice implements Da
27
27
  updateBusy: boolean;
28
28
  constructor(settings: SerialDeviceSettings, props?: DeviceProperties);
29
29
  setCyclingMode(mode: CyclingMode | string, settings?: any): void;
30
+ sendInitCommands(): Promise<boolean>;
30
31
  getSupportedCyclingModes(): Array<any>;
31
32
  getCyclingMode(): CyclingMode;
32
33
  getDefaultCyclingMode(): CyclingMode;
@@ -61,6 +61,26 @@ class DaumAdapterBase extends adapter_1.SerialIncyclistDevice {
61
61
  this.cyclingMode = selectedMode;
62
62
  this.cyclingMode.setSettings(settings);
63
63
  }
64
+ sendInitCommands() {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ if (this.started && !this.stopped) {
67
+ try {
68
+ if (this.getCyclingMode() instanceof ERGCyclingMode_1.default) {
69
+ const power = this.deviceData.power;
70
+ const request = power ? { targetPower: power } : this.getCyclingMode().getBikeInitRequest();
71
+ yield this.sendUpdate(request);
72
+ return true;
73
+ }
74
+ }
75
+ catch (_a) {
76
+ return false;
77
+ }
78
+ }
79
+ else {
80
+ return false;
81
+ }
82
+ });
83
+ }
64
84
  getSupportedCyclingModes() {
65
85
  return [ERGCyclingMode_1.default, SmartTrainerCyclingMode_1.default, DaumPowerMeterCyclingMode_1.default];
66
86
  }
@@ -215,7 +235,6 @@ class DaumAdapterBase extends adapter_1.SerialIncyclistDevice {
215
235
  this.updateBusy = true;
216
236
  this.getCurrentBikeData()
217
237
  .then(bikeData => {
218
- console.log('~~~ bike data', bikeData);
219
238
  this.updateData(this.cyclingData, bikeData);
220
239
  const data = this.transformData();
221
240
  this.updateBusy = false;
@@ -25,7 +25,6 @@ const DAUM_PREMIUM_DEFAULT_PORT = 51955;
25
25
  const START_RETRY_TIMEOUT = 1500;
26
26
  const DEFAULT_GEAR = 10;
27
27
  const getBikeProps = (props) => {
28
- console.log('~~~getBikeProps', props);
29
28
  const { host, port = DAUM_PREMIUM_DEFAULT_PORT, interface: ifaceName } = props;
30
29
  let serial;
31
30
  if (ifaceName && typeof ifaceName === 'string') {
@@ -47,7 +46,6 @@ const getBikeProps = (props) => {
47
46
  };
48
47
  class DaumPremiumAdapter extends DaumAdapter_1.default {
49
48
  constructor(settings, props) {
50
- console.log('~~~ new premium adapter');
51
49
  const logger = new gd_eventlog_1.EventLogger('DaumPremium');
52
50
  const commProps = Object.assign(Object.assign({}, getBikeProps(settings)), { logger });
53
51
  const bike = new comms_1.default(commProps);
@@ -187,7 +185,6 @@ class DaumPremiumAdapter extends DaumAdapter_1.default {
187
185
  if (!info.version) {
188
186
  info.version = yield this.bike.getProtocolVersion();
189
187
  }
190
- console.log('~~~~ starting Daum8i', this.getCyclingMode().getName(), this.getCyclingMode().getModeProperty('eppSupport'));
191
188
  if (this.getCyclingMode().getModeProperty('eppSupport')) {
192
189
  const bikeType = this.getCyclingMode().getSetting('bikeType');
193
190
  if (!info.upload) {
@@ -42,7 +42,6 @@ class SinglePathScanner {
42
42
  }
43
43
  scan() {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
- console.log('~~~ start SERIAL Scan', this.isScanning);
46
45
  if (this.isScanning)
47
46
  return;
48
47
  this.isScanning = true;
@@ -53,7 +52,6 @@ class SinglePathScanner {
53
52
  let found = false;
54
53
  while (!found && this.isScanning) {
55
54
  try {
56
- console.log('~~~ adapter check attempt');
57
55
  const { protocol } = this.props;
58
56
  let host, port;
59
57
  if (this.serial.getName() === exports.SerialInterfaceType.TCPIP) {
@@ -72,7 +70,6 @@ class SinglePathScanner {
72
70
  yield (0, utils_1.sleep)(100);
73
71
  }
74
72
  catch (err) {
75
- console.log('~~~ERROR', err);
76
73
  this.logger.logEvent({ message: 'error', fn: 'scan()', error: err.message || err, stack: err.stack });
77
74
  yield (0, utils_1.sleep)(100);
78
75
  }
@@ -85,13 +82,11 @@ exports.SinglePathScanner = SinglePathScanner;
85
82
  class SerialInterface extends events_1.default {
86
83
  static getInstance(props) {
87
84
  const { ifaceName, binding, logger } = props;
88
- console.log('~~~ new instance #1', ifaceName, serialport_1.default.getInstance().getBinding(ifaceName));
89
85
  let instance = SerialInterface._instances.find(i => i.ifaceName === ifaceName);
90
86
  if (!instance) {
91
87
  if (binding)
92
88
  instance = new SerialInterface(props);
93
89
  else {
94
- console.log('~~~ new instance', ifaceName, serialport_1.default.getInstance().getBinding(ifaceName));
95
90
  instance = new SerialInterface({ ifaceName, binding: serialport_1.default.getInstance().getBinding(ifaceName), logger });
96
91
  if (instance)
97
92
  SerialInterface._instances.push(instance);
@@ -115,6 +110,7 @@ class SerialInterface extends events_1.default {
115
110
  this.isScanning = false;
116
111
  this.isStopScanRequested = false;
117
112
  this.scanEvents = new events_1.default();
113
+ this.scanEvents.setMaxListeners(100);
118
114
  this.logger = props.logger || new gd_eventlog_1.EventLogger(`Serial:${ifaceName}`);
119
115
  this.connected = false;
120
116
  this.logger.logEvent({ message: 'new serial interface', ifaceName });
@@ -160,7 +156,6 @@ class SerialInterface extends events_1.default {
160
156
  }
161
157
  openPort(path) {
162
158
  return __awaiter(this, void 0, void 0, function* () {
163
- console.log('~~~ SerialPort.openPort', this.ifaceName, path);
164
159
  this.logger.logEvent({ message: 'opening port', path });
165
160
  const port = serialport_1.default.getInstance().getSerialPort(this.ifaceName, { path });
166
161
  if (!port) {
@@ -193,7 +188,6 @@ class SerialInterface extends events_1.default {
193
188
  }
194
189
  closePort(path) {
195
190
  return __awaiter(this, void 0, void 0, function* () {
196
- console.log('~~~ SerialPort.closePort', this.ifaceName, path);
197
191
  const existing = this.ports.findIndex(p => p.path === path);
198
192
  if (existing === -1)
199
193
  return true;
@@ -217,7 +211,6 @@ class SerialInterface extends events_1.default {
217
211
  }
218
212
  scan(props) {
219
213
  return __awaiter(this, void 0, void 0, function* () {
220
- console.log('~~serial scan', this.isScanning, this.isConnected());
221
214
  if (this.isScanning)
222
215
  return [];
223
216
  if (!this.isConnected())
@@ -41,6 +41,7 @@ export declare class Simulator extends ControllableDevice {
41
41
  getDefaultCyclingMode(): CyclingMode;
42
42
  getCyclingMode(): CyclingMode;
43
43
  setCyclingMode(mode: CyclingMode | string, settings?: any): void;
44
+ sendInitCommands(): Promise<boolean>;
44
45
  start(props?: SimulatorProperties): Promise<boolean>;
45
46
  stop(): Promise<boolean>;
46
47
  pause(): Promise<boolean>;
@@ -88,6 +88,11 @@ class Simulator extends adpater_1.ControllableDevice {
88
88
  this.cyclingMode = selectedMode;
89
89
  this.cyclingMode.setSettings(settings);
90
90
  }
91
+ sendInitCommands() {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ return true;
94
+ });
95
+ }
91
96
  start(props) {
92
97
  return __awaiter(this, void 0, void 0, function* () {
93
98
  this.startProps = props;
@@ -30,7 +30,7 @@ export interface IncyclistDeviceAdapter extends EventEmitter {
30
30
  onData(callback: OnDeviceDataCallback): any;
31
31
  }
32
32
  export interface Bike {
33
- setCyclingMode(mode: CyclingMode | string, settings?: any): void;
33
+ setCyclingMode(mode: CyclingMode | string, settings?: any, sendInitCommands?: boolean): void;
34
34
  getSupportedCyclingModes(): Array<any>;
35
35
  getCyclingMode(): CyclingMode;
36
36
  getDefaultCyclingMode(): CyclingMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",