[MM 0.6/nm-applet] Patches to indicate active LTE network connection in NM applet and other clients




Attached patches to indicate in nm-applet to the user if the modem is connected to a LTE network. This is very useful for integrated combined 3G/CDMA and LTE modems as they might not provide an LED to indicate this to the user as external USB modems often do.

Regarding backwards compatibility, if only the MM patch is in use, nm-applet will display a LTE connection as "GSM" (default catch-all), which I find acceptable. I assume other indicator clients also provide default values for unknown access technologies.

Nm-applet patch also add support for HSPA+. There should probably be created new icons for these also, but I have actually never seen the old ones in use either, so I wonder if there is a bug there too.

--
Marius

>From bd4e3ca183b6bdc8bca10d1867ebbf05f47139bf Mon Sep 17 00:00:00 2001
From: "Marius B. Kotsbak" <marius kotsbak com>
Date: Fri, 31 Aug 2012 12:15:14 +0200
Subject: [PATCH] modem-helpers: Add support for LTE/4G access technology
 parsing.

---
 src/mm-modem-helpers.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 9a72236..a8b659d 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -976,7 +976,9 @@ mm_gsm_string_to_access_tech (const char *string)
     /* Better technologies are listed first since modems sometimes say
      * stuff like "GPRS/EDGE" and that should be handled as EDGE.
      */
-    if (strcasestr (string, "HSPA+"))
+    if (strcasestr (string, "LTE") || strcasestr (string, "4G"))
+        return MM_MODEM_GSM_ACCESS_TECH_LTE;
+    else if (strcasestr (string, "HSPA+"))
         return MM_MODEM_GSM_ACCESS_TECH_HSPA_PLUS;
     else if (strcasestr (string, "HSPA"))
         return MM_MODEM_GSM_ACCESS_TECH_HSPA;
-- 
1.7.10.4

>From 1dfd2170fb46fd3002b965911fdce03b52a1136a Mon Sep 17 00:00:00 2001
From: "Marius B. Kotsbak" <marius kotsbak com>
Date: Sat, 1 Sep 2012 15:48:53 +0200
Subject: [PATCH] applet: add support for indicating HSPA+ and LTE
 technologies in the applet.

---
 src/applet-device-gsm.c |    8 +++++++-
 src/mb-menu-item.c      |    6 +++++-
 src/mobile-helpers.c    |    2 ++
 src/mobile-helpers.h    |    2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index 5d498aa..27e7a04 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -58,8 +58,10 @@ typedef enum {
     MM_MODEM_GSM_ACCESS_TECH_HSDPA       = 6,  /* UTRAN w/HSDPA */
     MM_MODEM_GSM_ACCESS_TECH_HSUPA       = 7,  /* UTRAN w/HSUPA */
     MM_MODEM_GSM_ACCESS_TECH_HSPA        = 8,  /* UTRAN w/HSDPA and HSUPA */
+    MM_MODEM_GSM_ACCESS_TECH_HSPA_PLUS   = 9,
+    MM_MODEM_GSM_ACCESS_TECH_LTE         = 10,
 
-    MM_MODEM_GSM_ACCESS_TECH_LAST = MM_MODEM_GSM_ACCESS_TECH_HSPA
+    MM_MODEM_GSM_ACCESS_TECH_LAST = MM_MODEM_GSM_ACCESS_TECH_LTE
 } MMModemGsmAccessTech;
 
 typedef struct {
@@ -354,6 +356,10 @@ gsm_act_to_mb_act (GsmDeviceInfo *info)
 		return MB_TECH_HSUPA;
 	case MM_MODEM_GSM_ACCESS_TECH_HSPA:
 		return MB_TECH_HSPA;
+	case MM_MODEM_GSM_ACCESS_TECH_HSPA_PLUS:
+		return MB_TECH_HSPA_PLUS;
+	case MM_MODEM_GSM_ACCESS_TECH_LTE:
+		return MB_TECH_LTE;
 	default:
 		break;
 	}
diff --git a/src/mb-menu-item.c b/src/mb-menu-item.c
index 8a32f7d..7fdd413 100644
--- a/src/mb-menu-item.c
+++ b/src/mb-menu-item.c
@@ -67,10 +67,14 @@ get_tech_name (guint32 tech)
 		return _("HSDPA");
 	case MB_TECH_HSUPA:
 		return _("HSUPA");
-	case MB_TECH_HSPA:
+ 	case MB_TECH_HSPA:
 		return _("HSPA");
+ 	case MB_TECH_HSPA_PLUS:
+		return _("HSPA+");
 	case MB_TECH_WIMAX:
 		return _("WiMAX");
+ 	case MB_TECH_LTE:
+		return _("LTE");
 	default:
 		break;
 	}
diff --git a/src/mobile-helpers.c b/src/mobile-helpers.c
index ab5c505..756166b 100644
--- a/src/mobile-helpers.c
+++ b/src/mobile-helpers.c
@@ -117,6 +117,8 @@ mobile_helper_get_tech_icon (guint32 tech, NMApplet *applet)
 	case MB_TECH_HSDPA:
 	case MB_TECH_HSUPA:
 	case MB_TECH_HSPA:
+	case MB_TECH_HSPA_PLUS:
+	case MB_TECH_LTE:
 		return nma_icon_check_and_load ("nm-tech-hspa", &applet->mb_tech_hspa_icon, applet);
 	case MB_TECH_WIMAX:
 	default:
diff --git a/src/mobile-helpers.h b/src/mobile-helpers.h
index 28b93f9..578ec13 100644
--- a/src/mobile-helpers.h
+++ b/src/mobile-helpers.h
@@ -47,6 +47,8 @@ enum {
 	MB_TECH_HSDPA,
 	MB_TECH_HSUPA,
 	MB_TECH_HSPA,
+	MB_TECH_HSPA_PLUS,
+	MB_TECH_LTE,
 	MB_TECH_WIMAX,
 };
 
-- 
1.7.10.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]