incyclist-devices 1.5.24 → 1.5.26

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.
@@ -235,9 +235,10 @@ class AntInterface extends events_1.default {
235
235
  if (!this.isConnected || !this.device)
236
236
  return true;
237
237
  const channel = sensor.getChannel();
238
- channel.removeAllListeners('data');
239
238
  if (channel) {
240
239
  try {
240
+ channel.flush();
241
+ channel.removeAllListeners('data');
241
242
  return yield channel.stopSensor(sensor);
242
243
  }
243
244
  catch (err) {
@@ -245,6 +246,10 @@ class AntInterface extends events_1.default {
245
246
  return false;
246
247
  }
247
248
  }
249
+ else {
250
+ this.logEvent({ message: 'could not stop sensor', error: 'no channel attached' });
251
+ return false;
252
+ }
248
253
  });
249
254
  }
250
255
  isScanning() {
package/lib/antv2/fe.js CHANGED
@@ -198,7 +198,7 @@ class AntFEAdapter extends ant_device_1.default {
198
198
  return __awaiter(this, void 0, void 0, function* () {
199
199
  _super.start.call(this, props);
200
200
  this.startProps = props;
201
- this.logger.logEvent({ message: 'start', props });
201
+ this.logger.logEvent({ message: 'starting device', props });
202
202
  const opts = props || {};
203
203
  const { args = {}, user = {} } = opts;
204
204
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
@@ -261,7 +261,7 @@ class AntFEAdapter extends ant_device_1.default {
261
261
  catch (err) {
262
262
  this.logger.logEvent({ message: 'sending FE message error', error: err.message });
263
263
  try {
264
- yield yield this.ant.stopSensor(this.sensor);
264
+ yield this.ant.stopSensor(this.sensor);
265
265
  }
266
266
  catch (_b) { }
267
267
  this.started = false;
@@ -296,8 +296,10 @@ class AntFEAdapter extends ant_device_1.default {
296
296
  stop: { get: () => super.stop }
297
297
  });
298
298
  return __awaiter(this, void 0, void 0, function* () {
299
- const stopped = yield this.ant.stopSensor(this.sensor);
300
- _super.stop.call(this);
299
+ this.logger.logEvent({ message: 'stopping device' });
300
+ let stopped = yield this.ant.stopSensor(this.sensor);
301
+ yield _super.stop.call(this);
302
+ this.logger.logEvent({ message: 'stopping device done', success: stopped });
301
303
  return stopped;
302
304
  });
303
305
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.5.24",
3
+ "version": "1.5.26",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",
7
7
  "@types/serialport": "^8.0.1",
8
8
  "gd-ant-plus": "^0.0.33",
9
- "incyclist-ant-plus": "^0.1.14",
9
+ "incyclist-ant-plus": "^0.1.15",
10
10
  "win32filetime": "^1.0.2"
11
11
  },
12
12
  "peerDependencies": {