From bc49dc3141b8d188e5e2121cb5ed2e6fb933975d Mon Sep 17 00:00:00 2001 From: BartTK <21058661+BartTK@users.noreply.github.com> Date: Sat, 4 Jan 2025 17:45:48 +0000 Subject: [PATCH] Fix emulator --- lib/emulateSerialport.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/emulateSerialport.js b/lib/emulateSerialport.js index 4df8ae6..c0e3a46 100644 --- a/lib/emulateSerialport.js +++ b/lib/emulateSerialport.js @@ -22,6 +22,13 @@ let intervalGas = config.emulatorIntervalGasInSeconds * 1000; function EmulateSerialport(path, options, callback) { const constructor = this; + this.pipe = function (target) { + constructor.on('data', data => { + target.write(data); + }); + return target; + }; + EventEmitter.call(this); // Delay the opening of a connection so the listeners have time to initiate before the event is emitted