AKM Development Platform. This is the D7.014 version.

Dependencies:   AK09970 AK099XX AK7401 AK7451 AK8963X AK9750 AK9752 AkmSensor BLE_API I2CNano MCP342x SerialNano SpiNano TCA9554A mbed nRF51822

Fork of AKDP by Masahiko Fukasawa

Revision:
30:ea67020c9e05
Parent:
28:fe51b1ca4f6b
Child:
31:9f9246822fea
--- a/main.cpp	Fri Dec 09 18:23:45 2016 +0000
+++ b/main.cpp	Wed Jan 04 00:53:16 2017 +0000
@@ -3,6 +3,7 @@
 #include "mbed.h"
 #include "ble/BLE.h"
 #include "ble/services/UARTService.h"
+#include "ble/services/DFUService.h"
 #include "SerialNano.h"
 #include "akdphwinfo.h"
 #include "akmsensor.h"
@@ -26,11 +27,13 @@
 uint8_t id;
 uint8_t subId;
 
+/*
 enum {
     UNIT_0_625_MS = 625,
     UNIT_1_25_MS  = 1250,
     UNIT_10_MS    = 10000
 };
+*/
 
 // default setting of Nexus 5X, Motorola Droid Turbo:
 //#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(45, UNIT_1_25_MS)              /**< Minimum connection interval (45 ms) */
@@ -61,7 +64,6 @@
 
     uint8_t buf[BLE_BUF_LEN];
     uint16_t bytesRead;
-    
     if (Handler->handle == uartService->getTXCharacteristicHandle()) 
     {
         ble.gattServer().read(uartService->getTXCharacteristicHandle(), buf, &bytesRead);
@@ -341,7 +343,10 @@
     sprintf(str,"%s%s",str1,str2);
     return str;
 }
-
+/*
+void error(const char* format, ...) {
+}
+*/
 int main(void)
 {
     // USB serial
@@ -381,6 +386,11 @@
     // BLE initialize
     bleSetup(name);
     
+    /* Enable over-the-air firmware updates. Instantiating DFUSservice introduces a
+     * control characteristic which can be used to trigger the application to
+     * handover control to a resident bootloader. */
+    DFUService dfu(ble);
+    
     // BLE UART service
     uartService = new UARTService(ble);