aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2016-08-18 11:39:11 -0500
committerDan Williams <dcbw@redhat.com>2016-08-31 09:43:32 -0500
commit03a6d969ab594dab9124ef680cf3944e56870a85 (patch)
tree9302f97e29bf8665e48edcb63255472e101ffb33 /src/mm-modem-helpers.c
parent3d95a9863bd9ee3c150d4039fe42e47980a9247a (diff)
broadband-modem-huawei: implement Modem.Signal extended signal info interface
Implement the detailed signal info interface for some Huawei 3GPP modems including those based on HiSilicon chipsets like the E3276. Known not to work on many Qualcomm-based Huawei modems like E392, E397, and E367 as they don't support the ^HCSQ command, but they do support QMI and so have access to the extended signal interface via QMI.
Diffstat (limited to 'src/mm-modem-helpers.c')
-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;
}