aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
authorLukas Voegl <lvoegl@tdt.de>2023-09-15 12:59:54 +0200
committerLukas Voegl <lvoegl@tdt.de>2023-09-18 10:53:12 +0200
commit8cd1c1bdb9ba5bfe1b69b4484cc46bdd4720fdb4 (patch)
tree959258791644b9dd12dd8949c159363cf93e0ce8 /libmm-glib
parent1fc061b6a533780041de89dd70a2567a265f6080 (diff)
api,modem: new 'Physdev' property
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-modem.c48
-rw-r--r--libmm-glib/mm-modem.h3
2 files changed, 51 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c
index 8e1a80f2..bf684eda 100644
--- a/libmm-glib/mm-modem.c
+++ b/libmm-glib/mm-modem.c
@@ -776,6 +776,54 @@ mm_modem_dup_device (MMModem *self)
/*****************************************************************************/
/**
+ * mm_modem_get_physdev:
+ * @self: A #MMModem.
+ *
+ * Gets the physical modem device path (ie, USB, PCI, PCMCIA device), which
+ * may be dependent upon the operating system.
+ *
+ * <warning>The returned value is only valid until the property changes so it is
+ * only safe to use this function on the thread where @self was constructed. Use
+ * mm_modem_dup_physdev() if on another thread.</warning>
+ *
+ * Returns: (transfer none): The physdev path, or %NULL if none available. Do not
+ * free the returned value, it belongs to @self.
+ *
+ * Since: 1.22
+ */
+const gchar *
+mm_modem_get_physdev (MMModem *self)
+{
+ g_return_val_if_fail (MM_IS_MODEM (self), NULL);
+
+ RETURN_NON_EMPTY_CONSTANT_STRING (
+ mm_gdbus_modem_get_physdev (MM_GDBUS_MODEM (self)));
+}
+
+/**
+ * mm_modem_dup_physdev:
+ * @self: A #MMModem.
+ *
+ * Gets a copy of the physical modem device path (ie, USB, PCI, PCMCIA
+ * device), which may be dependent upon the operating system.
+ *
+ * Returns: (transfer full): The physdev path, or %NULL if none available. The
+ * returned value should be freed with g_free().
+ *
+ * Since: 1.22
+ */
+gchar *
+mm_modem_dup_physdev (MMModem *self)
+{
+ g_return_val_if_fail (MM_IS_MODEM (self), NULL);
+
+ RETURN_NON_EMPTY_STRING (
+ mm_gdbus_modem_dup_physdev (MM_GDBUS_MODEM (self)));
+}
+
+/*****************************************************************************/
+
+/**
* mm_modem_get_drivers:
* @self: A #MMModem.
*
diff --git a/libmm-glib/mm-modem.h b/libmm-glib/mm-modem.h
index 9d1a7333..d59f09a1 100644
--- a/libmm-glib/mm-modem.h
+++ b/libmm-glib/mm-modem.h
@@ -119,6 +119,9 @@ gchar *mm_modem_dup_device_identifier (MMModem *self);
const gchar *mm_modem_get_device (MMModem *self);
gchar *mm_modem_dup_device (MMModem *self);
+const gchar *mm_modem_get_physdev (MMModem *self);
+gchar *mm_modem_dup_physdev (MMModem *self);
+
const gchar * const *mm_modem_get_drivers (MMModem *self);
gchar **mm_modem_dup_drivers (MMModem *self);