[PATCH] update signal quality correctly when out of coverage
Prathmesh Prabhu
pprabhu at chromium.org
Tue Oct 22 12:17:25 PDT 2013
When querying signal quality using AT+CSQ, a response of '+CSQ:99,99' indicates no
network. This should lead to the signal quality being set to 0. Before this
patch, the last most recent signal quality would be left untouched.
---
src/mm-iface-modem.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 433dbac..ea433ed 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -1169,7 +1169,16 @@ signal_quality_check_ready (MMIfaceModem *self,
res,
&error);
if (error) {
- mm_dbg ("Couldn't refresh signal quality: '%s'", error->message);
+ /* If we failed to update signal quality because there was no network,
+ * we should set the signal quality to zero to reflect no network
+ * coverage.
+ */
+ if (error->code == MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK) {
+ mm_dbg ("Out of coverage area. Setting signal quality to '0'");
+ update_signal_quality (self, 0, TRUE);
+ } else {
+ mm_dbg ("Couldn't refresh signal quality: '%s'", error->message);
+ }
g_error_free (error);
} else
update_signal_quality (self, signal_quality, TRUE);
--
1.8.4
More information about the ModemManager-devel
mailing list