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/05/28 07:51:46 UTC

[GitHub] sjanc commented on a change in pull request #115: debug: Add missing debug logs for LE Meta Events

sjanc commented on a change in pull request #115: debug: Add missing debug logs for LE Meta Events
URL: https://github.com/apache/mynewt-nimble/pull/115#discussion_r191135512
 
 

 ##########
 File path: nimble/host/src/ble_hs_dbg.c
 ##########
 @@ -149,6 +149,184 @@ ble_hs_dbg_le_event_disp(uint8_t subev, uint8_t len, uint8_t *evdata)
                        get_le16(evdata + 1), evdata[3], evdata[4]);
         break;
 
+    case BLE_HCI_LE_SUBEV_EXT_ADV_RPT:
+    {
+        struct hci_le_subev_ext_adv_rpt *data = (void *) evdata;
+        struct hci_ext_adv_report_param *params = data->params;
+
+        if (len < sizeof(*data) + sizeof(*params)) {
+            BLE_HS_LOG(DEBUG, "Corrupted LE Extended Advertising Report "
+                       "len=%u\n", len);
+            break;
+        }
+
+        BLE_HS_LOG(DEBUG, "LE Extended Advertising Report len=%u num=0x%02x ",
+                   len, data->num_reports);
+
+        for (i = 0; i < data->num_reports; i++) {
+            BLE_HS_LOG(DEBUG, "[%d]={evttype=0x%04x advlen=%u}\n",
+                       i, le16toh(params->evt_type), params->adv_data_len);
+            params += 1;
 
 Review comment:
   you need to adjust this with adv_data_len so params +=1 is not correct here.

----------------------------------------------------------------
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