Loadable Function: serial = serialport ([path], [baudrate])
Loadable Function: serial = serialport ([path], [propname, propvalue])

Open serial port interface.

Inputs

path - the interface path of type String.
baudrate - the baudrate of interface.
propname,propvalue - property name/value pairs.

Known input properties:

BaudRate

Numeric baudrate value

Timeout

Numeric timeout value in seconds or -1 to wait forever

StopBits

number of stopbits to use

Parity

Parity setting ’none’, ’even’, ’odd’

DataBits

Number of bits to a byte (5 to 8)

FlowControl

Number of bits to a byte ’none’, ’hardware’, ’software’

Outputs

The serialport() shall return an instance of octave_serialport class as the result serial.

Properties

The serial object has the following public properties:

Name

name assigned to the object

Type

instrument type ’serial’ (readonly)

Port

OS specific port name (readonly)

Status

status of the object ’open’ or ’closed’ (readonly)

Timeout

timeout value used for waiting for data

NumBytesAvailable

number of bytes currently available to read (readonly)

NumBytesWritten

number of bytes written (readonly)

StopBits

number of stopbits to use

Parity

Parity setting ’none’, ’even’, ’odd’

DataBits

Number of bits to a byte (5 to 8)

BaudRate

Baudrate setting

FlowControl

Number of bits to a byte ’none’, ’hardware’, ’software’

PinStatus

current state of pins (readonly)

UserData

user defined data

Package: instrument-control