Skip to content

Commit 93d44ea

Browse files
committed
added updateDataLength/updateDataLength for BLEConnection
fix #106
1 parent d683b57 commit 93d44ea

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

libraries/Bluefruit52Lib/src/BLEConnection.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ bool BLEConnection::setTxPower(int8_t power)
132132
return true;
133133
}
134134

135+
bool BLEConnection::requestMtuExchange(uint16_t mtu)
136+
{
137+
VERIFY_STATUS(sd_ble_gattc_exchange_mtu_request(_conn_hdl, mtu), false);
138+
return true;
139+
}
140+
141+
bool BLEConnection::updateDataLength(ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation)
142+
{
143+
VERIFY_STATUS(sd_ble_gap_data_length_update(_conn_hdl, p_dl_params, p_dl_limitation), false);
144+
return true;
145+
}
146+
135147
bool BLEConnection::disconnect(void)
136148
{
137149
return ERROR_NONE == sd_ble_gap_disconnect(_conn_hdl, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
@@ -405,7 +417,7 @@ void BLEConnection::_eventHandler(ble_evt_t* evt)
405417
ble_gap_conn_params_t* param = &evt->evt.gap_evt.params.conn_param_update.conn_params;
406418
_conn_interval = param->max_conn_interval;
407419

408-
LOG_LV2("GAP", "Conn Interval= %f", _conn_interval*1.25f);
420+
LOG_LV1("GAP", "Conn Interval= %f", _conn_interval*1.25f);
409421
}
410422
break;
411423

libraries/Bluefruit52Lib/src/BLEConnection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class BLEConnection
8383
bool disconnect(void);
8484

8585
bool setTxPower(int8_t power); // set power for this connection
86+
bool updateDataLength(ble_gap_data_length_params_t const *p_dl_params = NULL, ble_gap_data_length_limitation_t *p_dl_limitation = NULL);
87+
bool requestMtuExchange(uint16_t mtu);
8688

8789
bool monitorRssi(uint8_t threshold = BLE_GAP_RSSI_THRESHOLD_INVALID);
8890
int8_t getRssi(void);

0 commit comments

Comments
 (0)