-
Notifications
You must be signed in to change notification settings - Fork 42
Serial
##Serial Wrapper (serial) Reads and send data on the serial port (RS-232 interface), real or virtual (e.g. Serial Port Profile over BlueTooth wireless link). The main parameter is the serialport which specifies which serial port the wrapper should listen.
In its default mode of operation, each time it receives a byte sequence, it will be published in a StreamElement under the name RAW_PACKET and the type BINARY. It is up to the virtual sensor getting data from the wrapper to analyse the meaning of the received bytes (look at jnetstream for parsing protocols).
If the optional parameter inputseparator is defined, then the received data is not immediately published. Instead, the wrapper splits the data using the parameter value as a separator. The separator is never published. If there is remaining data after the last separator, it is stored in a temporary buffer. The next byte sequence to be received by the wrapper will be concatenated to the temporary buffer before attempting to split it.
As an example, if the separator is ":" and the received data is "abc:def:g" , then two StreamElements (two rows) are generated. The first one contains abc in the RAW_PACKET field and the other one contains def. g is stored in the temporary buffer. Imagine that the wrapper now receives "hijklm:" . Then only one StreamElement will be generated, with the value ghijklm and the temporary buffer will be emptied.
Parameters:
- serialport The serial port on which the wrapper should listen to. The syntax is platform dependent: on Windows systems it will be COM1, COM2... and on Unix systems this will be /dev/ttyS0, /dev/ttyS1...
- baudrate The speed at which the data is arriving on the port, in bits per second (default is 9600).
- inputseparator If this parameter is defined, the serial port wrapper will split incoming data using this value as a separator. The separator is not published.