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.
Dependents: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate writable_gatt ... more
Diff: nRF51Gap.cpp
- Revision:
- 44:47da5c62e067
- Parent:
- 40:1cb3707fa798
- Child:
- 56:a1071b629aa3
--- a/nRF51Gap.cpp Fri Jul 11 13:52:58 2014 +0100
+++ b/nRF51Gap.cpp Fri Jul 11 13:53:30 2014 +0100
@@ -230,6 +230,37 @@
return BLE_ERROR_NONE;
}
+ble_error_t nRF51Gap::getPreferredConnectionParams(ConnectionParams_t *params)
+{
+ ASSERT_INT(NRF_SUCCESS,
+ sd_ble_gap_ppcp_get(reinterpret_cast<ble_gap_conn_params_t *>(params)),
+ BLE_ERROR_PARAM_OUT_OF_RANGE);
+
+ return BLE_ERROR_NONE;
+}
+
+ble_error_t nRF51Gap::setPreferredConnectionParams(const ConnectionParams_t *params)
+{
+ ASSERT_INT(NRF_SUCCESS,
+ sd_ble_gap_ppcp_set(reinterpret_cast<const ble_gap_conn_params_t *>(params)),
+ BLE_ERROR_PARAM_OUT_OF_RANGE);
+
+ return BLE_ERROR_NONE;
+}
+
+ble_error_t nRF51Gap::updateConnectionParams(Handle_t handle, const ConnectionParams_t *newParams)
+{
+ uint32_t rc;
+
+ rc = sd_ble_gap_conn_param_update(handle,
+ reinterpret_cast<ble_gap_conn_params_t *>(const_cast<ConnectionParams_t*>(newParams)));
+ if (rc == NRF_SUCCESS) {
+ return BLE_ERROR_NONE;
+ } else {
+ return BLE_ERROR_PARAM_OUT_OF_RANGE;
+ }
+}
+
/**************************************************************************/
/*!
@brief Sets the 16-bit connection handle

