aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-16 11:34:36 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-10-16 11:34:36 +0200
commit6223f61803c674d4c60e4ab126151de0696e0f48 (patch)
treee06f091cea21a15e4081b5218a9857a68b555297
parente2f3034f6e2c79062c095be0bc4278907b32ec8f (diff)
Revert "icera: improve parsing of access technologies in %NWSTATE response"
This reverts commit e2f3034f6e2c79062c095be0bc4278907b32ec8f. The report of current access technologies is supposed to give which is the *current* access technology being active. We allow reporting more than one for the cases where several access technologies are given simultaneously (e.g. cdma1x + evdo + lte). For example, we shouldn't be giving 4 different technologies like "umts, hsdpa, hsupa, hspa" when the modem reports "3G-HSDPA-HSUPA". Just giving HSPA in that case is enough and more accurate.
-rw-r--r--plugins/icera/mm-broadband-modem-icera.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c
index 44182a25..db702527 100644
--- a/plugins/icera/mm-broadband-modem-icera.c
+++ b/plugins/icera/mm-broadband-modem-icera.c
@@ -322,27 +322,27 @@ ipdpact_received (MMAtSerialPort *port,
static MMModemAccessTechnology
nwstate_to_act (const gchar *str)
{
- MMModemAccessTechnology technologies = 0;
-
/* small 'g' means CS, big 'G' means PS */
- if (strstr (str, "2g") || strstr (str, "2G"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_GSM;
- if (strstr (str, "GPRS"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_GPRS;
- if (strstr (str, "EDGE"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_EDGE;
- if (strstr (str, "3g") || strstr (str, "3G") || strstr (str, "R99"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_UMTS;
- if (strstr (str, "HSDPA-HSUPA") || strstr (str, "HSUPA-HSDPA"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_HSPA;
- if (strstr (str, "HSDPA"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_HSDPA;
- if (strstr (str, "HSUPA"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_HSUPA;
- if (strstr (str, "HSPA+"))
- technologies |= MM_MODEM_ACCESS_TECHNOLOGY_HSPA_PLUS;
-
- return technologies;
+ if (!strcmp (str, "2g"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_GSM;
+ else if (!strcmp (str, "2G-GPRS"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_GPRS;
+ else if (!strcmp (str, "2G-EDGE"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_EDGE;
+ else if (!strcmp (str, "3G"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_UMTS;
+ else if (!strcmp (str, "3g"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_UMTS;
+ else if (!strcmp (str, "R99"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_UMTS;
+ else if (!strcmp (str, "3G-HSDPA") || !strcmp (str, "HSDPA"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_HSDPA;
+ else if (!strcmp (str, "3G-HSUPA") || !strcmp (str, "HSUPA"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_HSUPA;
+ else if (!strcmp (str, "3G-HSDPA-HSUPA") || !strcmp (str, "HSDPA-HSUPA"))
+ return MM_MODEM_ACCESS_TECHNOLOGY_HSPA;
+
+ return MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN;
}
static void