From 0b11d68c02716cf0d1a9118eb938bda3f3294943 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 4 Apr 2019 22:20:21 +0100 Subject: [PATCH] Let serialport wiatfor a char before starting output --- io/serialport/25-serial.html | 70 ++++++++++++++-------- io/serialport/25-serial.js | 57 ++++++++++++------ io/serialport/locales/en-US/25-serial.json | 13 ++-- io/serialport/package.json | 2 +- 4 files changed, 92 insertions(+), 50 deletions(-) diff --git a/io/serialport/25-serial.html b/io/serialport/25-serial.html index 835ad5a9..b78905f5 100644 --- a/io/serialport/25-serial.html +++ b/io/serialport/25-serial.html @@ -99,7 +99,7 @@ with which it shares the configuration.

Send the request message in msg.payload as you would do with a serial out node. The message will be forwarded to the serial port following a strict FIFO (First In, First Out) queue, waiting for a single response before transmitting the next request. - Once a response is received (with the same logic of a serial in node), or after a timeout occurs, a message is produced to the output (see Outputs below), + Once a response is received (with the same logic of a serial in node), or after a timeout occurs, a message is sent to the output (see Outputs below), with msg.payload containing the received response (or missing in case if timeout) and all other fields preserved.

For consistency with the serial in node, msg.port is set to the name of the port selected.

Inputs

@@ -108,7 +108,8 @@ msg.timeout is the timeout (in ms) after which the incoming message is propagated to the output with msg.status set to "ERR_TIMEOUT" and missing payload. If not present, the default value is 10000 (10s). -
  • Any other field will be propagated to the output so to allow to match responses with requests.
  • +
  • msg.count if set this will override the configured number of characters as long as it is less than the number configured.
  • +
  • msg.waitfor single character, escape code, or hex code. If set, the node will wait until it matches that character in the stream and then start the output.
  • Outputs