Skip to content
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

Connection handle is 0xFFFF in attribute access callback when ble_gatts_notify() is called. #1417

Open
SumeetSingh19 opened this issue Dec 8, 2022 · 0 comments

Comments

@SumeetSingh19
Copy link

SumeetSingh19 commented Dec 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant