aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
authorLukas Voegl <lvoegl@tdt.de>2024-11-22 15:53:33 +0100
committerLukas Voegl <lvoegl@tdt.de>2025-04-25 09:37:16 +0200
commit436081648b3587096683bd3ba4d219d16f14efb5 (patch)
tree4d134aeef271bd970c527dadfd611d05fec9903c /libmm-glib
parent39123f964ba6f359987f22d89317a842d8f1d528 (diff)
api,modem: new 'IgnoredPorts' property
Expose a new list of 'IgnoredPorts' via D-Bus and therefore remove the use of `MM_MODEM_PORT_TYPE_IGNORED` Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-modem.c43
-rw-r--r--libmm-glib/mm-modem.h8
2 files changed, 50 insertions, 1 deletions
diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c
index bf684eda..28f4f768 100644
--- a/libmm-glib/mm-modem.c
+++ b/libmm-glib/mm-modem.c
@@ -47,6 +47,7 @@ struct _MMModemPrivate {
GMutex mutex;
PROPERTY_ARRAY_DECLARE (ports)
+ PROPERTY_ARRAY_DECLARE (ignored_ports)
PROPERTY_ARRAY_DECLARE (supported_modes)
PROPERTY_ARRAY_DECLARE (supported_capabilities)
PROPERTY_ARRAY_DECLARE (supported_bands)
@@ -984,7 +985,7 @@ mm_modem_dup_primary_port (MMModem *self)
* mm_modem_port_info_array_free() when no longer needed.
* @n_ports: (out): Return location for the number of values in @ports.
*
- * Gets the list of ports in the modem.
+ * Gets the list of used ports in the modem.
*
* Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
*
@@ -1000,6 +1001,44 @@ PROPERTY_ARRAY_DEFINE_DEEP (ports,
/*****************************************************************************/
/**
+ * mm_modem_peek_ignored_ports:
+ * @self: A #MMModem.
+ * @ports: (out) (array length=n_ports) (transfer none): Return location for the
+ * array of #MMModemPortInfo values. Do not free the returned value, it is
+ * owned by @self.
+ * @n_ports: (out): Return location for the number of values in @ports.
+ *
+ * Gets the list of ignored ports in the modem.
+ *
+ * Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
+ *
+ * Since: 1.26
+ */
+
+/**
+ * mm_modem_get_ignored_ports:
+ * @self: A #MMModem.
+ * @ports: (out) (array length=n_ports): Return location for the array of
+ * #MMModemPortInfo values. The returned array should be freed with
+ * mm_modem_port_info_array_free() when no longer needed.
+ * @n_ports: (out): Return location for the number of values in @ports.
+ *
+ * Gets the list of ignored ports in the modem.
+ *
+ * Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
+ *
+ * Since: 1.26
+ */
+
+PROPERTY_ARRAY_DEFINE_DEEP (ignored_ports,
+ Modem, modem, MODEM,
+ MMModemPortInfo,
+ mm_common_ports_variant_to_garray,
+ mm_common_ports_garray_to_array)
+
+/*****************************************************************************/
+
+/**
* mm_modem_get_equipment_identifier:
* @self: A #MMModem.
*
@@ -3430,6 +3469,7 @@ mm_modem_init (MMModem *self)
g_mutex_init (&self->priv->mutex);
PROPERTY_INITIALIZE (ports, "ports")
+ PROPERTY_INITIALIZE (ignored_ports, "ignored-ports")
PROPERTY_INITIALIZE (supported_modes, "supported-modes")
PROPERTY_INITIALIZE (supported_capabilities, "supported-capabilities")
PROPERTY_INITIALIZE (supported_bands, "supported-bands")
@@ -3445,6 +3485,7 @@ finalize (GObject *object)
g_mutex_clear (&self->priv->mutex);
PROPERTY_ARRAY_FINALIZE (ports)
+ PROPERTY_ARRAY_FINALIZE (ignored_ports)
PROPERTY_ARRAY_FINALIZE (supported_modes)
PROPERTY_ARRAY_FINALIZE (supported_capabilities)
PROPERTY_ARRAY_FINALIZE (supported_bands)
diff --git a/libmm-glib/mm-modem.h b/libmm-glib/mm-modem.h
index d59f09a1..58a2e116 100644
--- a/libmm-glib/mm-modem.h
+++ b/libmm-glib/mm-modem.h
@@ -138,6 +138,14 @@ gboolean mm_modem_get_ports (MMModem *self,
MMModemPortInfo **ports,
guint *n_ports);
+gboolean mm_modem_peek_ignored_ports (MMModem *self,
+ const MMModemPortInfo **ports,
+ guint *n_ports);
+
+gboolean mm_modem_get_ignored_ports (MMModem *self,
+ MMModemPortInfo **ports,
+ guint *n_ports);
+
const gchar *mm_modem_get_equipment_identifier (MMModem *self);
gchar *mm_modem_dup_equipment_identifier (MMModem *self);