MRP.MRPHalLocal
class for interfacing (hardware, protocol) sensors running the UnifiedSensorFirmware
- class MRPHalLocal.MRPHalLocal(_selected_port: <module 'MRP.MRPHalSerialPortInformation' from '/home/docs/checkouts/readthedocs.org/user_builds/magneticreadoutprocessing/checkouts/latest/src/MagneticReadoutProcessing/MRP/MRPHalSerialPortInformation.py'>, _type: ~MRP.MRPHalSerialPortInformation.MRPRemoteSensorType = MRPRemoteSensorType.BaseSensor)
Baseclass for hardware sensor interaction using a serial interface. It contains functions to send rec commands from/to the sensor but no interpretation
- connect() bool
connect to the selected serial port
- Returns:
returns true if a serial connection was made
- Return type:
- disconnect()
disconnects a opened serial port
- get_sensor_capabilities() [<class 'str'>]
returns the sensor capabilities defined in the sensor firmware as string list
- Returns:
capabilities e.g. static, axis_x,..
- Return type:
[str]
- get_sensor_count() int
returns the connected sensors relevant for chained sensors
- Returns:
sensor count
- Return type:
- get_sensor_names() [<class 'str'>]
returns the sensor names defined in the sensor firmware as string list
- Returns:
capabilities e.g. static, axis_x,..
- Return type:
[str]
- is_connected() bool
returns true if the serial port is open
- Returns:
returns true if a serial connection is open
- Return type:
- send_command(_cmd: str) [<class 'str'>]
sends a command to the sensor
- param _cmd:
command like help id read…
- type _cmd:
str
- returns:
returns sensor response as line separated by ‘
- ‘
- rtype:
[str]
- set_serial_port_information(_port: <module 'MRP.MRPHalSerialPortInformation' from '/home/docs/checkouts/readthedocs.org/user_builds/magneticreadoutprocessing/checkouts/latest/src/MagneticReadoutProcessing/MRP/MRPHalSerialPortInformation.py'>)
set the serial port information = which serial port to connect to if the connect() function is called
- Parameters:
_port (MRPHalSerialPortInformation) – serial port information