hvl_ccb.dev.sst_luminox.comm

Inheritance diagram of hvl_ccb.dev.sst_luminox.comm

class LuminoxSerialCommunication(configuration)[source]

Bases: SerialCommunication, SyncCommunicationProtocol

Specific communication protocol implementation for the SST Luminox oxygen sensor. Already predefines device-specific protocol parameters in config.

static config_cls()[source]

Return the default configdataclass class.

Returns:

a reference to the default configdataclass class

open() None[source]

Open the serial connection.

Raises:

SerialCommunicationIOError – when communication port cannot be opened.

class LuminoxSerialCommunicationConfig(terminator: bytes = b'\r\n', encoding: str = 'utf-8', encoding_error_handling: str = 'strict', wait_sec_read_text_nonempty: int | float = 0.5, default_n_attempts_read_text_nonempty: int = 10, port: str | None = None, baudrate: int = 9600, parity: str | hvl_ccb.comm.serial.SerialCommunicationParity = <SerialCommunicationParity.NONE: 'N'>, stopbits: int | hvl_ccb.comm.serial.SerialCommunicationStopbits = <SerialCommunicationStopbits.ONE: 1>, bytesize: int | hvl_ccb.comm.serial.SerialCommunicationBytesize = <SerialCommunicationBytesize.EIGHTBITS: 8>, timeout: int | float = 3, wait_sec_mode_switching: int | float = 0.5, wait_sec_update_mode_retry: int | float = 0.1, trials_update_mode_retry: int = 5)[source]

Bases: SerialCommunicationConfig

baudrate: int = 9600

Baudrate for SST Luminox is 9600 baud

bytesize: int | SerialCommunicationBytesize = 8

One byte is eight bits long

clean_values() None[source]
force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.

Parameters:
  • fieldname – name of the field

  • value – value to assign

classmethod keys() Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:

a list of strings containing all keys.

classmethod optional_defaults() dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:

a list of strings containing all optional keys.

parity: str | SerialCommunicationParity = 'N'

SST Luminox does not use parity

classmethod required_keys() Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:

a list of strings containing all required keys.

stopbits: int | SerialCommunicationStopbits = 1

SST Luminox does use one stop bit

terminator: bytes = b'\r\n'

The terminator is CR LF

timeout: int | float = 3

use 3 seconds timeout as default

trials_update_mode_retry: int = 5
wait_sec_mode_switching: int | float = 0.5
wait_sec_update_mode_retry: int | float = 0.1