Skip to content

Commit 203d9bd

Browse files
committed
update configCentralConn value
1 parent f16576b commit 203d9bd

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

libraries/Bluefruit52Lib/examples/Central/central_hid/central_hid.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ void setup()
3333

3434
Serial.println("Bluefruit52 Central HID (Keyboard + Mouse) Example");
3535
Serial.println("--------------------------------------------------\n");
36-
37-
Bluefruit.configCentralConn(23, 3, 1, 3);
3836

3937
// Initialize Bluefruit with maximum connections as Peripheral = 0, Central = 1
4038
// SRAM usage required by SoftDevice will increase dramatically with number of connections

libraries/Bluefruit52Lib/src/BLEGap.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,17 @@ void BLEGap::_eventHandler(ble_evt_t* evt)
331331
// Bonding process completed
332332
ble_gap_evt_auth_status_t* status = &evt->evt.gap_evt.params.auth_status;
333333

334-
// Pairing/Bonding succeeded --> save encryption keys
334+
// Pairing succeeded --> save encryption keys ( Bonding )
335335
if (BLE_GAP_SEC_STATUS_SUCCESS == status->auth_status)
336336
{
337337
peer->bonded = true;
338338
peer->ediv = peer->bond_data->own_enc.master_id.ediv;
339339

340-
bond_save_keys(conn_hdl, peer->bond_data);
340+
// TODO Skip bonding for central, implement re-establishment connection later.
341+
if ( peer->role == BLE_GAP_ROLE_PERIPH )
342+
{
343+
bond_save_keys(conn_hdl, peer->bond_data);
344+
}
341345
}else
342346
{
343347
PRINT_HEX(status->auth_status);

libraries/Bluefruit52Lib/src/bluefruit.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ void AdafruitBluefruit::configCentralBandwidth(uint8_t bw)
194194
// TODO Bandwidth auto
195195
case BANDWIDTH_AUTO:
196196
case BANDWIDTH_NORMAL:
197-
configCentralConn(BLE_GATT_ATT_MTU_DEFAULT, BLE_GAP_EVENT_LENGTH_DEFAULT, BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT, BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT);
197+
configCentralConn(BLE_GATT_ATT_MTU_DEFAULT, BLE_GAP_EVENT_LENGTH_DEFAULT, BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT, 3);
198198
break;
199199

200200
case BANDWIDTH_HIGH:
201-
configCentralConn(128, 6, 2, BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT);
201+
configCentralConn(128, 6, 1, 3);
202202
break;
203203

204204
case BANDWIDTH_MAX:
205-
configCentralConn(247, 6, 3, BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT);
205+
configCentralConn(247, 6, 1, 3);
206206
break;
207207

208208
default: break;

0 commit comments

Comments
 (0)