BLE Host - Don't allow conn to already-conned peer

X-Original-Commit: 5ae196a95248b3531f7e3c940f0444df78d3e554
This commit is contained in:
Christopher Collins
2017-03-28 16:58:41 -07:00
parent ead8995ce1
commit bb70d97ecb
+6
View File
@@ -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;