aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-25 14:43:22 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-03-10 10:59:22 +0100
commit35e20a48c8b16ae744c4ca3082f70e8aa674c2f4 (patch)
tree2b23fb243ebc151bbac167f9165f5b1cfef6390e /libmm-glib
parent064e92e9b77b35f83cb522c6ea98b9016ce5db8c (diff)
api,modem: deprecate the 'MaxBearers' property
This property was never initialized with a correct value, we would always use the same value as used for MaxActiveBearers, which isn't technically right. Just suggest to ignore this property, and flag it as deprecated. In addition to deprecating the API property, we will internally no longer limit the amount of bearer objects that may be created with different connection settings. The bearer object exposed in DBus is a representation of the connection that may be setup, and so we can hold as many representations as we want as long as the amount of connected bearers doesn't exceed the maximum amount for each modem. Leaving around the disconnected modems also serves another purpose. Each bearer holds information about the amount of times a connection with it has been attempted, and the amount of data transferred through it. If we use the Simple.Connect() method to connect the modem using different bearer settings, we won't lose the information of the past connection attempts with different settings.
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-modem.c9
-rw-r--r--libmm-glib/mm-modem.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c
index 38300d49..e3b29bb5 100644
--- a/libmm-glib/mm-modem.c
+++ b/libmm-glib/mm-modem.c
@@ -395,6 +395,8 @@ mm_modem_get_current_capabilities (MMModem *self)
/*****************************************************************************/
+#ifndef MM_DISABLE_DEPRECATED
+
/**
* mm_modem_get_max_bearers:
* @self: a #MMModem.
@@ -412,6 +414,11 @@ mm_modem_get_current_capabilities (MMModem *self)
* Returns: the maximum number of defined packet data bearers.
*
* Since: 1.0
+ * Deprecated: 1.18. There is no way to query the modem how many bearers
+ * it supports, so the value exposed in this property in all the different
+ * implementations is always equal to the one retrieved with
+ * mm_modem_get_max_active_bearers(), so there is no point in using this
+ * method.
*/
guint
mm_modem_get_max_bearers (MMModem *self)
@@ -421,6 +428,8 @@ mm_modem_get_max_bearers (MMModem *self)
return mm_gdbus_modem_get_max_bearers (MM_GDBUS_MODEM (self));
}
+#endif /* MM_DISABLE_DEPRECATED */
+
/*****************************************************************************/
/**
diff --git a/libmm-glib/mm-modem.h b/libmm-glib/mm-modem.h
index 0d887eae..589ddafa 100644
--- a/libmm-glib/mm-modem.h
+++ b/libmm-glib/mm-modem.h
@@ -89,7 +89,10 @@ gboolean mm_modem_get_supported_capabilities (MMModem *self,
MMModemCapability mm_modem_get_current_capabilities (MMModem *self);
+#ifndef MM_DISABLE_DEPRECATED
+G_DEPRECATED
guint mm_modem_get_max_bearers (MMModem *self);
+#endif /* MM_DISABLE_DEPRECATED */
guint mm_modem_get_max_active_bearers (MMModem *self);