class documentation

class tagEMOTORDistance: (source)

Constructor: tagEMOTORDistance.unpack(data)

View In Hierarchy

Represents an EMOTOR distance 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 distance Undocumented
Class Variable insEnabled Undocumented
Class Variable speed Undocumented

Unpacks a bytes sequence into a tagEMOTOR object.

Parameters
data:bytesThe bytes to unpack, expected to be 10 bytes (2 uint8s + 1 double).
Returns
tagEMOTORDistanceA 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

distance: int = (source)

Undocumented

insEnabled: bool = (source)

Undocumented

Undocumented