test

Dependencies:   nrf51-sdk

Dependents:   microbit-dal

Fork of nRF51822 by Lancaster University

Revision:
549:3f782c64d014
Parent:
548:920e941cbe1e
Child:
563:9c4b96f7be8d
--- a/source/btle/btle.cpp	Mon Jan 11 10:19:06 2016 +0000
+++ b/source/btle/btle.cpp	Mon Jan 11 10:19:06 2016 +0000
@@ -19,7 +19,6 @@
 
 #include "btle.h"
 
-#include "ble_stack_handler_types.h"
 #include "ble_flash.h"
 #include "ble_conn_params.h"
 
@@ -27,23 +26,21 @@
 #include "btle_advertising.h"
 #include "custom/custom_helper.h"
 
-#include "softdevice_handler.h"
-#include "pstorage.h"
-
 #include "ble/GapEvents.h"
 #include "nRF5xGap.h"
 #include "nRF5xGattServer.h"
 #include "nRF5xSecurityManager.h"
 
+extern "C" {
+#include "pstorage.h"
 #include "device_manager.h"
+#include "softdevice_handler.h"
+#include "ble_stack_handler_types.h"
+}
 
 #include "ble_hci.h"
 #include "btle_discovery.h"
 
-#include "nRF5xGattClient.h"
-#include "nRF5xServiceDiscovery.h"
-#include "nRF5xCharacteristicDescriptorDiscoverer.h"
-
 extern "C" 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);
 
@@ -186,12 +183,6 @@
                     reason = static_cast<Gap::DisconnectionReason_t>(p_ble_evt->evt.gap_evt.params.disconnected.reason);
                     break;
             }
-
-            // Close all pending discoveries for this connection
-            nRF5xGattClient& gattClient = nRF5xGattClient::getInstance();
-            gattClient.characteristicDescriptorDiscoverer().terminate(handle, BLE_ERROR_INVALID_STATE);
-            gattClient.discovery().terminate(handle);
-
             nRF5xGap::getInstance().processDisconnectionEvent(handle, reason);
             break;
         }