Lancaster University's fork of the mbed BLE API. Lives on github, https://github.com/lancaster-university/BLE_API

Dependents:   microbit-dal microbit-dal microbit-ble-open microbit-dal ... more

Fork of BLE_API by Bluetooth Low Energy

Revision:
966:9451b90bbb66
Parent:
952:8a6c287de1be
Child:
967:7e304dcc3a73
diff -r 212c16f6247f -r 9451b90bbb66 ble/services/DFUService.h
--- a/ble/services/DFUService.h	Thu Nov 26 12:52:34 2015 +0000
+++ b/ble/services/DFUService.h	Thu Nov 26 12:52:34 2015 +0000
@@ -20,7 +20,9 @@
 #include "ble/BLE.h"
 #include "ble/UUID.h"
 
-extern "C" void bootloader_start(void);
+extern "C" {
+#include "dfu_app_handler.h"
+}
 
 extern const uint8_t  DFUServiceBaseUUID[];
 extern const uint16_t DFUServiceShortUUID;
@@ -101,7 +103,13 @@
                 handoverCallback();
             }
 
-            bootloader_start();
+            // Call bootloader_start trough a event handler
+            // it is a work around for bootloader_start not being public in sdk 8.1
+            ble_dfu_t *p_dfu;
+            p_dfu-> conn_handle = params->connHandle;
+            ble_dfu_evt_t *p_evt;
+            p_evt->ble_dfu_evt_type = BLE_DFU_START;
+            dfu_app_on_dfu_evt(p_dfu, p_evt);
         }
     }