MRP.MRPHalSerialPortInformation

class MRPHalSerialPortInformation.MRPHalSerialPortInformation(_path: str, _name: str = 'Unified Sensor', _baudrate: int = 115200)

A little helper-class to store name and serial port device path

static check_serial_number(_serial_number: str) bool

This function is implements a simple lookup table to check for connected sensor using the vid:pid or usb serial number. Its just a precheck to indicate a possible connected sensor to the user. Add your own sensor ids into the SERIAL_LUT variable

Parameters:

_serial_number (str) – given usb serial number

Returns:

true if serial number is a valid sensor

Return type:

bool

is_valid() bool

check if the _path exist in the filesystem

Returns:

returns true if the path is valid (path exists)

Return type:

bool

static list_serial_ports(_filter_devicepath: str = '.+', _blacklist_devicepath: [<class 'str'>] = ['/dev/cu.Bluetooth-Incoming-Port']) []

Returns all found serial ports on the system The function returns the max value of (x,y,z) or (d,h)

Parameters:
  • _filter_devicepath (str) – regex filter for filtering device paths e.g. /dev/tty*

  • _blacklist_devicepath ([str]) – blacklist specified device paths e.g. bluetooth port on Mac systems ‘/dev/cu.Bluetooth-Incoming-Port’

Returns:

returns a list of MRPHalSerialPortInformation instance with serial port name and device path

Return type:

[MRPHalSerialPortInformation]

exception MRPHalSerialPortInformation.MRPHalSerialPortInformationException(message='MRPHalSerialPortInformationException thrown')
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class MRPHalSerialPortInformation.MRPHalType(value)

An enumeration.

class MRPHalSerialPortInformation.MRPRemoteSensorType(value)

An enumeration.