You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/22 11:18:52 UTC

[GitHub] andrzej-kaczmarek commented on a change in pull request #244: nimble/ll: Qualification and performance issues

andrzej-kaczmarek commented on a change in pull request #244: nimble/ll: Qualification and performance issues
URL: https://github.com/apache/mynewt-nimble/pull/244#discussion_r235678877
 
 

 ##########
 File path: nimble/controller/src/ble_ll_scan.c
 ##########
 @@ -2384,15 +2385,15 @@ ble_ll_hci_send_ext_adv_report(uint8_t ptype, uint8_t *adva, uint8_t adva_type,
     }
 
     offset = 0;
+    max_event_size = min(UINT8_MAX, BLE_LL_MAX_EVT_LEN);
 
     do {
         need_event = false;
         next_evt = NULL;
 
-        evt->adv_data_len = min(BLE_LL_MAX_EVT_LEN - sizeof(*evt),
+        evt->adv_data_len = min(max_event_size - sizeof(*evt),
                                 datalen - offset);
-        evt->event_len = (sizeof(*evt) - BLE_HCI_EVENT_HDR_LEN) +
-                         evt->adv_data_len;
+        evt->event_len = sizeof(*evt) + evt->adv_data_len;
 
 Review comment:
   previous calculation was ok because `sizeof(*evt)` includes HCI header (event code + parameters length) which should not be included in `event_len`.
   
   what should be fixed instead is the line above where `adv_data_len` is calculated since it should also include `BLE_HCI_EVENT_HDR_LEN` in calculation

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


With regards,
Apache Git Services