For with fix for disconnection notifications

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
janekm
Date:
Wed Sep 03 17:19:53 2014 +0000
Parent:
60:e861f2041469
Commit message:
Fix disconnection notification to application (used to only notify on locally initiated disconnection)

Changed in this revision

btle/btle.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/btle/btle.cpp	Tue Sep 02 17:01:18 2014 +0100
+++ b/btle/btle.cpp	Wed Sep 03 17:19:53 2014 +0000
@@ -139,6 +139,10 @@
 
             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;
         }