Connection handle is 0xFFFF in attribute access callback when ble_gatts_notify() is called.
- Dominant language
- C
- Stars
- 893
- Forks
- 512
- Avg merge
- 13d 31m
- Merged PRs (30d)
- 7
Description
Whenever the server application calls `ble_gatts_notify` there is a characteristic read event (`access_cb`) and the connection handle passed to that event is 0xFFFF.
The issue exists because `ble_gatts_notify` calls `ble_gatts_notify_custom` with `txom` set to `NULL`.
In `ble_gattc_notify_custom`, if `txom` is `NULL`, it fills the buffer with data from the same attribute whose handle is passed to `ble_gatts_notify_custom`.
The way it does that is by calling the access callback of that attribute through `ble_att_svr_read_handle`, and it specifies the connection handle as `BLE_HS_CONN_HANDLE_NONE`, which is `0xFFFF`.
So server application gets an invalid connection handle when notifying a client.
Contributor guide
No contributing guide indexed for this repository
Research direction
Trace the ble_gatts_notify to ble_gatts_notify_custom path, then inspect how ble_gattc_notify_custom invokes ble_att_svr_read_handle and passes the connection handle to the access callback. Reproduce a notification from a server application and verify that the callback no longer receives BLE_HS_CONN_HANDLE_NONE (0xFFFF).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100