class documentation

class tagEMOTOR: (source)

Constructor: tagEMOTOR.unpack(data)

View In Hierarchy

Represents an EMOTOR command.

Class Method unpack Unpacks a bytes sequence into a tagEMOTOR object.
Method pack Packs the tagEMOTOR object into a bytes sequence.
Class Variable address Undocumented
Class Variable insEnabled Undocumented
Class Variable speed Undocumented
def unpack(cls, data: bytes) -> tagEMOTOR: (source)

Unpacks a bytes sequence into a tagEMOTOR object.

Parameters
data:bytesThe bytes to unpack, expected to be 10 bytes (2 uint8s + 1 double).
Returns
tagEMOTORA tagEMOTOR object.
Raises
struct.errorIf the input bytes are not the expected size (10 bytes).
ValueErrorIf the unpacked byte value for index does not correspond to a valid EMotorIndex enum member.
def pack(self) -> bytes: (source)

Packs the tagEMOTOR object into a bytes sequence.

Packs the index (EMotorIndex value as uint8), insEnabled (boolean as uint8), and speed (double) into a byte string. Uses little-endian byte order.

Returns
bytesA bytes object representing the packed data (1 + 1 + 8 = 10 bytes).

Undocumented

insEnabled: bool = (source)

Undocumented

Undocumented