incyclist-devices 2.3.2 → 2.3.4

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.
@@ -331,6 +331,7 @@ class AntInterface extends events_1.default {
331
331
  }
332
332
  startSensor(sensor, onDeviceData) {
333
333
  return __awaiter(this, void 0, void 0, function* () {
334
+ var _a;
334
335
  if (!this.isConnected()) {
335
336
  const connected = yield this.connect();
336
337
  if (!connected)
@@ -355,6 +356,7 @@ class AntInterface extends events_1.default {
355
356
  this.logEvent({ message: 'could not start sensor' });
356
357
  channel.off('data', onData);
357
358
  }
359
+ this.logEvent({ message: 'sensor started', channel: (_a = sensor.getChannel()) === null || _a === void 0 ? void 0 : _a.getChannelNo(), profile: sensor.getProfile(), deviceID: sensor.getDeviceID() });
358
360
  return started;
359
361
  }
360
362
  catch (err) {
@@ -363,7 +365,7 @@ class AntInterface extends events_1.default {
363
365
  try {
364
366
  yield channel.stopSensor(sensor);
365
367
  }
366
- catch (_a) { }
368
+ catch (_b) { }
367
369
  this.unblockChannel(channel);
368
370
  return false;
369
371
  }
@@ -383,7 +385,7 @@ class AntInterface extends events_1.default {
383
385
  return true;
384
386
  }
385
387
  const channel = sensor.getChannel();
386
- if (channel !== undefined) {
388
+ if (channel !== undefined && channel !== null) {
387
389
  try {
388
390
  if (!channel.flush) {
389
391
  this.logEvent({ message: 'old version of ant-channel detected' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",