pkarashchenko commented on issue #1551:
URL: https://github.com/apache/mynewt-nimble/issues/1551#issuecomment-1637187895

   The unknown event types seems to be reported by Linux HCI socket interface:
   
![image](https://github.com/apache/mynewt-nimble/assets/17704713/d753c009-c9c9-4c54-9ff1-effc6123450b)
   
   I did a quick experiment and see that only lower 4 bits seems to be valid 
and changing code:
   ```
   diff --git a/nimble/host/src/ble_hs_hci_evt.c 
b/nimble/host/src/ble_hs_hci_evt.c
   index e7af2243..3096b4fc 100644
   --- a/nimble/host/src/ble_hs_hci_evt.c
   +++ b/nimble/host/src/ble_hs_hci_evt.c
   @@ -481,7 +481,7 @@ ble_hs_hci_evt_le_adv_rpt(uint8_t subevent, const void 
*data, unsigned int len)
    
            data += sizeof(rpt) + rpt->data_len + 1;
    
   -        desc.event_type = rpt->type;
   +        desc.event_type = rpt->type & 0xF;
            desc.addr.type = rpt->addr_type;
            memcpy(desc.addr.val, rpt->addr, BLE_DEV_ADDR_LEN);
            desc.length_data = rpt->data_len;
   @@ -510,7 +510,7 @@ ble_hs_hci_evt_le_dir_adv_rpt(uint8_t subevent, const 
void *data, unsigned int l
        desc.length_data = 0;
    
        for (i = 0; i < ev->num_reports; i++) {
   -        desc.event_type = ev->reports[i].type;
   +        desc.event_type = ev->reports[i].type & 0xF;
            desc.addr.type = ev->reports[i].addr_type;
            memcpy(desc.addr.val, ev->reports[i].addr, BLE_DEV_ADDR_LEN);
            desc.direct_addr.type = ev->reports[i].dir_addr_type;
   ```
   seems to solve the issue. I'm not sure if that is a correct solution


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to