Port object
Property | Description | Access | Type |
---|---|---|---|
Port.isopen | Checks if the serial port is open | readonly | boolean |
Port.rts | Get/set serial port RTS mode | readwrite | string | nil |
Port.dtr | Get/set serial port DTR mode | readwrite | string | nil |
Port.baudrate | Get/set serial port baudrate | readwrite | number | nil |
Port.bytesize | Get/set serial port bytesize | readwrite | number | nil |
Port.parity | Get/set serial port parity mode | readwrite | string | nil |
Port.stopbits | Get/set serial port stop bits | readwrite | string | nil |
Method | Description | Return value |
---|---|---|
Port.constructor() | Port object constructor | Port |
Port:open() | Open the serial port | boolean |
Port:read() | Reads data from the serial port | Task |
Port:readline() | Reads a line from the serial port | Task |
Port:write() | Writes data to the serial port | Task |
Port:flush() | Flush data to the serial port | - |
Port:close() | Close the serial port | - |