devices.base
Base classes for RadEye device implementations.
Result of a remote-control command: (success, response)
where response is the device text or None on failure.
Base data class for all data classes.
Base data class for history status information.
Parameters
- display_unit: Display unit label
- raw_decimal: Raw decimal value
- display_unit_raw_decimal: Raw display unit code
Data class for data displayed on the device screen and status information.
Parameters
- values: List of values displayed on the device screen
- status: Status information. This can be:
radeye_comms_sdk.radeye.devices.g10.G10HistoryStatus,radeye_comms_sdk.radeye.devices.sx.SXHistoryStatus, orNoneif no status information is available.
Data class for autosend data frame.
Parameters
- data: Raw autosend payload string (without STX)
- checksum_ok: Whether the frame BCC validated
- parse_successful: Whether the frame split and field parse succeeded
- rates: Dose rate values
- rate_units: Unit code indices for each rate
- status_hex: Raw status word (hex field from frame)
- information: Device / model information string
- dose_in_uR_per_hour: Accumulated dose in µR/h
- bcc_hex: Trailing BCC from frame
- rate_unit_strs: Human-readable unit labels per rate
- status: Active alarm / status labels
Parse autosend payload into a radeye_comms_sdk.radeye.devices._base.AutosendData instance.
Parameters
- data: Raw autosend payload string (without STX)
- measurement_unit_bit_dict: Optional unit code → label map
- status_bit_dict: Optional status bit → alarm label map
Returns
Parsed
radeye_comms_sdk.radeye.devices._base.AutosendDatainstance
Base class for RadEye device serial protocol handlers.
Parameters
- port: Serial port name (e.g.
COM3or/dev/ttyUSB0) - baudrate: Baud rate for serial communication
- timeout: Timeout for serial responses (seconds)
Raises
- RuntimeError: If the serial port cannot be opened or an unexpected error occurs.
- ValueError: If the serial port is not found or permission is denied.
- Exception: If an unexpected error occurs while initializing the serial port.
Checks if the device is ready to send and receive commands.
Returns
True if the device is ready, False otherwise.
Initiates remote control and waiting for the RadEye response.
Returns
True if the remote control is initiated successfully, False otherwise.
Raises
- RuntimeError: If response from the RadEye is unexpected.
Sends a remote control command to the RadEye following the required protocol.
Parameters
- command: The command string to send.
Returns
(success, response) where success is True if the command is acknowledged and response is the data payload received from the RadEye as a string or None if an error occurs.
Raises
- RuntimeError: If the command is not acknowledged or an error occurs.
Reads the RadEye type, firmware version, and firmware checksum from the device.
Returns
(radeye_type, firmware_version, firmware_checksum)
Raises
- RuntimeError: If there is an error reading from the device or if the response format is unexpected.
Activates autosend.
Returns
True if the command is acknowledged, False otherwise.
Deactivates autosend.
Returns
True if the command is acknowledged, False otherwise.
Reads the autosend data from the RadEye device.
Returns
None if no data was received, otherwise the autosend data as a
radeye_comms_sdk.radeye.devices._base.AutosendDatainstance
Read the device serial number.
Returns
The serial number if successful, None otherwise
Read raw count rate with dead time correction. Abstract method to be implemented by subclasses.
Returns
None if no data was received, otherwise a list of the raw count rate
Read filtered count rate. Abstract method to be implemented by subclasses.
Returns
None if no data was received, otherwise a list of the filtered count rate
Read values displayed on the device screen and status information. Abstract method to be implemented by subclasses.
Returns
Noneif no data was received, otherwise aradeye_comms_sdk.radeye.devices._base.DisplayStatusDatainstance
Read measured dose rate. Abstract method to be implemented by subclasses.
Returns
None if no data was received, otherwise a list of the measured dose rate
Read measurement units. Abstract method to be implemented by subclasses.
Returns
None if no data was received, otherwise a dictionary of the parsed units
Get message publishers for the device. Abstract method to be implemented by subclasses.
Returns
A dictionary of dictionaries {topic name, radiation type, muliplication factor}
Parses the response based on the given bit description and returns a dictionary of the results.
Parameters
- hex_value: The hex value response to be parsed.
Returns
A dictionary with the parsed flags and corresponding descriptions: { "Hex_Value": hex_value, "Binary_Value": bin_value, "Flags": flags }