mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(nimble): Add support to allow connection during scanning
This commit is contained in:
@@ -471,12 +471,14 @@ blecent_connect_if_interesting(const struct ble_gap_disc_desc *disc)
|
||||
return;
|
||||
}
|
||||
|
||||
#if !(MYNEWT_VAL(BLE_HOST_ALLOW_CONNECT_WITH_SCAN))
|
||||
/* Scanning must be stopped before a connection can be initiated. */
|
||||
rc = ble_gap_disc_cancel();
|
||||
if (rc != 0) {
|
||||
MODLOG_DFLT(DEBUG, "Failed to cancel scan; rc=%d\n", rc);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Figure out address to use for connect (no privacy for now) */
|
||||
rc = ble_hs_id_infer_auto(0, &own_addr_type);
|
||||
@@ -529,7 +531,7 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* An advertisment report was received during GAP discovery. */
|
||||
/* An advertisement report was received during GAP discovery. */
|
||||
print_adv_fields(&fields);
|
||||
|
||||
/* Try to connect to the advertiser if it looks interesting. */
|
||||
|
||||
Reference in New Issue
Block a user