hi dialog
i have made a distance test ,use da14585 and one beacon. It seems that the API provided by the SDK does not match the reality。
i use
uint8_t ble_rf_rssi_convert(uint8_t rssi_reg) { // NOTE: Approximate conversion corresponding to the following formula: // dBm = (0.474f * rssi) - 112.4f. return ((rssi_reg >> 1U) - 112U); }
I put the test results in the following pdf,Please pay attention to the form。thank you very much
Device:
Hi moiify,
Can you please share the procedure you are following in order to get the RSSI and convert to dBm? Any code snippets to replicate it would be very helpful.
Thanks, PM_Dialog
I use the above code for development and test. Please have a look. Thank you very much!
Hi moiify,
In order to convert the RSSI to real dBm, you will just need to read the rssi value as a signed value. The RSSI is reported by the stack in the advertising structure (gapm_adv_report_ind) that comes as a parameter in the app_on_adv_report_ind. To do so, in the advertising report callback you should get the RSSI value (param->report.rssi) and converted to signed value.
For example :
uint8_t rssi = param->report.rssi ;
如果rssi = 0 xcd,你应该把它转换成igned value which is -51dBm.
The value is automatically converted in dbm when you get it from the advertising report via the rf_rssi_convert() in rf_585.c file. That function is passed on the stack and the stack performs the conversion for you. You will not need to recall this function in order to convert the rssi to dbm.
Thanks, PM_Dialog