smithtek-mako-rf 2.9.4 → 2.9.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smithtek-mako-rf",
3
- "version": "2.9.4",
3
+ "version": "2.9.6",
4
4
  "description": "Smithtek dedicated node for communicating with the Mako PLC over RS485 or RF",
5
5
  "keywords": [
6
6
  "node-red",
@@ -97,7 +97,7 @@ module.exports = function (RED) {
97
97
  const cmd = buildRssiCommandBuffer();
98
98
 
99
99
  // Optional: flush any buffered junk (some serialport builds support this)
100
- // try { if (typeof port.flush === "function") port.flush(() => {}); } catch (_e) {}
100
+ try { if (typeof port.flush === "function") port.flush(() => {}); } catch (_e) {}
101
101
 
102
102
  let rx = Buffer.alloc(0);
103
103
 
@@ -114,9 +114,9 @@ module.exports = function (RED) {
114
114
  finished = true;
115
115
  clearTimeout(timer);
116
116
  try { port.off("data", onData); } catch (_e) {
117
- // older serialport uses removeListener
118
117
  try { port.removeListener("data", onData); } catch (_e2) {}
119
118
  }
119
+ try { if (typeof port.flush === "function") port.flush(() => {}); } catch (_e) {}
120
120
  }
121
121
 
122
122
  function onData(chunk) {