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