Question
[BLE RSSI] Reading RSSI value uint8_t
Hello, I am working with STM32WBA52CG as a central and I want to read the RSSI from the incoming advertising packets. The RSSI value should be a negative value in dBm, however it is defined as uint8_t in the AdvertisingReport_t structure. Can someone explain me how to get the correct RSSI value? I am getting the values shown on the terminal below.
...
}
bleAppContext.BleApplicationContext_legacy.connectionHandle = p_conn_complete->Connection_Handle;
GATT_CLIENT_APP_Set_Conn_Handle(0, p_conn_complete->Connection_Handle);
/* USER CODE BEGIN HCI_EVT_LE_CONN_COMPLETE */
/* USER CODE END HCI_EVT_LE_CONN_COMPLETE */
break; /* HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE */
}
case HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE:
{
hci_le_advertising_report_event_rp0 *p_adv_report;
p_adv_report = (hci_le_advertising_report_event_rp0 *) p_meta_evt->data;
UNUSED(p_adv_report);
/* USER CODE BEGIN HCI_EVT_LE_ADVERTISING_REPORT */
uint8_t rssi = p_adv_report->Advertising_Report[0].RSSI;
LOG_INFO_APP("RSSI from struct: %d , ", rssi);
/* USER CODE END HCI_EVT_LE_ADVERTISING_REPORT */
break; /* HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE */
}
... 
