incyclist-devices 2.0.22 → 2.0.24

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.
@@ -266,12 +266,12 @@ class AntInterface extends events_1.default {
266
266
  return stopped;
267
267
  }
268
268
  catch (err) {
269
- this.logEvent({ message: 'could not stop sensor', error: err.message || err, stack: err.stack });
269
+ this.logEvent({ message: 'could not stop sensor', error: err.message || err, deviceID: sensor.getDeviceID(), stack: err.stack });
270
270
  return false;
271
271
  }
272
272
  }
273
273
  else {
274
- this.logEvent({ message: 'could not stop sensor', error: 'no channel attached' });
274
+ this.logEvent({ message: 'could not stop sensor', deviceID: sensor.getDeviceID(), error: 'no channel attached' });
275
275
  return false;
276
276
  }
277
277
  });
@@ -115,14 +115,14 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
115
115
  this.dataMsgCount++;
116
116
  this.lastDataTS = Date.now();
117
117
  super.onDeviceData(deviceData);
118
- if (!this.started || this.isStopped() || this.paused)
118
+ if (!this.started || this.isStopped())
119
119
  return;
120
120
  if (!this.ivDataTimeout && this.dataMsgCount > 0) {
121
121
  this.startDataTimeoutCheck();
122
122
  }
123
123
  try {
124
124
  const logData = this.getLogData(deviceData, ['PairedDevices', 'RawData']);
125
- this.logger.logEvent({ message: 'onDeviceData', data: logData });
125
+ this.logger.logEvent({ message: 'onDeviceData', data: logData, paused: this.paused });
126
126
  if (!this.canSendUpdate())
127
127
  return;
128
128
  let incyclistData = this.mapToCycleModeData(deviceData);
@@ -281,13 +281,14 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
281
281
  }
282
282
  }
283
283
  if (success) {
284
- this.logEvent({ message: 'start success' });
284
+ this.logEvent({ message: 'ANT FE start success' });
285
285
  this.started = true;
286
+ this.paused = false;
286
287
  stopTimeoutCheck();
287
288
  resolve(true);
288
289
  }
289
290
  else {
290
- this.logEvent({ message: 'start failed' });
291
+ this.logEvent({ message: 'ANT FE start failed' });
291
292
  stopTimeoutCheck();
292
293
  if (!hasData) {
293
294
  reject(new Error('could not start device, reason: no data received'));
@@ -508,7 +508,8 @@ class BleComms extends events_1.default {
508
508
  return new Promise((resolve, reject) => {
509
509
  const characteristic = this.characteristics.find(c => c.uuid === characteristicUuid || (0, utils_2.uuid)(c.uuid) === characteristicUuid);
510
510
  if (!characteristic) {
511
- reject(new Error('Characteristic not found'));
511
+ this.logEvent({ message: 'write: Characteristic not found', characteristicUuid, characteristics: this.characteristics.map(c => c.uuid) });
512
+ reject(new Error(`Characteristic not found`));
512
513
  return;
513
514
  }
514
515
  if (fireAndForget) {
@@ -552,6 +553,7 @@ class BleComms extends events_1.default {
552
553
  return reject(new Error('not connected'));
553
554
  const characteristic = this.characteristics.find(c => c.uuid === characteristicUuid || (0, utils_2.uuid)(c.uuid) === characteristicUuid);
554
555
  if (!characteristic) {
556
+ this.logEvent({ message: 'read: Characteristic not found', characteristicUuid, characteristics: this.characteristics.map(c => c.uuid) });
555
557
  reject(new Error('Characteristic not found'));
556
558
  return;
557
559
  }
@@ -474,6 +474,7 @@ class TacxAdvancedFitnessMachineDevice extends comms_1.default {
474
474
  }
475
475
  sendMessage(message) {
476
476
  return __awaiter(this, void 0, void 0, function* () {
477
+ this.logEvent({ message: 'write', characteristic: this.tacxTx, data: message.toString('hex') });
477
478
  yield this.write(this.tacxTx, message, { withoutResponse: true });
478
479
  return true;
479
480
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",