class documentation

class tagDevice: (source)

Constructor: tagDevice.unpack(data)

View In Hierarchy

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 isEnabled Undocumented
Class Variable port Undocumented
Class Variable version Undocumented
def unpack(cls, data: bytes) -> tagDevice: (source)

Unpacks a bytes sequence into a tagDevice object.

Parameters
data:bytesThe bytes to unpack, expected to be 3 bytes (3 uint8s).
Returns
tagDeviceA tagDevice object.
Raises
struct.errorIf the input bytes are not the expected size (3 bytes).
ValueErrorIf the unpacked byte value for version does not correspond to a valid TagVersionColorSensor enum member.
def pack(self) -> bytes: (source)

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
bytesA bytes object representing the packed data (1 + 1 + 1 = 3 bytes).
isEnabled: bool = (source)

Undocumented

Undocumented