Nordic stack and drivers for the mbed BLE API Modified for HRM 1017 and correct DISCONNECT event processing

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
todotani
Date:
Sat Sep 06 08:03:38 2014 +0000
Parent:
60:e861f2041469
Commit message:
nRF51822 modified for HRM1017 and correct DISCONNECT event processing.

Changed in this revision

btle/btle.cpp Show annotated file Show diff for this revision Revisions of this file
projectconfig.h Show annotated file Show diff for this revision Revisions of this file
diff -r e861f2041469 -r 97823585e091 btle/btle.cpp
--- a/btle/btle.cpp	Tue Sep 02 17:01:18 2014 +0100
+++ b/btle/btle.cpp	Sat Sep 06 08:03:38 2014 +0000
@@ -63,7 +63,11 @@
 error_t btle_init(void)
 {
     const bool useScheduler = false;
+#ifdef TARGET_HRM1017
+    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, false);
+#else
     SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, useScheduler);
+#endif
 
     // Enable BLE stack
     /**
@@ -136,9 +140,12 @@
 #if NEED_BOND_MANAGER /* disabled by default */
             ASSERT_STATUS_RET_VOID ( ble_bondmngr_bonded_centrals_store());
 #endif
-
             if (p_ble_evt->evt.gap_evt.params.disconnected.reason == BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION) {
                 nRF51Gap::getInstance().processDisconnectionEvent(handle, Gap::LOCAL_HOST_TERMINATED_CONNECTION);
+            } else if (p_ble_evt->evt.gap_evt.params.disconnected.reason == BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION) {
+                nRF51Gap::getInstance().processDisconnectionEvent(handle, Gap::REMOTE_USER_TERMINATED_CONNECTION);
+            } else {
+                nRF51Gap::getInstance().processDisconnectionEvent(handle, Gap::CONN_INTERVAL_UNACCEPTABLE);
             }
             break;
         }
diff -r e861f2041469 -r 97823585e091 projectconfig.h
--- a/projectconfig.h	Tue Sep 02 17:01:18 2014 +0100
+++ b/projectconfig.h	Sat Sep 06 08:03:38 2014 +0000
@@ -113,7 +113,7 @@
 
     /*--------------------------------- GAP -------------------------------*/
     #define CFG_GAP_APPEARANCE                         BLE_APPEARANCE_GENERIC_TAG
-    #define CFG_GAP_LOCAL_NAME                         "nRF5x"
+    #define CFG_GAP_LOCAL_NAME                         "HRM1017"
 
     #define CFG_GAP_CONNECTION_MIN_INTERVAL_MS           50                     /**< Minimum acceptable connection interval */
     #define CFG_GAP_CONNECTION_MAX_INTERVAL_MS          500                     /**< Maximum acceptable connection interval */