2021-03-04 11:19 PM
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?
2024-02-12 06:45 AM
Hello, can you explain this better please?