incyclist-devices 2.1.23 → 2.1.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.
@@ -7,6 +7,7 @@ export default class Daum8008 extends SerialPortComms<DaumClassicCommsState, Dau
7
7
  protected bikeNo: number;
8
8
  protected prevFailedPayload: any;
9
9
  protected expected: any;
10
+ protected wasPrevCmdError: boolean;
10
11
  constructor(props: SerialCommProps);
11
12
  validatePath(path: string): string;
12
13
  getDefaultLoggerName(): string;
@@ -17,7 +17,7 @@ const comms_1 = __importDefault(require("../../base/comms"));
17
17
  const utils_2 = require("./utils");
18
18
  const types_1 = require("../types");
19
19
  const ByteLength = require('@serialport/parser-byte-length');
20
- const TIMEOUT_SEND = 1000;
20
+ const TIMEOUT_SEND = 2000;
21
21
  class Daum8008 extends comms_1.default {
22
22
  constructor(props) {
23
23
  super(props);
@@ -37,6 +37,10 @@ class Daum8008 extends comms_1.default {
37
37
  }
38
38
  initForResponse(expected) {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
+ if (this.wasPrevCmdError) {
41
+ yield this.portRead();
42
+ this.wasPrevCmdError = false;
43
+ }
40
44
  this.expected = expected;
41
45
  });
42
46
  }
@@ -93,6 +97,7 @@ class Daum8008 extends comms_1.default {
93
97
  this.logEvent(Object.assign(Object.assign({ message: "sendCommand:error:" }, logPayload), { error: err.message }));
94
98
  this.sendCmdPromise = null;
95
99
  this.prevFailedPayload = payload;
100
+ this.wasPrevCmdError = true;
96
101
  reject(err);
97
102
  }
98
103
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "2.1.23",
3
+ "version": "2.1.24",
4
4
  "dependencies": {
5
5
  "@serialport/bindings-interface": "^1.2.2",
6
6
  "@serialport/parser-byte-length": "^9.0.1",