Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: nrf51-sdk
Dependents: microbit-dal microbit-ble-open microbit-dal-eddystone microbit-dal-ble-accelerometer-example ... more
Diff: source/btle/btle.cpp
- Revision:
- 563:9c4b96f7be8d
- Parent:
- 549:3f782c64d014
- Child:
- 565:cf03471a4ec4
--- a/source/btle/btle.cpp Mon Jan 11 10:19:15 2016 +0000
+++ b/source/btle/btle.cpp Mon Jan 11 10:19:16 2016 +0000
@@ -41,6 +41,10 @@
#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);
@@ -183,6 +187,12 @@
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;
}