Class to manage a Serial Port connection to a device.
| Name | Description |
|---|---|
| default_log_level | Default Log Level for messages when enable_logging is True. |
| enable_logging | Flag to enable logging. |
| port | The serial port object. |
| port_name | The name of the serial port (e.g., 'COM3'). |
| terminator | The line terminator for the serial connection. |
| timeout_milliseconds | Timeout in milliseconds for serial port operations. |
| Name | Description |
|---|---|
| connect(self, com_port, baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, terminator='\n') | Connects to the specified serial port with given parameters. |
| disconnect(self) | Disconnects from the serial port. |
| read_data(self, enable_logging=None) | Reads data from the serial port. |
| write(self, command, enable_logging=None) | Writes a command to the serial port. |