Skip to content

extmod/modbluetooth: Add send_update arg to gatts_write. #7564

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

Closed
wants to merge 2 commits into from

Conversation

jimmo
Copy link
Member

@jimmo jimmo commented Jul 23, 2021

This allows a server to automatically notify/indicate subscribed clients on characteristic writes.

WIP: Needs btstack support and multi-tests. btstack support will take more work because we need to manage the CCCD state ourselves.

Related to #6848 #7555 micropython/micropython-lib#436 @andrewleech @MarceauFillon

@codecov-commenter
Copy link

Codecov Report

Merging #7564 (ad9cf09) into master (6214fa3) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7564      +/-   ##
==========================================
+ Coverage   98.27%   98.28%   +0.01%     
==========================================
  Files         154      154              
  Lines       19992    19995       +3     
==========================================
+ Hits        19648    19653       +5     
+ Misses        344      342       -2     
Impacted Files Coverage Δ
py/objenumerate.c 100.00% <0.00%> (ø)
py/runtime.c 99.39% <0.00%> (+0.15%) ⬆️
py/obj.c 96.82% <0.00%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6214fa3...ad9cf09. Read the comment docs.

@dpgeorge dpgeorge added the extmod Relates to extmod/ directory in source label Jul 26, 2021
@dpgeorge
Copy link
Member

This implementation has been chosen over #6848 and #7555.

This allows the write to trigger a notification or indication, but only to
subscribed clients. This is different to gatts_notify/gatts_indicate,
which will unconditionally notify/indicate.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@jimmo jimmo force-pushed the nimble-update-subscribers branch from ad9cf09 to 445d2f7 Compare August 13, 2021 14:24
@jimmo
Copy link
Member Author

jimmo commented Aug 13, 2021

Added multi-test for subscription (both for client subscribing and server sending indications/notifications).

This tests both sending indications/notifications from a server to
subscribed clients via gatts_write(...,send_update=True) and subscribing
from a client.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@jimmo jimmo force-pushed the nimble-update-subscribers branch from 445d2f7 to ba118c1 Compare August 13, 2021 14:37
@dpgeorge
Copy link
Member

Merged in 1d9e489 and c70930f

@dpgeorge dpgeorge closed this Aug 14, 2021
kamtom480 pushed a commit to kamtom480/micropython that referenced this pull request Feb 13, 2023
Update build_board_info.py to sh module 2.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extmod Relates to extmod/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants