Skip to content

nimble: Indicating a characteristic will also send indications for other characteristics. #7654

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

Open
jimmo opened this issue Aug 13, 2021 · 2 comments
Labels
extmod Relates to extmod/ directory in source

Comments

@jimmo
Copy link
Member

jimmo commented Aug 13, 2021

Related to the send_update arg added to ble.gatts_write in #7564.

The following code on a server (with a connected but unsubscribed client) results in the client receiving an indication for both characteristics.

ble.gatts_write(first_char_handle, "value", True)  # (1)
ble.gatts_write(second_char_handle, "value", False)
ble.gatts_indicate(conn_handle, second_char_handle)   # (2)

I would expect:

  • (1) should not be sent to an unsubscribed client.
  • (2) should only trigger an indication for second_char_handle (regardless of subscription state).

It's not obvious to me that this is being caused by modbluetooth.c / modbluetooth_nimble.c, so might need to investigate in NimBLE (or confirm that this is the expected behaviour). I don't see this for notify, only indicate.

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

Might be worth checking the behaviour against BTstack.

@jimmo
Copy link
Member Author

jimmo commented Aug 14, 2021

As far as I can tell, bluekitchen doesn't implement subscription (which is why #7564 is NimBLE-only) -- we need to implement handling of writes to the CCCD ourselves.

tannewt pushed a commit to tannewt/circuitpython that referenced this issue Feb 28, 2023
8.0.x Backport of micropython#7652 ("soft reboot" printing); update frozen libraries
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

No branches or pull requests

2 participants