Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add busy checks to peripheral, prevents error if scan or other operation is already running. #465

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RenierM26
Copy link

@RenierM26 RenierM26 commented Nov 6, 2021

This pull request should prevent connection errors when scan or other operation is in progress.

Comment on lines +450 to +452
if self._helper is None:
self._startHelper(iface)

Copy link
Author

Choose a reason for hiding this comment

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

Allows user to retry on "non terminal" errors without stopping helper.

Comment on lines +464 to 473
while rsp.get("state") and rsp["state"][0] in [
"tryconn",
"scan",
"disc",
]: # Wait for any operations to finish.
rsp = self._getResp("stat", timeout)

if rsp is None or rsp['state'][0] != 'conn':
self._stopHelper()
if rsp is None:
Copy link
Author

Choose a reason for hiding this comment

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

Simplifies code and won't give key error if rsp = None.

@RenierM26 RenierM26 changed the title Add busy checks to peripheral Add busy checks to peripheral, prevents error if scan or other operation is already running. Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant