rymanluk commented on a change in pull request #639: nimble/ll: Fix extended 
scanner data fragmentation issues
URL: https://github.com/apache/mynewt-nimble/pull/639#discussion_r343949130
 
 

 ##########
 File path: nimble/controller/src/ble_ll_scan.c
 ##########
 @@ -2685,19 +2702,12 @@ ble_ll_hci_send_ext_adv_report(uint8_t ptype, uint8_t 
*adva, uint8_t adva_type,
         os_mbuf_copydata(om, offset, report->data_len, report->data);
         offset += report->data_len;
 
-
-        if (offset < datalen) {
-            /* Need another event for next fragment of this PDU */
-            need_event = true;
-        } else if (aux_data && BLE_LL_AUX_CHECK_FLAG(aux_data, 
BLE_LL_AUX_INCOMPLETE_ERR_BIT)) {
-            need_event = false;
-        } else if (aux_data && BLE_LL_AUX_CHECK_FLAG(aux_data, 
BLE_LL_AUX_INCOMPLETE_BIT)) {
-            /* Need another event for next PDU in chain */
-            need_event = true;
-        }
-
-        /* Assume data status is not "completed" */
-        rc = 1;
+        /*
+         * We need another event if either there are still some data left to
+         * send in current PDU or scan is not completed. The only exception is
+         * when this is a scannable event which is not a scan response.
+         */
+        need_event = ((offset < datalen) || (aux_data && !(aux_data->flags_ll 
& BLE_LL_AUX_FLAG_SCAN_COMPLETE))) && !is_scannable_aux;
 
 Review comment:
   For the moment I was thinking it will not work because in case of long 
scannable_aux  we might need next event, but it is not true as scannable aux 
has no advertising data - maybe we could point it here in the comment so it is 
clear.
   
   btw. this line is too long.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to