Nimble issue with BLE_GAP_EVENT_NOTIFY_RX event

afcec1
Posts: 23
Joined: Tue Oct 08, 2019 1:48 pm

Nimble issue with BLE_GAP_EVENT_NOTIFY_RX event

Postby afcec1 » Tue Apr 13, 2021 10:44 am

Hi,

I have an application (ESP-IDF 4) working successfully with BLE (Bluedroid stack) but it also manages Wi-Fi connection, ESP-AZURE with TLS connections... and I need to reduce the memory consumption. I am planning a migration from Bluedroid to Nimble but I am experiencing some issues when doing initial tests with the 'blecent' example with custom modifications. I scan, then connect to my service and finally subscribe for notifications from my custom characterisitic. However, when I get event 'BLE_GAP_EVENT_NOTIFY_RX' the data should be contained in 'event->notify_rx.attr_data' but I am receiving a build error like: struct <anonymous> has no member named 'attr_data'

Am I doing anything wrong? How can I get the data from this notification?

Thanks

afcec1
Posts: 23
Joined: Tue Oct 08, 2019 1:48 pm

Re: Nimble issue with BLE_GAP_EVENT_NOTIFY_RX event

Postby afcec1 » Wed Apr 14, 2021 9:00 am

Nobody getting this build error with 'event->notify_rx.attr_data' in struct ble_gap_event?

afcec1
Posts: 23
Joined: Tue Oct 08, 2019 1:48 pm

Re: Nimble issue with BLE_GAP_EVENT_NOTIFY_RX event

Postby afcec1 » Fri Apr 16, 2021 6:15 am

Thre is a bug in the examples and notify_rx.attr_data no longer exists. Notification data can be read this way:

Code: Select all

uint8_t notif_data[100]; /* Size depending on the actual size of the notification data you have */
        uint16_t notif_len;
        int offset = 0;
        notif_len = OS_MBUF_PKTLEN(event->notify_rx.om);
        os_mbuf_copydata(event->notify_rx.om, offset, notif_len, notif_data);
For those seeking for good performance and proper coexistance with Wi-Fi, the difference when compared with Bluedroid is really important.

Who is online

Users browsing this forum: No registered users and 103 guests