class documentation
Represents a PTP command including an additional 'l' parameter.
Class Method | unpack |
Unpacks a bytes sequence into a tagPTPWithLCmd object. |
Method | pack |
Packs the tagPTPWithLCmd object into a bytes sequence. |
Class Variable | l |
Undocumented |
Class Variable | ptp |
Undocumented |
Class Variable | r |
Undocumented |
Class Variable | x |
Undocumented |
Class Variable | y |
Undocumented |
Class Variable | z |
Undocumented |
Unpacks a bytes sequence into a tagPTPWithLCmd object.
Parameters | |
data:bytes | The bytes to unpack, expected to be 41 bytes (1 uint8 + 5 doubles). |
Returns | |
tagPTPWithLCmd | A tagPTPWithLCmd object. |
Raises | |
struct.error | If the input bytes are not the expected size (41 bytes). |
ValueError | If the unpacked byte value for ptpMode does not correspond to a valid PTPMode enum member. |
Packs the tagPTPWithLCmd object into a bytes sequence.
Packs the ptpMode (PTPMode value as uint8) and the x, y, z, r, l (floats) into a byte string. Uses little-endian byte order.
Returns | |
bytes | A bytes object representing the packed data (1 byte + 5 * 8 bytes = 41 bytes). |