Bypass pyusb Device I/O on WinUSB with direct libusb bulk transfers

Device.write/read always call get_configuration which WinUSB does not
implement. Route all framed I/O through the backend with IF5 claimed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
joyharam
2026-07-15 11:29:01 +09:00
parent 7627c17653
commit ff60cee1cc
3 changed files with 114 additions and 63 deletions
+6 -1
View File
@@ -193,7 +193,12 @@ class Session:
try:
self.send(MsgType.HELLO, self.peer_name.encode("utf-8"))
except Exception as exc:
self.log(f"HELLO 재전송 실패: {exc}")
# Peer not reading yet (FIFO full) → USB timeout; keep retrying quietly.
msg = str(exc)
if "timed out" in msg.lower() or "timeout" in msg.lower():
self.log("상대 수신 대기 중… (HELLO)")
else:
self.log(f"HELLO 재전송 실패: {exc}")
self._connected.wait(timeout=min(2.0, remaining))
return self._peer_hello or "peer"