Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion adb/adb_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,12 @@ def Open(cls, usb, destination, timeout_ms=None):
raise InvalidResponseError(
'Expected the local_id to be %s, got %s' % (local_id, their_local_id))
if cmd == b'CLSE':
# Some devices seem to be sending CLSE once more after a request, this *should* handle it
cmd, remote_id, their_local_id, _ = cls.Read(usb, [b'CLSE', b'OKAY'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the extra CLSE only sent after a bad OPEN? I thought it was anytime a CLSE was sent?

Copy link
Contributor Author

@MohammadAG MohammadAG Jan 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried having another read after a CLSE and before the next OPEN, but that caused a crash (failure to unpack with a response containing ‘<6I’)

timeout_ms=timeout_ms)
# Device doesn't support this service.
return None
if cmd == b'CLSE':
return None
if cmd != b'OKAY':
raise InvalidCommandError('Expected a ready response, got %s' % cmd,
cmd, (remote_id, their_local_id))
Expand Down