mwSerial.py
Class for managing serial port operations
Class MWSerial
This class manages serial port operations such as reading and writing.
Parameters for Definition
Initial values are set and do not need to be specified.
Name | Type | Default | Description |
---|---|---|---|
port | string | None | Name of the serial port to open e.g., COM3, /dev/ttyUSB0 |
baud | int | 115200 | Baud rate |
timeout | float | 0.1 | Timeout duration for serial communication (in seconds) |
parity | int | serial.PARITY_NONE | Specify parity |
stop | int | 1 | Stop bit |
byte | int | 8 | Data bit length |
rtscts | int | 0 | Set to 1 to enable RTS and CTS |
dsrdtr | int | 0 | Set to 1 to enable DSR and DTR |
mode | string | Ascii | This value is fixed to Ascii |
SerialSelect
Searches for serial ports connected to the PC and prompts the user to select one.
If only one port is available, it is automatically selected.
If no ports are found, None is returned.
If a port name is passed as an argument, that port will be used.
Parameters
Name | Type | Default | Description |
---|---|---|---|
portname | string | None | Name of the serial port to open (e.g., COM3, /dev/ttyUSB0) Leave unspecified for automatic selection. |
Return Value
None