From 6054b773942b603d309b32d89b9b6dab6e2309d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Tue, 6 Mar 2018 14:45:41 +0100 Subject: [PATCH] nimble/ll: Support scan on two PHYs when continous scanning requested X-Original-Commit: 6258e862c56f2b99ef1682f1fc6c200ce36986ab --- nimble/controller/src/ble_ll_scan.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c index d62620cd1..5f7fe5929 100644 --- a/nimble/controller/src/ble_ll_scan.c +++ b/nimble/controller/src/ble_ll_scan.c @@ -2691,14 +2691,16 @@ ble_ll_set_ext_scan_params(uint8_t *cmd) } #endif - /* For now we don't accept request for continuous scan if 2 PHYs are - * requested. + /* If host requests continuous scan for 2 PHYs, we double scan interval + * and split it for two equal scan windows between 2 PHYs */ - if ((cmd[2] == - (BLE_HCI_LE_PHY_1M_PREF_MASK | BLE_HCI_LE_PHY_CODED_PREF_MASK)) && + if ((coded->configured && uncoded->configured) && ((uncoded->scan_itvl == uncoded->scan_window) || (coded->scan_itvl == coded-> scan_window))) { - return BLE_ERR_INV_HCI_CMD_PARMS; + + uncoded->scan_itvl *= 2; + coded-> scan_itvl = uncoded->scan_itvl; + coded->scan_window = uncoded->scan_window; } memcpy(g_ble_ll_scan_params, new_params, sizeof(new_params));