incyclist-devices 1.5.30 → 1.5.31

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.
@@ -217,6 +217,7 @@ class DaumAdapterBase extends device_1.default {
217
217
  clearInterval(this.iv.update);
218
218
  this.iv = undefined;
219
219
  }
220
+ this.bike.stopWorker();
220
221
  this.logEvent({ message: 'stop request completed' });
221
222
  this.paused = undefined;
222
223
  resolve(true);
@@ -150,6 +150,7 @@ class DaumClassicAdapter extends DaumAdapter_1.default {
150
150
  let startState = {};
151
151
  return (0, utils_1.runWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
152
152
  try {
153
+ this.logger.logEvent({ message: 'start attempt', udid: this.udid, isRelaunch, isConnected: this.bike.isConnected() });
153
154
  if (!isRelaunch && !this.bike.isConnected())
154
155
  yield this.bike.saveConnect();
155
156
  yield this.getBike().resetDevice();
@@ -187,6 +188,7 @@ class DaumClassicAdapter extends DaumAdapter_1.default {
187
188
  return data;
188
189
  }
189
190
  catch (err) {
191
+ this.logger.logEvent({ message: 'start attempt failed', udid: this.udid, error: err.message });
190
192
  if (startState.checkRunData) {
191
193
  startState = {};
192
194
  }
@@ -48,6 +48,7 @@ export default class Daum8008 {
48
48
  onPortClose(): void;
49
49
  onPortError(err: any): void;
50
50
  startWorker(): void;
51
+ stopWorker(): void;
51
52
  sendDaum8008CommandfromQueue(): any;
52
53
  sendDaum8008Command(logStr: any, payload: any, expected: any, callback?: any, callbackErr?: any, options?: any): void;
53
54
  send(cmdInfo: any): void;
@@ -139,12 +139,7 @@ class Daum8008 {
139
139
  }
140
140
  var serialPort = this.sp;
141
141
  this.closing = true;
142
- if (this.bikeCmdWorker !== undefined) {
143
- clearInterval(this.bikeCmdWorker);
144
- this.bikeCmdWorker = undefined;
145
- }
146
- if (this.queue !== undefined)
147
- this.queue.clear();
142
+ this.stopWorker();
148
143
  let connected = this.connected;
149
144
  if (connected) {
150
145
  if (serialPort) {
@@ -224,6 +219,16 @@ class Daum8008 {
224
219
  this.sendDaum8008CommandfromQueue();
225
220
  }, 50);
226
221
  }
222
+ stopWorker() {
223
+ if (this.queue !== undefined)
224
+ this.queue.clear();
225
+ if (this.bikeCmdWorker !== undefined) {
226
+ clearInterval(this.bikeCmdWorker);
227
+ this.bikeCmdWorker = undefined;
228
+ }
229
+ if (this.queue !== undefined)
230
+ this.queue.clear();
231
+ }
227
232
  sendDaum8008CommandfromQueue() {
228
233
  if (!this.connected || this.closing)
229
234
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",