Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri May 08 15:33:57 2015 +0100
Parent:
143:9d73e7f9f2bf
Child:
145:9f88997021a1
Commit message:
Synchronized with git rev 989c6290
Author: Rohit Grover
guard against repeated calls to ble_initializeSecurity()

Changed in this revision

btle/btle_security.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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;
 }