Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: microbit_rubber_ducky microbit_mouse_BLE microbit_mouse_BLE_daybreak_version microbit_presenter
Fork of nRF51822 by
Diff: btle/btle_security.cpp
- Revision:
- 144:9d8fce4b4d5a
- Parent:
- 143:9d73e7f9f2bf
- Child:
- 147:457a129dfa5e
--- a/btle/btle_security.cpp Fri May 08 15:33:57 2015 +0100
+++ b/btle/btle_security.cpp Fri May 08 15:33:57 2015 +0100
@@ -26,6 +26,12 @@
ble_error_t
btle_initializeSecurity()
{
+ /* guard against multiple initializations */
+ static bool initialized = false;
+ if (initialized) {
+ return BLE_ERROR_NONE;
+ }
+
if (pstorage_init() != NRF_SUCCESS) {
return BLE_ERROR_UNSPECIFIED;
}
@@ -67,6 +73,7 @@
}
}
+ initialized = true;
return BLE_ERROR_NONE;
}
