incyclist-devices 1.5.33 → 1.5.34

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.
@@ -143,8 +143,8 @@ class Daum8i {
143
143
  this.logEvent({ message: "creating SerialPort", port: this.port, settings });
144
144
  this.sp = new __SerialPort(this.port, settings);
145
145
  }
146
- this.sp.once('open', this.onPortOpen.bind(this));
147
- this.sp.once('close', this.onPortClose.bind(this));
146
+ this.sp.on('open', this.onPortOpen.bind(this));
147
+ this.sp.on('close', this.onPortClose.bind(this));
148
148
  this.sp.on('error', (error) => { this.onPortError(error); });
149
149
  this.sp.on('data', (data) => { this.onData(data); });
150
150
  }
@@ -317,10 +317,15 @@ class Daum8i {
317
317
  if (!isClosed)
318
318
  resolve(false);
319
319
  }, timeout);
320
- this.sp.removeAllListeners('close');
321
- this.sp.removeAllListeners('error');
320
+ try {
321
+ this.sp.removeAllListeners('close');
322
+ this.sp.removeAllListeners('error');
323
+ }
324
+ catch (err) {
325
+ this.logger.logEvent({ message: 'error', fn: 'closePort()', error: err.message });
326
+ }
322
327
  this.sp.on('error', () => { });
323
- this.sp.once('close', () => {
328
+ this.sp.on('close', () => {
324
329
  clearTimeout(to);
325
330
  isClosed = true;
326
331
  resolve(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "1.5.33",
3
+ "version": "1.5.34",
4
4
  "dependencies": {
5
5
  "@serialport/parser-byte-length": "^9.0.1",
6
6
  "@serialport/parser-delimiter": "^9.0.1",