From 73db7f205c3326492648f6ebedb8d07b959a6e55 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 25 Feb 2021 20:41:28 +0100 Subject: [PATCH] api,bearer: new 'Multiplexed' property This property will be TRUE if the bearer has the data session connected through a multiplexed interface. If the bearer is disconnected, or connected without multiplexing, the property will report FALSE. --- cli/mmcli-bearer.c | 9 +++--- cli/mmcli-output.c | 1 + cli/mmcli-output.h | 1 + .../libmm-glib/libmm-glib-sections.txt | 3 ++ .../org.freedesktop.ModemManager1.Bearer.xml | 8 +++++ libmm-glib/mm-bearer.c | 22 ++++++++++++++ libmm-glib/mm-bearer.h | 2 ++ src/mm-base-bearer.c | 30 +++++++++++++++---- src/mm-base-bearer.h | 5 ++++ 9 files changed, 72 insertions(+), 9 deletions(-) diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c index d589e6ed..eab31c05 100644 --- a/cli/mmcli-bearer.c +++ b/cli/mmcli-bearer.c @@ -146,10 +146,11 @@ print_bearer_info (MMBearer *bearer) 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))); - mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTED, mm_bearer_get_connected (bearer) ? "yes" : "no"); - mmcli_output_string (MMC_F_BEARER_STATUS_SUSPENDED, mm_bearer_get_suspended (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 (MMC_F_BEARER_STATUS_CONNECTED, mm_bearer_get_connected (bearer) ? "yes" : "no"); + mmcli_output_string (MMC_F_BEARER_STATUS_SUSPENDED, mm_bearer_get_suspended (bearer) ? "yes" : "no"); + 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))); /* Properties */ { diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c index 3ef7fd12..6040d5d5 100644 --- a/cli/mmcli-output.c +++ b/cli/mmcli-output.c @@ -208,6 +208,7 @@ static FieldInfo field_infos[] = { [MMC_F_BEARER_GENERAL_TYPE] = { "bearer.type", "type", MMC_S_BEARER_GENERAL, }, [MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, }, [MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, }, + [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_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, }, diff --git a/cli/mmcli-output.h b/cli/mmcli-output.h index dea575b0..283f2d43 100644 --- a/cli/mmcli-output.h +++ b/cli/mmcli-output.h @@ -224,6 +224,7 @@ typedef enum { /* Bearer status section */ MMC_F_BEARER_STATUS_CONNECTED, MMC_F_BEARER_STATUS_SUSPENDED, + MMC_F_BEARER_STATUS_MULTIPLEXED, MMC_F_BEARER_STATUS_INTERFACE, MMC_F_BEARER_STATUS_IP_TIMEOUT, /* Bearer properties section */ diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt index c9d9b0fd..e33408b8 100644 --- a/docs/reference/libmm-glib/libmm-glib-sections.txt +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt @@ -1073,6 +1073,7 @@ mm_bearer_get_interface mm_bearer_dup_interface mm_bearer_get_connected mm_bearer_get_suspended +mm_bearer_get_multiplexed mm_bearer_get_ip_timeout mm_bearer_get_bearer_type mm_bearer_peek_ipv4_config @@ -1751,6 +1752,7 @@ mm_gdbus_bearer_get_properties mm_gdbus_bearer_dup_properties 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_stats mm_gdbus_bearer_dup_stats @@ -1772,6 +1774,7 @@ mm_gdbus_bearer_set_properties mm_gdbus_bearer_set_suspended mm_gdbus_bearer_set_bearer_type mm_gdbus_bearer_set_stats +mm_gdbus_bearer_set_multiplexed mm_gdbus_bearer_override_properties mm_gdbus_bearer_complete_connect mm_gdbus_bearer_complete_disconnect diff --git a/introspection/org.freedesktop.ModemManager1.Bearer.xml b/introspection/org.freedesktop.ModemManager1.Bearer.xml index fb008797..94332215 100644 --- a/introspection/org.freedesktop.ModemManager1.Bearer.xml +++ b/introspection/org.freedesktop.ModemManager1.Bearer.xml @@ -102,6 +102,14 @@ --> + + +