class documentation

class tagPTPCmd: (source)

Constructor: tagPTPCmd.unpack(data)

View In Hierarchy

Represents a PTP command.

Class Method unpack Unpacks a bytes sequence into a tagPTPCmd object.
Method pack Packs the tagPTPCmd object into a bytes sequence.
Class Variable ptpMode Undocumented
Class Variable r Undocumented
Class Variable x Undocumented
Class Variable y Undocumented
Class Variable z Undocumented
def unpack(cls, data: bytes) -> tagPTPCmd: (source)

Unpacks a bytes sequence into a tagPTPCmd object.

Parameters
data:bytesThe bytes to unpack, expected to be 33 bytes (1 uint8 + 4 doubles).
Returns
tagPTPCmdA tagPTPCmd object.
Raises
struct.errorIf the input bytes are not the expected size (33 bytes).
ValueErrorIf the unpacked byte value for ptpMode does not correspond to a valid PTPMode enum member.
def pack(self) -> bytes: (source)

Packs the tagPTPCmd object into a bytes sequence.

Packs the ptpMode (PTPMode value as uint8) and the x, y, z, r (floats) into a byte string. Uses little-endian byte order.

Returns
bytesA bytes object representing the packed data (1 byte + 4 * 8 bytes = 33 bytes).

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented