Revert "icera: improve parsing of access technologies in %NWSTATE response"

This reverts commit e2f3034f6e.

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.
This commit is contained in:
Aleksander Morgado
2012-10-16 11:34:36 +02:00
parent e2f3034f6e
commit 6223f61803
+19 -19
View File
@@ -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;
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 technologies;
return MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN;
}
static void