1

Fork of nRF51822 by Nordic Semiconductor

Revision:
358:0feab33fde20
Parent:
348:922c8b211979
Child:
361:d2405f5a4853
--- a/nRF51Gap.cpp	Fri Jun 19 15:55:37 2015 +0100
+++ b/nRF51Gap.cpp	Fri Jun 19 15:55:37 2015 +0100
@@ -265,24 +265,7 @@
     }
 }
 
-
-/**************************************************************************/
-/*!
-    @brief  Disconnects if we are connected to a central device
-
-    @returns    ble_error_t
-
-    @retval     BLE_ERROR_NONE
-                Everything executed properly
-
-    @section EXAMPLE
-
-    @code
-
-    @endcode
-*/
-/**************************************************************************/
-ble_error_t nRF51Gap::disconnect(DisconnectionReason_t reason)
+ble_error_t nRF51Gap::disconnect(Handle_t connectionHandle, DisconnectionReason_t reason)
 {
     state.advertising = 0;
     state.connected   = 0;
@@ -300,11 +283,24 @@
     }
 
     /* Disconnect if we are connected to a central device */
-    ASSERT_INT(ERROR_NONE, sd_ble_gap_disconnect(m_connectionHandle, code), BLE_ERROR_PARAM_OUT_OF_RANGE);
+    ASSERT_INT(ERROR_NONE, sd_ble_gap_disconnect(connectionHandle, code), BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     return BLE_ERROR_NONE;
 }
 
+/*!
+    @brief  Disconnects if we are connected to a central device
+
+    @returns    ble_error_t
+
+    @retval     BLE_ERROR_NONE
+                Everything executed properly
+*/
+ble_error_t nRF51Gap::disconnect(DisconnectionReason_t reason)
+{
+    return disconnect(m_connectionHandle, reason);
+}
+
 ble_error_t nRF51Gap::getPreferredConnectionParams(ConnectionParams_t *params)
 {
     ASSERT_INT(NRF_SUCCESS,