MCPcopy Create free account
hub / github.com/LeoDJ/P2Pro-Viewer / _long_cmd_read

Method _long_cmd_read

P2Pro/P2Pro_cmd.py:127–138  ·  view source on GitHub ↗
(self, cmd: int, p1: int, p2: int = 0, p3: int = 0, dataLen: int = 2)

Source from the content-addressed store, hash-verified

125 self._block_until_camera_ready()
126
127 def _long_cmd_read(self, cmd: int, p1: int, p2: int = 0, p3: int = 0, dataLen: int = 2):
128 data1 = struct.pack("<H", cmd)
129 data1 += struct.pack(">HI", p1, p2)
130 data2 = struct.pack(">II", p3, dataLen)
131 log.debug(f'l_cmd_r {0x9d00:#x} {data1.hex()}')
132 log.debug(f'l_cmd_r {0x1d08:#x} {data2.hex()} ')
133 self._dev.ctrl_transfer(0x41, 0x45, 0x78, 0x9d00, data1)
134 self._dev.ctrl_transfer(0x41, 0x45, 0x78, 0x1d08, data2)
135 self._block_until_camera_ready()
136 log.debug(f'l_cmd_r {0x1d10:#x} ...')
137 res = self._dev.ctrl_transfer(0xC1, 0x44, 0x78, 0x1d10, dataLen)
138 return bytes(res)
139
140 def _standard_cmd_write(self, cmd: int, cmd_param: int = 0, data: bytes = b'\x00', dataLen: int = -1):
141 """

Callers 1

get_prop_tpd_paramsMethod · 0.95

Calls 1

Tested by

no test coverage detected