Skip to main content
Visitor II
March 5, 2021
Question

Extracting rssi from scanned packet.

  • March 5, 2021
  • 1 reply
  • 971 views

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

    Visitor II
    February 12, 2024

    Hello, can you explain this better please?