class documentation
Represents a TRIG (Trigger) command.
Class Method | unpack |
Unpacks a bytes sequence into a tagTRIGCmd object. |
Method | pack |
Packs the tagTRIGCmd object into a bytes sequence. |
Class Variable | address |
Undocumented |
Class Variable | condition |
Undocumented |
Class Variable | mode |
Undocumented |
Class Variable | threshold |
Undocumented |
Unpacks a bytes sequence into a tagTRIGCmd object.
Parameters | |
data:bytes | The bytes to unpack, expected to be 5 bytes (3 uint8s + 1 uint16). |
Returns | |
tagTRIGCmd | A tagTRIGCmd object. |
Raises | |
struct.error | If the input bytes are not the expected size (5 bytes). |
ValueError | If the unpacked byte values for mode or condition do not correspond to valid enum members. |
Packs the tagTRIGCmd object into a bytes sequence.
Packs the address (uint8), mode (TriggerMode value as uint8), condition (TriggerCondition value as uint8), and threshold (uint16) into a byte string. Uses little-endian byte order.
Returns | |
bytes | A bytes object representing the packed data (1 + 1 + 1 + 2 = 5 bytes). |