diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2022-09-13 11:11:40 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2022-11-04 13:12:56 +0000 |
commit | 46af452487b00766563ba1f8942e18caefa26cc5 (patch) | |
tree | 94f0545a4645ce3ec5189f18886e404998fa8acc | |
parent | a114e131abefae58379bfb201761debada4ea9fa (diff) |
libmm-glib,bearer-properties: new print() method
-rw-r--r-- | libmm-glib/mm-bearer-properties.c | 32 | ||||
-rw-r--r-- | libmm-glib/mm-bearer-properties.h | 6 |
2 files changed, 36 insertions, 2 deletions
diff --git a/libmm-glib/mm-bearer-properties.c b/libmm-glib/mm-bearer-properties.c index 0d2d1a75..6d0750bc 100644 --- a/libmm-glib/mm-bearer-properties.c +++ b/libmm-glib/mm-bearer-properties.c @@ -17,12 +17,14 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright (C) 2011-2021 Aleksander Morgado <aleksander@aleksander.es> + * Copyright (C) 2011-2022 Aleksander Morgado <aleksander@aleksander.es> + * Copyright (C) 2022 Google, Inc. */ #include <string.h> #include "mm-errors-types.h" +#include "mm-enums-types.h" #include "mm-common-helpers.h" #include "mm-bearer-properties.h" @@ -936,6 +938,34 @@ mm_bearer_properties_cmp (MMBearerProperties *a, /*****************************************************************************/ /** + * mm_bearer_properties_print: (skip) + */ +GPtrArray * +mm_bearer_properties_print (MMBearerProperties *self, + gboolean show_personal_info) +{ + GPtrArray *array; + const gchar *aux; + + array = mm_3gpp_profile_print (self->priv->profile, show_personal_info); + if (self->priv->allow_roaming_set) { + aux = mm_common_str_boolean (self->priv->allow_roaming); + g_ptr_array_add (array, g_strdup_printf (PROPERTY_ALLOW_ROAMING ": %s", aux)); + } + if (self->priv->multiplex != MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) { + aux = mm_bearer_multiplex_support_get_string (self->priv->multiplex); + g_ptr_array_add (array, g_strdup_printf (PROPERTY_MULTIPLEX ": %s", aux)); + } + if (self->priv->rm_protocol != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) { + aux = mm_modem_cdma_rm_protocol_get_string (self->priv->rm_protocol); + g_ptr_array_add (array, g_strdup_printf (PROPERTY_RM_PROTOCOL ": %s", aux)); + } + return array; +} + +/*****************************************************************************/ + +/** * mm_bearer_properties_new_from_profile: (skip) */ MMBearerProperties * diff --git a/libmm-glib/mm-bearer-properties.h b/libmm-glib/mm-bearer-properties.h index 0e6a3471..9e522022 100644 --- a/libmm-glib/mm-bearer-properties.h +++ b/libmm-glib/mm-bearer-properties.h @@ -17,7 +17,8 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA.o * - * Copyright (C) 2011-2021 Aleksander Morgado <aleksander@aleksander.es> + * Copyright (C) 2011-2022 Aleksander Morgado <aleksander@aleksander.es> + * Copyright (C) 2022 Google, Inc. */ #ifndef MM_BEARER_PROPERTIES_H @@ -151,6 +152,9 @@ gboolean mm_bearer_properties_cmp (MMBearerProperties *a, MMBearerProperties *b, MMBearerPropertiesCmpFlags flags); +GPtrArray *mm_bearer_properties_print (MMBearerProperties *self, + gboolean show_personal_info); + #endif G_END_DECLS |