While debugging an issue where a bonded Android app didn't handle characteristics that were moved and deleted correctly,
I noticed that the peer manager can detect if the configuration has changed.
(The issue was caused by some too aggressive caching in the app)
While the peer manager correctly detected the change I stared wondering how it does so?
Surely it doesn't store the entire UUID->handle mapping per bonded peer,
as it would take up too much flash space even if it would make detecting moved characteristics trivial.
I started look though the source code and quickly ended up at:
SVCALL(SD_BLE_GATTS_SYS_ATTR_SET, uint32_t, sd_ble_gatts_sys_attr_set(uint16_t conn_handle, uint8_t const *p_sys_attr_data, uint16_t len, uint32_t flags));
which gatts_cache_manager.c uses to "determine" if the database is still valid.
Being a SD call it is hard to debug, but the comments gave a hint
"The format of the data is described in @ref BLE_GATTS_SYS_ATTRS_FORMAT"
I was however unable to locate any file containing this format information.
The reason why I'm interested in knowing how it detects the change is,
that it would allow me to reduce the chance that a service/character change would go unnoticed.
Tags: SDK14.2, s132_nrf52_5.1.0, S132, Bonding, Service Changed
Regards Visti Andresen