add implicit call to preserve state on reset

pull/14824/head
Paul Szczepanek 2021-06-28 19:38:13 +01:00
parent c9d0ff8674
commit 470917f9ab
2 changed files with 5 additions and 2 deletions

View File

@ -514,8 +514,7 @@ public:
* Some or all of bonding information may be stored in memory while in use. This will write * Some or all of bonding information may be stored in memory while in use. This will write
* bonding data to persistent storage. This will have no effect if no persistent storage is enabled. * bonding data to persistent storage. This will have no effect if no persistent storage is enabled.
* *
* @note You still need to call preserveBondingStateOnReset(true) before reset happens for data to be * @note This implicitly also calls preserveBondingStateOnReset(true) inside.
* loaded when it's read.
* *
* @note Depending on the driver used to implement the storage solution used this may be a disruptive * @note Depending on the driver used to implement the storage solution used this may be a disruptive
* operation and may cause active connections to drop due to failed processing deadlines. * operation and may cause active connections to drop due to failed processing deadlines.

View File

@ -49,6 +49,10 @@ ble_error_t SecurityManager::preserveBondingStateOnReset(bool enable)
ble_error_t SecurityManager::writeBondingStateToPersistentStorage() ble_error_t SecurityManager::writeBondingStateToPersistentStorage()
{ {
ble_error_t err = impl->preserveBondingStateOnReset(true);
if (err) {
return err;
}
return impl->writeBondingStateToPersistentStorage(); return impl->writeBondingStateToPersistentStorage();
} }