aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-modem-helpers.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 9f71b240..01d0c790 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -2089,6 +2089,7 @@ MMModemAccessTechnology
mm_string_to_access_tech (const gchar *string)
{
MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN;
+ gsize len;
g_return_val_if_fail (string != NULL, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);
@@ -2102,14 +2103,15 @@ mm_string_to_access_tech (const gchar *string)
else if (strcasestr (string, "HSPA"))
act |= MM_MODEM_ACCESS_TECHNOLOGY_HSPA;
-
if (strcasestr (string, "HSUPA"))
act |= MM_MODEM_ACCESS_TECHNOLOGY_HSUPA;
if (strcasestr (string, "HSDPA"))
act |= MM_MODEM_ACCESS_TECHNOLOGY_HSDPA;
- if (strcasestr (string, "UMTS") || strcasestr (string, "3G"))
+ if (strcasestr (string, "UMTS") ||
+ strcasestr (string, "3G") ||
+ strcasestr (string, "WCDMA"))
act |= MM_MODEM_ACCESS_TECHNOLOGY_UMTS;
if (strcasestr (string, "EDGE"))
@@ -2133,6 +2135,17 @@ mm_string_to_access_tech (const gchar *string)
if (strcasestr (string, "1xRTT") || strcasestr (string, "CDMA2000 1X"))
act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT;
+ /* Check "EVDO" and "CDMA" as standalone strings since their characters
+ * are included in other strings too.
+ */
+ len = strlen (string);
+ if (strncmp (string, "EVDO", 4) && (len >= 4 && !isalnum (string[4])))
+ act |= MM_MODEM_ACCESS_TECHNOLOGY_EVDO0;
+ if (strncmp (string, "CDMA", 4) && (len >= 4 && !isalnum (string[4])))
+ act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT;
+ if (strncmp (string, "CDMA-EVDO", 9) && (len >= 9 && !isalnum (string[9])))
+ act |= MM_MODEM_ACCESS_TECHNOLOGY_1XRTT | MM_MODEM_ACCESS_TECHNOLOGY_EVDO0;
+
return act;
}