mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-05 16:50:01 +00:00
BLE Host - Don't allow conn to already-conned peer
X-Original-Commit: 5ae196a95248b3531f7e3c940f0444df78d3e554
This commit is contained in:
@@ -2384,6 +2384,12 @@ ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Verify peer not already connected. */
|
||||
if (ble_hs_conn_find_by_addr(peer_addr) != NULL) {
|
||||
rc = BLE_HS_EDONE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ble_hs_conn_can_alloc()) {
|
||||
rc = BLE_HS_ENOMEM;
|
||||
goto done;
|
||||
|
||||
Reference in New Issue
Block a user