Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Conversation

@MohammadAG
Copy link
Contributor

@MohammadAG MohammadAG commented Jan 26, 2018

This fixes #39 and fixes #59.

I'm not sure if this is the best fix for the issue: if CLSE is received, we attempt to re-read and see if it's CLSE again, in which case, the original behaviour is done.

I've been testing this for a few days on a Galaxy S7 & S8 (both Qualcomm), a US LG G6, all running Android 7.x, and Genymotion (6.0 and 7.0), and it seems to work fine.

@coveralls
Copy link

coveralls commented Jan 26, 2018

Coverage Status

Coverage decreased (-0.09%) to 47.483% when pulling 92efab6 on MohammadAG:clse_fix into 209d8fa on google:master.

'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’)

@fahhem fahhem merged commit 62cbf57 into google:master Feb 26, 2018
@fahhem
Copy link
Contributor

fahhem commented Feb 26, 2018

Thanks! Hopefully this doesn't cause regressions!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protocol: AttributeError: 'NoneType' object has no attribute 'ReadUntilClose' Demo code does not work

3 participants