GithubHelp home page GithubHelp logo

Comments (4)

pkarashchenko avatar pkarashchenko commented on June 5, 2024

The unknown event types seems to be reported by Linux HCI socket interface:
image

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

from mynewt-nimble.

sjanc avatar sjanc commented on June 5, 2024

Hi,

this is odd, 0xa1 doesn't even match report type from extended advertising report... what controller is this?

As for the patch, it looks OK, please send PR (we may discuss if this should be under some ifdef ie, for non-mynewt controllers only, but this can happen in PR itself)

from mynewt-nimble.

pkarashchenko avatar pkarashchenko commented on June 5, 2024

I will check the controller model. Actually in this case I'm running Ubuntu 20.04 on MacBook Pro :)
I will get the controller details and also will check if this is a driver issue. Also I will check if the same happens if I run exactly the same OS (installed on a portable SSD) on a Dell laptop.

from mynewt-nimble.

pkarashchenko avatar pkarashchenko commented on June 5, 2024

Seems to be Bluetooth driver instability when running Ubuntu on MacBook.

from mynewt-nimble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.