From ea7517f0e5ec0d81bb75ea0d589575bb5efb9330 Mon Sep 17 00:00:00 2001 From: Frederic Martinsons Date: Sat, 2 Oct 2021 07:38:04 +0200 Subject: [PATCH] Update signal strength indicator thresholds These are thresholds for RSSI so nothing is expected to be greater than 0. This will allow to have a better granularity (even if with some modem, we are limited in the number of thresholds configured) These new thresholds will give the following signal quality range: - 11% for -110 dBm - 30% for -94 dBm - 50% for -82 dBm - 70% for -69 dBm - 90% for -57 dBm We are expecting to receive indication sreport every time the signal strength crosses one of the configured thresholds. Signed-off-by: Frederic Martinsons --- src/mm-broadband-modem-qmi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index a74f035a..b99fea15 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -5063,8 +5063,15 @@ common_enable_disable_unsolicited_events_signal_strength (GTask *task) g_autoptr(GArray) thresholds = NULL; /* The device doesn't really like to have many threshold values, so don't - * grow this array without checking first */ - static const gint8 thresholds_data[] = { -80, -40, 0, 40, 80 }; + * grow this array without checking first + * The values are chosen towards their results through STRENGTH_TO_QUALITY + * -106 dBm gives 11% + * -94 dBm gives 30% + * -82 dBm gives 50% + * -69 dBm gives 70% + * -57 dBm gives 90% + */ + static const gint8 thresholds_data[] = { -106, -94, -82, -69, -57 }; ctx = g_task_get_task_data (task);