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 2019/11/05 12:49:27 UTC

[mynewt-nimble] 07/07: nimble/ll: Fix setting sent_to_host flag

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

commit d2853c9a204ea76a51211f83026db7e6e56c3590
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Nov 4 21:47:24 2019 +0100

    nimble/ll: Fix setting sent_to_host flag
    
    There's no point in setting flag only to clear it in a moment - just
    make sure we don't set it when not needed.
---
 nimble/controller/src/ble_ll_scan.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c
index 3e8cca0..548b0e9 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -2735,16 +2735,9 @@ ble_ll_hci_send_ext_adv_report(uint8_t ptype, uint8_t *adva, uint8_t adva_type,
         ble_ll_hci_event_send(hci_ev);
 
         if (aux_data) {
-            BLE_LL_AUX_SET_FLAG(aux_data, BLE_LL_SENT_EVENT_TO_HOST);
-            /* In case it is scannable AUX and we are waiting for scan response,
-             * let us clear BLE_LL_SENT_EVENT_TO_HOST flag as we consider scan response
-             * as separate report even aux_data is reused.
-             * This is needed to proper detect of not completed advertising
-             * reports.
-             */
-            if ((aux_data->evt_type & BLE_HCI_ADV_SCAN_MASK) &&
-                    !(aux_data->evt_type & BLE_HCI_ADV_SCAN_RSP_MASK)) {
-                BLE_LL_AUX_CLEAR_FLAG(aux_data, BLE_LL_SENT_EVENT_TO_HOST);
+            if (!(aux_data->evt_type & BLE_HCI_ADV_SCAN_MASK) ||
+                (aux_data->evt_type & BLE_HCI_ADV_SCAN_RSP_MASK)) {
+                BLE_LL_AUX_SET_FLAG(aux_data, BLE_LL_SENT_EVENT_TO_HOST);
             }
         }