# Serial - OSC
[OSC]

Configure the Serial Port and Read Characters via OSC. More...

Configure the Serial Port and Read Characters via OSC.

## Devices

There are 2 serial ports, so use 0 or 1 as an index.

## Properties

The Serial Subsystem has the following properties:

- baud
- bits
- stopbits
- parity
- hardwarehandshake
- readable
- char
- block

### Baud

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

    /serial/0/baud 112500

### Bits

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

    /serial/0/bits 7

### StopBits

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

    /serial/1/stopbits 2

### Parity

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

    /serial/0/parity 1

### HardwareHandshake

Whether hardware handshaking (i.e. CTS RTS) is being employed. To set hardware handshaking on, for example, send the message

    /serial/0/hardwarehandshake 1

### Readable

How many characters are presently available to read. To check, for example, send the message

    /serial/0/readable

### Char

Send and receive individual characters with the char property. To send a character 32 (a space), for example, send the message

    /serial/0/char 32

To get a character send the message

    /serial/0/char

In this case the reply will be an unsigned value between 0 and 255 or -1 if there is no character available.

### Block

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

    /serial/1/block

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.