aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/mmcli-bearer.c6
-rw-r--r--cli/mmcli-output.c1
-rw-r--r--cli/mmcli-output.h1
-rw-r--r--docs/reference/libmm-glib/libmm-glib-sections.txt3
-rw-r--r--introspection/org.freedesktop.ModemManager1.Bearer.xml14
-rw-r--r--libmm-glib/mm-bearer.c22
-rw-r--r--libmm-glib/mm-bearer.h2
7 files changed, 49 insertions, 0 deletions
diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c
index 8dbcece5..54d2d4c7 100644
--- a/cli/mmcli-bearer.c
+++ b/cli/mmcli-bearer.c
@@ -137,11 +137,16 @@ print_bearer_info (MMBearer *bearer)
MMBearerIpConfig *ipv6_config;
MMBearerProperties *properties;
MMBearerStats *stats;
+ gint profile_id;
+ gchar *profile_id_str;
ipv4_config = mm_bearer_get_ipv4_config (bearer);
ipv6_config = mm_bearer_get_ipv6_config (bearer);
properties = mm_bearer_get_properties (bearer);
stats = mm_bearer_get_stats (bearer);
+ profile_id = mm_bearer_get_profile_id (bearer);
+
+ profile_id_str = (profile_id != MM_3GPP_PROFILE_ID_UNKNOWN) ? g_strdup_printf ("%d", profile_id) : NULL;
mmcli_output_string (MMC_F_BEARER_GENERAL_DBUS_PATH, mm_bearer_get_path (bearer));
mmcli_output_string (MMC_F_BEARER_GENERAL_TYPE, mm_bearer_type_get_string (mm_bearer_get_bearer_type (bearer)));
@@ -151,6 +156,7 @@ print_bearer_info (MMBearer *bearer)
mmcli_output_string (MMC_F_BEARER_STATUS_MULTIPLEXED, mm_bearer_get_multiplexed (bearer) ? "yes" : "no");
mmcli_output_string (MMC_F_BEARER_STATUS_INTERFACE, mm_bearer_get_interface (bearer));
mmcli_output_string_take (MMC_F_BEARER_STATUS_IP_TIMEOUT, g_strdup_printf ("%u", mm_bearer_get_ip_timeout (bearer)));
+ mmcli_output_string_take (MMC_F_BEARER_STATUS_PROFILE_ID, profile_id_str);
/* Properties */
{
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c
index c9f780d2..9eb30056 100644
--- a/cli/mmcli-output.c
+++ b/cli/mmcli-output.c
@@ -214,6 +214,7 @@ static FieldInfo field_infos[] = {
[MMC_F_BEARER_STATUS_MULTIPLEXED] = { "bearer.status.multiplexed", "multiplexed", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_IP_TIMEOUT] = { "bearer.status.ip-timeout", "ip timeout", MMC_S_BEARER_STATUS, },
+ [MMC_F_BEARER_STATUS_PROFILE_ID] = { "bearer.status.profile-id", "profile id", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_APN_TYPE] = { "bearer.properties.apn-type", "apn type", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_ROAMING] = { "bearer.properties.roaming", "roaming", MMC_S_BEARER_PROPERTIES, },
diff --git a/cli/mmcli-output.h b/cli/mmcli-output.h
index 79d2e2be..28754cd8 100644
--- a/cli/mmcli-output.h
+++ b/cli/mmcli-output.h
@@ -231,6 +231,7 @@ typedef enum {
MMC_F_BEARER_STATUS_MULTIPLEXED,
MMC_F_BEARER_STATUS_INTERFACE,
MMC_F_BEARER_STATUS_IP_TIMEOUT,
+ MMC_F_BEARER_STATUS_PROFILE_ID,
/* Bearer properties section */
MMC_F_BEARER_PROPERTIES_APN,
MMC_F_BEARER_PROPERTIES_APN_TYPE,
diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt
index 7cbd519e..46a10bba 100644
--- a/docs/reference/libmm-glib/libmm-glib-sections.txt
+++ b/docs/reference/libmm-glib/libmm-glib-sections.txt
@@ -1082,6 +1082,7 @@ mm_bearer_get_suspended
mm_bearer_get_multiplexed
mm_bearer_get_ip_timeout
mm_bearer_get_bearer_type
+mm_bearer_get_profile_id
mm_bearer_peek_ipv4_config
mm_bearer_get_ipv4_config
mm_bearer_peek_ipv6_config
@@ -1837,6 +1838,7 @@ mm_gdbus_bearer_get_connected
mm_gdbus_bearer_get_suspended
mm_gdbus_bearer_get_multiplexed
mm_gdbus_bearer_get_bearer_type
+mm_gdbus_bearer_get_profile_id
mm_gdbus_bearer_get_stats
mm_gdbus_bearer_dup_stats
<SUBSECTION Methods>
@@ -1856,6 +1858,7 @@ mm_gdbus_bearer_set_ip_timeout
mm_gdbus_bearer_set_properties
mm_gdbus_bearer_set_suspended
mm_gdbus_bearer_set_bearer_type
+mm_gdbus_bearer_set_profile_id
mm_gdbus_bearer_set_stats
mm_gdbus_bearer_set_multiplexed
mm_gdbus_bearer_override_properties
diff --git a/introspection/org.freedesktop.ModemManager1.Bearer.xml b/introspection/org.freedesktop.ModemManager1.Bearer.xml
index a60993e9..645f041c 100644
--- a/introspection/org.freedesktop.ModemManager1.Bearer.xml
+++ b/introspection/org.freedesktop.ModemManager1.Bearer.xml
@@ -361,6 +361,20 @@
<property name="BearerType" type="u" access="read" />
<!--
+ ProfileId:
+
+ The profile ID this bearer object is associated with, only applicable if
+ the modem supports profile management operations, and if the bearer is
+ connected.
+
+ If the bearer is disconnected, or if profile management operations are
+ not supported, -1 will be reported.
+
+ Since: 1.18
+ -->
+ <property name="ProfileId" type="i" access="read" />
+
+ <!--
Properties:
List of settings used to create the bearer.
diff --git a/libmm-glib/mm-bearer.c b/libmm-glib/mm-bearer.c
index 31668281..1c6a1cdd 100644
--- a/libmm-glib/mm-bearer.c
+++ b/libmm-glib/mm-bearer.c
@@ -264,6 +264,28 @@ mm_bearer_get_bearer_type (MMBearer *self)
/*****************************************************************************/
+/**
+ * mm_bearer_get_profile_id:
+ * @self: A #MMBearer.
+ *
+ * Gets profile ID associated to the bearer connection, if known.
+ *
+ * If the bearer is disconnected or the modem doesn't support profile management
+ * features, %MM_3GPP_PROFILE_ID_UNKNOWN.
+ *
+ * Returns: a profile id.
+ *
+ * Since: 1.18
+ */
+gint
+mm_bearer_get_profile_id (MMBearer *self)
+{
+ g_return_val_if_fail (MM_IS_BEARER (self), MM_3GPP_PROFILE_ID_UNKNOWN);
+
+ return mm_gdbus_bearer_get_profile_id (MM_GDBUS_BEARER (self));
+}
+/*****************************************************************************/
+
static void
ipv4_config_updated (MMBearer *self,
GParamSpec *pspec)
diff --git a/libmm-glib/mm-bearer.h b/libmm-glib/mm-bearer.h
index c96888df..9f15e926 100644
--- a/libmm-glib/mm-bearer.h
+++ b/libmm-glib/mm-bearer.h
@@ -84,6 +84,8 @@ guint mm_bearer_get_ip_timeout (MMBearer *self);
MMBearerType mm_bearer_get_bearer_type (MMBearer *self);
+gint mm_bearer_get_profile_id (MMBearer *self);
+
void mm_bearer_connect (MMBearer *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,