Open alstrzebonski opened 8 months ago
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
@alstrzebonski would you be able to come up with a patch for this? It seems you analyzed the issue pretty well.
@alstrzebonski would you be able to come up with a patch for this? It seems you analyzed the issue pretty well.
I'm sorry for the late response. I will need to see if I have the capacity to make the fix. I will get back to you after sprint planning. In most of our projects we have the CCC Lazy Loading enabled so the issue doesn't affect us currently. However, it may come up in the future.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
I will fix this issue. I have it in my TODO list, but I struggle with finding the capacity for it.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
Please remove the stale label. I will fix it.
Describe the bug The scenario is as follows:
identity_resolved
callback, the RPA address instruct bt_gatt_ccc_cfg cfg[]
array insubsys/bluetooth/host/gatt.c
is converted to peer's identity address. We end up withstruct bt_gatt_ccc_cfg cfg[]
array that has two slots occupied by two CCCs with the same peer address. It can prevent new devices from writing CCC because there may be no more space in RAM for new CCCs as thestruct bt_gatt_ccc_cfg cfg[]
array length is equal to(CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
. Moreover, the newer CCC is never written to flash, because on save operation, the program iterates through the array and when it finds CCC with address that matches the bond address, it saves this address and stops iterating, so it never reaches the 2nd CCC. On reboot, new CCC disappears from thecfg
array as it was never saved in flash.When CCC Lazy Loading is enabled, the problem doesn't occur. The CCC is updated in flash after the peer bonds again.
When the peer connects from its identity address instead of RPA address, the problem also doesn't occur, because the CCC is overwritten immediately (new CCC has the same peer address as the old one).
To Reproduce Steps to reproduce the behavior:
No space to store CCC cfg
. That's because thecfg
array is full.Expected behavior The CCC write should succeed regardless of CONFIG_BT_SETTINGS_CCC_LAZY_LOADING being enabled or not and regardless of RPA address being used or not. On
identity_resolved
callback, the CCCs with the same address should be merged - new CCC should overwrite the old one.Impact Google Fast Pair Service protocol (https://developers.google.com/nearby/fast-pair/specifications/introduction) requires using GATT before bonding. Because of that, if a phone loses bond multiple times, it is unable to bond again using Fast Pair, because it is unable to write CCC when CONFIG_BT_SETTINGS_CCC_LAZY_LOADING is disabled and
cfg
array is full.Environment (please complete the following information):