feat(nimble): Add support to allow connection during scanning

This commit is contained in:
Rahul Tank
2024-08-16 15:06:35 +05:30
parent 1bb33a31b8
commit a992ae6528
13 changed files with 65 additions and 31 deletions
@@ -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. */