mirror of https://github.com/ARMmbed/mbed-os.git
add implicit call to preserve state on reset
parent
c9d0ff8674
commit
470917f9ab
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue