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

bluetooth/aioble/examples/temp_sensor.py: Properly notifies on update. #835

Merged
merged 2 commits into from
May 24, 2024

Conversation

mores
Copy link
Contributor

@mores mores commented Mar 25, 2024

No description provided.

@konistehrad
Copy link

I think this should be merged. The timeout_ms=None call in particular keeps something deep in the internals from blocking service queries from the central, and without this the central doesn't get timely updates.

@aetelani
Copy link

Thanks for example update. I was doing this myself because the current example in master was not working.

@dpgeorge
Copy link
Member

Thanks for the contribution. I can confirm that both fixes are needed:

  • for the char write, so that subscribers are notified
  • for the disconnected, so that the temp sensor remains connected until the central initiates a disconnect

mores added 2 commits May 24, 2024 18:03
This ensures that the peripheral notifies subscribed clients when the
characteristic is written to.

Signed-off-by: Stephen More <stephen.more@gmail.com>
This sets the disconnected timeout to None, so that the peripheral waits
forever for the client to disconnect.  Previously the peripheral would
abort the connection after 60 seconds (because that's the default timeout).

Signed-off-by: Stephen More <stephen.more@gmail.com>
@dpgeorge dpgeorge merged commit d4362d5 into micropython:master May 24, 2024
3 checks passed
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.

None yet

4 participants