Compilation fix for newer mbed-os

Fork of X_NUCLEO_IDB0XA1 by ST

Branch:
5d71c4ee51a741fa3aabe0b7ad4b814d7bf27aee
Revision:
268:c0a1e03c5736
Parent:
267:cd7870e466b3
Child:
269:cd037b36a62b
--- a/source/platform/btle.cpp	Thu Sep 15 10:51:30 2016 +0100
+++ b/source/platform/btle.cpp	Thu Sep 15 10:51:31 2016 +0100
@@ -160,9 +160,6 @@
     }
 #endif
 
-    const Gap::Address_t BLE_address_BE = {0xFD,0x66,0x05,0x13,0xBE,0xBA};
-    BlueNRGGap::getInstance().setAddress(BLEProtocol::AddressType::RANDOM_STATIC, BLE_address_BE);
-
     ret = aci_gatt_init();
     if(ret != BLE_STATUS_SUCCESS){
         PRINTF("GATT_Init failed.\n");
@@ -178,6 +175,15 @@
         ret = aci_gap_init_IDB04A1(role, &service_handle, &dev_name_char_handle, &appearance_char_handle);
     }
 
+    // read the default static address and inject it into the GAP object
+    {
+        Gap::Address_t BLE_address_BE = { 0 };
+        uint8_t data_len_out;
+        aci_hal_read_config_data(CONFIG_DATA_RANDOM_ADDRESS_IDB05A1, BDADDR_SIZE, &data_len_out, BLE_address_BE);
+        // FIXME error handling of this function
+        BlueNRGGap::getInstance().setAddress(BLEProtocol::AddressType::RANDOM_STATIC, BLE_address_BE);
+    }
+
     if(ret != BLE_STATUS_SUCCESS){
         PRINTF("GAP_Init failed.\n");
     }