← index #7654PR #7564
Related · high · value 0.152
QUERY · ISSUE

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

openby jimmoopened 2021-08-13updated 2021-08-14
extmod

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.

CANDIDATE · PULL REQUEST

extmod/modbluetooth: Add send_update arg to gatts_write.

closedby jimmoopened 2021-07-23updated 2021-08-14
extmod

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 https://github.com/micropython/micropython-lib/pull/436 @andrewleech @MarceauFillon

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied