-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Bluetooth: gatt: CCC cfg not flushed if device was previously paired #22514
Comments
The callback is indicating 0 when there is no active connection so the application can stop notifying, this seems to be a regression where a new slot is taken everytime. |
@Vudentz yes, this is what is happening. I checked the array in debug mode and it was full of identical addresses, i updated the description |
find_ccc_cfg is never able to find the original cfg then? |
Yes that’s what happens, and then they are just repeated |
I was not able to reproduce with the shell and central_hr, I did: setup: 2 btvirt instances using native_posix
*I will send a patch that updates the shell to be able to connect to central_hr since that is expecting an UUID. |
Hmm, there is a bug in the central_hr though, it is not tracking if it has been subscribed already perhaps that has something to do with the problem. |
In my test I reset the central between cycles, so it is not affected if it was already subscribed in the past |
Also @Vudentz I just realized that you didnt do
This time i was doing the connect/subscribe operations of the central using the NRF app to remove any possible bugs introduced by the central_hr project |
Check if the following patch helps:
|
No help with the patch :/, I looked a bit more into the code and the registers during debug and found the following:
@Vudentz Is there a particular reason why |
So this is a combination of:
I guess we didn't have bt_unpair when we introduced bt_gatt_clear, but you are right that we should probably clear the ccc no matter if BT_SETTINGS is enabled or not. |
GATT data shall not be considered conditional to BT_SETTINGS since the data is stored in RAM it must also be cleared when unpairing. Fixes zephyrproject-rtos#22514 Signed-off-by: Luiz Augusto von Dentz <[email protected]>
GATT data shall not be considered conditional to BT_SETTINGS since the data is stored in RAM it must also be cleared when unpairing. Fixes #22514 Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Describe the bug
The CCC cfg is not freed/flushed when a paired device disconnects from the peripheral; however, the
ccc_cfg_changed()
callback of the descriptor gets called withvalue = 0
. This leads to the CCC cfg buffer becoming full, the warningbt_gatt: No space to store CCC cfg
to be raised, and no more subscriptions to be allowed.While debugging, I confirmed that the CCC cfg array was indeed full of identical addresses with notifications active.
To Reproduce
Steps to reproduce the behavior:
peripheral_hr
andcentral_hr
and make them pair after subscription (I have only tested it using fixed passkey pairing and legacy oob pairing)<wrn> bt_gatt: No space to store CCC cfg
is raised (For me it took 4 cycles on one project, and 2 cycles on another one)Expected behavior
The connect - subscribe - disconnect cycle should have kept going perpetually
Screenshots or console output
Environment (please complete the following information):
Peripheral configuration:
The text was updated successfully, but these errors were encountered: