Skip to main content
Kryptons
Associate
Mar 5, 2021 7:19 AM UTC
Question

Extracting rssi from scanned packet.

Hi,

I need to get the RSSI of scanned BLE packet. So I'm using le_advertising_event .

I found some one used the following code for that purpose.

rssi1 = le_advertising_event->Advertising_Report[0].RSSI;

but in the struct they mentioned that

/* WARNING: be careful when decoding advertising report as its raw format cannot be mapped on a C structure.

     The data and RSSI values could not be directly decoded from the RAM using the data and RSSI field from hci_le_advertising_report_event_rp0 structure.

     Instead they must be read by using offsets (please refer to BLE specification).

     RSSI = *(uint8_t*) (adv_report_data + le_advertising_event->Advertising_Report[0].Length_Data);

     */

(So I ran both codes and observed different output values.)

If anyone familiar with this activity, Can you tell which one is the best one?

This topic has been closed for replies.

1 reply

Associate II
Feb 12, 2024 2:45 PM UTC

Hello, can you explain this better please?