nimble: Indicating a characteristic will also send indications for other characteristics.
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.
modbluetooth: Add event for "indicate acknowledgement".
Added IRQ_GATTS_INDICATE_DONE which will be raised with the status of an gatts_indicate. (Unlike notify, indications require acknowledgement).
Added example to ble_temperature.py and to the multitests in ble_characteristic.py.
Implemented for btstack and nimble, tested in both directions between unix/btstack and pybd/nimble.