From bba5a1a00026068ba42430b8b45d92925b87dfbc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 16 Feb 2012 08:12:28 +0100 Subject: atmodem: Ignore results from IFX radio signal strength indication It seems the that XCIEV notification actually returns results from XCSQ and not the described range 0-7. This makes this notification rather useless to report signal strength. --- drivers/atmodem/network-registration.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c index d098d373..5cf1a021 100644 --- a/drivers/atmodem/network-registration.c +++ b/drivers/atmodem/network-registration.c @@ -680,8 +680,8 @@ static void ifx_xhomezr_notify(GAtResult *result, gpointer user_data) static void ifx_xciev_notify(GAtResult *result, gpointer user_data) { - struct ofono_netreg *netreg = user_data; - int strength, ind; + //struct ofono_netreg *netreg = user_data; + int ind; GAtResultIter iter; g_at_result_iter_init(&iter, result); @@ -692,22 +692,14 @@ static void ifx_xciev_notify(GAtResult *result, gpointer user_data) if (!g_at_result_iter_next_number(&iter, &ind)) return; + DBG("ind %d", ind); + /* * Radio signal strength indicators are defined for 0-7, - * but in some cases XCIEV just returns CSQ 0-31,99 values. + * but this notification seems to return CSQ 0-31,99 values. + * + * Ignore this indication for now since it can not be trusted. */ - if (ind == 0 || ind == 99) - strength = -1; - else if (ind == 7) - strength = 100; - else if (ind < 7) - strength = (ind * 15); - else if (ind > 7) - strength = (ind * 100) / 31; - - DBG("ind %d strength %d", ind, strength); - - ofono_netreg_strength_notify(netreg, strength); } static void ciev_notify(GAtResult *result, gpointer user_data) -- cgit v1.2.3