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 +1 -1
- package/smithtek-mako-rf.js +2 -2
package/package.json
CHANGED
package/smithtek-mako-rf.js
CHANGED
|
@@ -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
|
-
|
|
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) {
|