Nordic stack and drivers for the mbed BLE API Modified for HRM1017 for library 0.1.0

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
Rohit Grover
Date:
Thu Jun 26 14:06:37 2014 +0100
Parent:
31:c3ce6ee5d300
Child:
33:8efbbf54b66f
Commit message:
disabling the bond-manager module; will be re-enabled as necessary
was consuming excessive amounts of memory which is already in short supply.

Changed in this revision

btle/btle.cpp Show annotated file Show diff for this revision Revisions of this file
nordic/ble/ble_bondmngr.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/btle/btle.cpp	Fri Jun 13 11:21:09 2014 +0100
+++ b/btle/btle.cpp	Thu Jun 26 14:06:37 2014 +0100
@@ -36,13 +36,17 @@
 #include "nRF51Gap.h"
 #include "nRF51GattServer.h"
 
+#if NEED_BOND_MANAGER /* disabled by default */
 static void service_error_callback(uint32_t nrf_error);
+#endif
 void        assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name);
 void        app_error_handler(uint32_t       error_code,
                               uint32_t       line_num,
                               const uint8_t *p_file_name);
 
+#if NEED_BOND_MANAGER /* disabled by default */
 static error_t bond_manager_init(void);
+#endif
 
 static void btle_handler(ble_evt_t *p_ble_evt);
 
@@ -71,7 +75,9 @@
     ASSERT_STATUS( softdevice_ble_evt_handler_set(btle_handler));
     ASSERT_STATUS( softdevice_sys_evt_handler_set(sys_evt_dispatch));
 
+#if NEED_BOND_MANAGER /* disabled by default */
     bond_manager_init();
+#endif
     btle_gap_init();
 
     return ERROR_NONE;
@@ -89,7 +95,9 @@
 static void btle_handler(ble_evt_t *p_ble_evt)
 {
     /* Library service handlers */
+#if NEED_BOND_MANAGER /* disabled by default */
     ble_bondmngr_on_ble_evt(p_ble_evt);
+#endif
     ble_conn_params_on_ble_evt(p_ble_evt);
 
     /* Custom event handler */
@@ -104,7 +112,9 @@
             // Since we are not in a connection and have not started advertising,
             // store bonds
             nRF51Gap::getInstance().setConnectionHandle (BLE_CONN_HANDLE_INVALID);
+#if NEED_BOND_MANAGER /* disabled by default */
             ASSERT_STATUS_RET_VOID ( ble_bondmngr_bonded_centrals_store());
+#endif
             nRF51Gap::getInstance().handleEvent(GapEvents::GAP_EVENT_DISCONNECTED);
             break;
 
@@ -149,6 +159,7 @@
     nRF51GattServer::getInstance().hwCallback(p_ble_evt);
 }
 
+#if NEED_BOND_MANAGER /* disabled by default */
 /**************************************************************************/
 /*!
     @brief      Initialises the bond manager
@@ -181,7 +192,9 @@
 
     return ERROR_NONE;
 }
+#endif // #if NEED_BOND_MANAGER
 
+#if NEED_BOND_MANAGER /* disabled by default */
 /**************************************************************************/
 /*!
     @brief
@@ -193,6 +206,7 @@
 {
     ASSERT_STATUS_RET_VOID( nrf_error );
 }
+#endif // #if NEED_BOND_MANAGER
 
 /**************************************************************************/
 /*!
--- a/nordic/ble/ble_bondmngr.cpp	Fri Jun 13 11:21:09 2014 +0100
+++ b/nordic/ble/ble_bondmngr.cpp	Thu Jun 26 14:06:37 2014 +0100
@@ -10,6 +10,8 @@
  *
  */
 
+#if NEED_BOND_MANAGER /* disabled by default */
+
 #include "ble_bondmngr.h"
 #include <stdlib.h>
 #include <stdint.h>
@@ -1592,3 +1594,5 @@
 
     return NRF_SUCCESS;
 }
+
+#endif /* #if NEED_BOND_MANAGER */