Hello,
There are functions such as sd_ble_gatts_service_add. But, how do I clear the Attribute Table to replace it with a new one? I want to do this switching at runtime, but I see no function at all to do anything but add to it.
Thanks!
James
Hello,
There are functions such as sd_ble_gatts_service_add. But, how do I clear the Attribute Table to replace it with a new one? I want to do this switching at runtime, but I see no function at all to do anything but add to it.
Thanks!
James
HI James,
the only way to clear the Attribute table is to uninitialize the BLE protocol stack and then reinitialize the BLE protocol stack and then add the new services/characteristics/descriptors using sd_ble_gatts_service/characteristic/descriptor _add().
Best regards
Bjørn
Are all of the libraries coded to support this case properly (nrf_sdh_disable_request I assume), or would it be better to do it using NVIC_SystemReset? Thanks!
Yes, nrf_sdh_disable_request() is the gentle way. You can also call sd_softdevice_disable() directly. Using one of the two former calls avoids a reset, but calling NVIC_SystemReset() is also an option, but then you would have to use a retained register or a flag stored in flash to decide how the ATT table should be populated.