[PATCH 1/2 v2] iface-modem: add mm_iface_modem_get_model helper to query model
Ben Chan
benchan at chromium.org
Wed Aug 14 00:01:28 PDT 2013
---
src/mm-iface-modem.c | 20 ++++++++++++++++++++
src/mm-iface-modem.h | 3 +++
2 files changed, 23 insertions(+)
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index f0f10ce..3a12a6a 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -4806,6 +4806,26 @@ mm_iface_modem_is_cdma_only (MMIfaceModem *self)
/*****************************************************************************/
+const gchar *
+mm_iface_modem_get_model (MMIfaceModem *self)
+{
+ const gchar *model = NULL;
+ MmGdbusModem *skeleton;
+
+ g_object_get (self,
+ MM_IFACE_MODEM_DBUS_SKELETON, &skeleton,
+ NULL);
+
+ if (skeleton) {
+ model = mm_gdbus_modem_get_model (skeleton);
+ g_object_unref (skeleton);
+ }
+
+ return model;
+}
+
+/*****************************************************************************/
+
static void
iface_modem_init (gpointer g_iface)
{
diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h
index cadf31e..a092333 100644
--- a/src/mm-iface-modem.h
+++ b/src/mm-iface-modem.h
@@ -344,6 +344,9 @@ gboolean mm_iface_modem_is_3g_only (MMIfaceModem *self);
gboolean mm_iface_modem_is_4g (MMIfaceModem *self);
gboolean mm_iface_modem_is_4g_only (MMIfaceModem *self);
+/* Helper to query model */
+const gchar *mm_iface_modem_get_model (MMIfaceModem *self);
+
/* Initialize Modem interface (async) */
void mm_iface_modem_initialize (MMIfaceModem *self,
GCancellable *cancellable,
--
1.8.3
More information about the ModemManager-devel
mailing list