You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2021/10/04 10:36:09 UTC

[mynewt-nimble] branch master updated: nimble/ll: Fix phy configuration for initiator

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new cddb7c4  nimble/ll: Fix phy configuration for initiator
cddb7c4 is described below

commit cddb7c4ccee72e718c8b1a57166e702917e02c13
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Sep 30 20:39:09 2021 +0200

    nimble/ll: Fix phy configuration for initiator
    
    Not sure how this even works, but configuration flags for phys were
    never set...
---
 nimble/controller/src/ble_ll_scan.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c
index 399ce22..660abf9 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -2986,6 +2986,12 @@ ble_ll_scan_initiator_start(struct hci_create_conn *hcc,
     scanp->timing.interval = ble_ll_scan_time_hci_to_ticks(hcc->scan_itvl);
     scanp->timing.window = ble_ll_scan_time_hci_to_ticks(hcc->scan_window);
     scanp->scan_type = BLE_SCAN_TYPE_INITIATE;
+    scanp->configured = 1;
+
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CODED_PHY)
+    scanp = &scansm->scan_phys[PHY_CODED];
+    scanp->configured = 0;
+#endif
 
     rc = ble_ll_scan_sm_start(scansm);
     if (sm == NULL) {
@@ -3019,20 +3025,23 @@ ble_ll_scan_ext_initiator_start(struct hci_ext_create_conn *hcc,
     scansm->scanp_next = NULL;
     scansm->ext_scanning = 1;
 
+    params = &hcc->params[0];
+    scanp_uncoded = &scansm->scan_phys[PHY_UNCODED];
     if (hcc->init_phy_mask & BLE_PHY_MASK_1M) {
-        params = &hcc->params[0];
-        scanp_uncoded = &scansm->scan_phys[PHY_UNCODED];
-
+        scanp_uncoded->configured = 1;
         scanp_uncoded->timing.interval = ble_ll_scan_time_hci_to_ticks(params->scan_itvl);
         scanp_uncoded->timing.window = ble_ll_scan_time_hci_to_ticks(params->scan_window);
         scanp_uncoded->scan_type = BLE_SCAN_TYPE_INITIATE;
         scansm->scanp = scanp_uncoded;
+    } else {
+        scanp_uncoded->configured = 0;
     }
 
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CODED_PHY)
+    params = &hcc->params[2];
+    scanp_coded = &scansm->scan_phys[PHY_CODED];
     if (hcc->init_phy_mask & BLE_PHY_MASK_CODED) {
-        params = &hcc->params[2];
-        scanp_coded = &scansm->scan_phys[PHY_CODED];
-
+        scanp_coded->configured = 1;
         scanp_coded->timing.interval = ble_ll_scan_time_hci_to_ticks(params->scan_itvl);
         scanp_coded->timing.window = ble_ll_scan_time_hci_to_ticks(params->scan_window);
         scanp_coded->scan_type = BLE_SCAN_TYPE_INITIATE;
@@ -3041,7 +3050,12 @@ ble_ll_scan_ext_initiator_start(struct hci_ext_create_conn *hcc,
         } else {
             scansm->scanp = scanp_coded;
         }
+    } else {
+        scanp_coded->configured = 0;
     }
+#else
+    scanp_coded = NULL;
+#endif
 
     /* if any of PHYs is configured for continuous scan we alter interval to
      * fit other PHY