class documentation
Represents a generic device tag.
Class Method | unpack |
Unpacks a bytes sequence into a tagDevice object. |
Method | pack |
Packs the tagDevice object into a bytes sequence. |
Class Variable | is |
Undocumented |
Class Variable | port |
Undocumented |
Class Variable | version |
Undocumented |
Unpacks a bytes sequence into a tagDevice object.
Parameters | |
data:bytes | The bytes to unpack, expected to be 3 bytes (3 uint8s). |
Returns | |
tagDevice | A tagDevice object. |
Raises | |
struct.error | If the input bytes are not the expected size (3 bytes). |
ValueError | If the unpacked byte value for version does not correspond to a valid TagVersionColorSensor enum member. |
Packs the tagDevice object into a bytes sequence.
Packs the isEnabled (boolean as uint8), port (uint8), and version (TagVersionColorSensor value as uint8) into a byte string. Uses little-endian byte order.
Returns | |
bytes | A bytes object representing the packed data (1 + 1 + 1 = 3 bytes). |