drivers: modem: ublox_sara_r4: fixed rssi for Sara U201

Calculation of RSSI was done incorrectly for Sara U201.

When evaluating +CSQ command responses, the RSSI can be calculated
from the first value, which is <signal_strength>. Instead, the
RSSI was calculated from the second value, which is <qual>.
With the subsequent mapping to RSSI, this results in a wrong
value for RSSI.

This is now corrected by using value <signal_strength> to calculate
the RSSI.

Tested using Sara U201.

Signed-off-by: Hans Wilmers <hans@wilmers.no>
This commit is contained in:
Hans Wilmers 2020-04-07 10:51:48 +02:00 committed by Jukka Rissanen
commit 71fa7ba5ad

View file

@ -387,7 +387,7 @@ MODEM_CMD_DEFINE(on_cmd_atcmdinfo_rssi_csq)
{
int rssi;
rssi = ATOI(argv[1], 0, "qual");
rssi = ATOI(argv[0], 0, "signal_power");
if (rssi == 31) {
mctx.data_rssi = -46;
} else if (rssi >= 0 && rssi <= 31) {
@ -397,7 +397,7 @@ MODEM_CMD_DEFINE(on_cmd_atcmdinfo_rssi_csq)
mctx.data_rssi = -1000;
}
LOG_INF("QUAL: %d", mctx.data_rssi);
LOG_INF("RSSI: %d", mctx.data_rssi);
return 0;
}
#endif