mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-23 10:19:59 +00:00
nimble/host: Start extended scan if possible
While enabling scan for mesh, appropriate scan type should be use.
This commit is contained in:
committed by
Łukasz Rymanowski
parent
f98706cbc5
commit
bd8f451583
@@ -369,6 +369,16 @@ done:
|
||||
|
||||
int bt_mesh_scan_enable(void)
|
||||
{
|
||||
#if MYNEWT_VAL(BLE_EXT_ADV)
|
||||
struct ble_gap_ext_disc_params uncoded_params =
|
||||
{ .itvl = MESH_SCAN_INTERVAL, .window = MESH_SCAN_WINDOW,
|
||||
.passive = 1 };
|
||||
|
||||
BT_DBG("");
|
||||
|
||||
return ble_gap_ext_disc(g_mesh_addr_type, 0, 0, 0, 0, 0,
|
||||
&uncoded_params, NULL, NULL, NULL);
|
||||
#else
|
||||
struct ble_gap_disc_params scan_param =
|
||||
{ .passive = 1, .filter_duplicates = 0, .itvl =
|
||||
MESH_SCAN_INTERVAL, .window = MESH_SCAN_WINDOW };
|
||||
@@ -376,6 +386,7 @@ int bt_mesh_scan_enable(void)
|
||||
BT_DBG("");
|
||||
|
||||
return ble_gap_disc(g_mesh_addr_type, BLE_HS_FOREVER, &scan_param, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
int bt_mesh_scan_disable(void)
|
||||
|
||||
Reference in New Issue
Block a user