serial_device
frog.hardware.serial_device
¤
Provides a base class for USB serial devices.
Attributes¤
Classes¤
SerialDevice(port, baudrate)
¤
Bases: AbstractDevice
A base class for USB serial devices.
Note that it is not sufficient for a device type class to inherit from this class alone: it must also inherit from a device base class. When doing so, this class must be listed before any other parent classes, otherwise the ABC won't be able to find this class's implementation of close() and will complain about missing functions.
Create a new serial device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port
|
str
|
Description of USB port (vendor ID + product ID) |
required |
baudrate
|
int
|
Baud rate of port |
required |
Source code in frog/hardware/serial_device.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
Attributes¤
serial = _create_serial(port, baudrate, refresh=False)
instance-attribute
¤
Underlying serial device.
Functions¤
close()
¤
Close the connection to the device.
Source code in frog/hardware/serial_device.py
149 150 151 |
|