aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-12-18 16:57:07 +0100
committerAleksander Morgado <aleksander@aleksander.es>2019-04-02 12:14:03 +0200
commit52b67dc7c3a2b432f6c64b8e4d56b7f2e4d28066 (patch)
tree4a0349ecedb10c3a326590fb045ae195f9cf6857 /libmm-glib
parentc479d036f7717adbc922e52ba305df8a304bd690 (diff)
api,modem: new 'CarrierConfigurationRevision' property
Which reports the version of the currently active carrier configuration. We also update the firmware 'version' reported in the firmware settings so that carrier-specific upgrades can be performed (e.g. when the firmware stays the same but the MCFG is updated).
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-modem.c41
-rw-r--r--libmm-glib/mm-modem.h6
2 files changed, 45 insertions, 2 deletions
diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c
index d7d59542..9aab4531 100644
--- a/libmm-glib/mm-modem.c
+++ b/libmm-glib/mm-modem.c
@@ -544,6 +544,47 @@ mm_modem_dup_carrier_configuration (MMModem *self)
/*****************************************************************************/
/**
+ * mm_modem_get_carrier_configuration_revision:
+ * @self: A #MMModem.
+ *
+ * Gets the carrier-specific configuration revision in use, as reported by this #MMModem.
+ *
+ * <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_carrier_configuration() if on another
+ * thread.</warning>
+ *
+ * Returns: (transfer none): The carrier configuration revision, or %NULL if none available. Do not free the returned value, it belongs to @self.
+ */
+const gchar *
+mm_modem_get_carrier_configuration_revision (MMModem *self)
+{
+ g_return_val_if_fail (MM_IS_MODEM (self), NULL);
+
+ RETURN_NON_EMPTY_CONSTANT_STRING (
+ mm_gdbus_modem_get_carrier_configuration_revision (MM_GDBUS_MODEM (self)));
+}
+
+/**
+ * mm_modem_dup_carrier_configuration_revision:
+ * @self: A #MMModem.
+ *
+ * Gets a copy of the carrier-specific configuration revision in use, as reported by this #MMModem.
+ *
+ * Returns: (transfer full): The carrier configuration revision, or %NULL if none available. The returned value should be freed with g_free().
+ */
+gchar *
+mm_modem_dup_carrier_configuration_revision (MMModem *self)
+{
+ g_return_val_if_fail (MM_IS_MODEM (self), NULL);
+
+ RETURN_NON_EMPTY_STRING (
+ mm_gdbus_modem_dup_carrier_configuration_revision (MM_GDBUS_MODEM (self)));
+}
+
+/*****************************************************************************/
+
+/**
* mm_modem_get_hardware_revision:
* @self: A #MMModem.
*
diff --git a/libmm-glib/mm-modem.h b/libmm-glib/mm-modem.h
index 95719d6a..e494ced6 100644
--- a/libmm-glib/mm-modem.h
+++ b/libmm-glib/mm-modem.h
@@ -103,8 +103,10 @@ gchar *mm_modem_dup_model (MMModem *self);
const gchar *mm_modem_get_revision (MMModem *self);
gchar *mm_modem_dup_revision (MMModem *self);
-const gchar *mm_modem_get_carrier_configuration (MMModem *self);
-gchar *mm_modem_dup_carrier_configuration (MMModem *self);
+const gchar *mm_modem_get_carrier_configuration (MMModem *self);
+gchar *mm_modem_dup_carrier_configuration (MMModem *self);
+const gchar *mm_modem_get_carrier_configuration_revision (MMModem *self);
+gchar *mm_modem_dup_carrier_configuration_revision (MMModem *self);
const gchar *mm_modem_get_hardware_revision (MMModem *self);
gchar *mm_modem_dup_hardware_revision (MMModem *self);