Serial - OSC
[OSC]
Configure the Serial Port and Read Characters via OSC.
More...
Configure the Serial Port and Read Characters via OSC.
There are 2 serial ports, so use 0 or 1 as an index.
The Serial Subsystem has the following properties:
- baud
- bits
- stopbits
- parity
- hardwarehandshake
- readable
- char
- block
The Baud rate of the device. Valid from 110 baud to >2M baud. To set baud rate to 115200 on the first serial port, for example, send the message
The number of bits per character. Can range from 5 to 8. To set the number of bits to 7 on the first serial port, for example, send the message
The number of stop bits per character. Can be 1 or 2
To set the number of stop bits to 2 on the second serial port, for example, send the message
The parity of the character. Can be -1 for odd, 0 for none or 1 for even. To set the parity to even, for example, send the message
Whether hardware handshaking (i.e. CTS RTS) is being employed. To set hardware handshaking on, for example, send the message
/serial/0/hardwarehandshake 1
How many characters are presently available to read. To check, for example, send the message
Send and receive individual characters with the char property. To send a character 32 (a space), for example, send the message
To get a character send the message
In this case the reply will be an unsigned value between 0 and 255 or -1 if there is no character available.
This property allows for reading or writing a block of characters to/from the serial port. If you're writing a block, you must send the block you want to write as an OSC blob.
For example, to send a block:
/serial/1/block blockofchars
To get a block, send the message
In this case the reply will be a block of up to 100 unsigned chars, or the chars currently available to read from the serial port.