BaseDevice¶
- class lsst.ts.ess.common.device.BaseDevice(name: str, device_id: str, sensor: BaseSensor, baud_rate: int, callback_func: Callable, log: Logger)¶
Bases:
ABC
Base class for the different types of Sensor Devices.
This class holds all common code for the hardware devices. Device specific code (for instance for a serial or an FTDI device) needs to be implemented in a sub-class.
- Parameters:
- name
str
The name of the device.
- device_id
str
The hardware device ID to connect to. This can be a physical ID (e.g. /dev/ttyUSB0), a serial port (e.g. serial_ch_1) or any other ID used by the specific device.
- sensor
BaseSensor
The sensor that produces the telemetry.
- baud_rate
int
The baud rate of the sensor.
- callback_func
Callable
Callback function to receive the telemetry.
- log
logging.Logger
The logger to create a child logger for.
- name
Methods Summary
Close the Sensor Device.
Open the Sensor Device.
close
()Generic close function.
open
()Generic open function.
readline
()Read a line of telemetry from the device.
Methods Documentation
- async close() None ¶
Generic close function.
Stop the telemetry loop. Then check if the device is open and, if yes, call basic_close.