diff options
author | Andrew Lassalle <andrewlassalle@chromium.org> | 2021-10-15 10:47:39 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-17 17:56:44 +0200 |
commit | c355210f5da1be575ea117f5033dc3a9a06df473 (patch) | |
tree | ecc36f3d9acc3ae050f01d761237785a019033ce /libmm-glib | |
parent | b2a7591bcfc765089004129501d418f474a3ae8b (diff) |
bearer-properties: Add profile-name to the bearer properties
Diffstat (limited to 'libmm-glib')
-rw-r--r-- | libmm-glib/mm-bearer-properties.c | 41 | ||||
-rw-r--r-- | libmm-glib/mm-bearer-properties.h | 4 |
2 files changed, 45 insertions, 0 deletions
diff --git a/libmm-glib/mm-bearer-properties.c b/libmm-glib/mm-bearer-properties.c index 51d0a60b..4e3d7730 100644 --- a/libmm-glib/mm-bearer-properties.c +++ b/libmm-glib/mm-bearer-properties.c @@ -56,6 +56,44 @@ struct _MMBearerPropertiesPrivate { /*****************************************************************************/ /** + * mm_bearer_properties_set_profile_name: + * @self: a #MMBearerProperties. + * @profile_name: Name of the profile. + * + * Sets the name of the profile to use when connecting. + * + * Since: 1.20 + */ +void +mm_bearer_properties_set_profile_name (MMBearerProperties *self, + const gchar *profile_name) +{ + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + + mm_3gpp_profile_set_profile_name (self->priv->profile, profile_name); +} + +/** + * mm_bearer_properties_get_profile_name: + * @self: a #MMBearerProperties. + * + * Gets the name of the profile to use when connecting. + * + * Returns: (transfer none): the profile name, or #NULL if not set. Do not free + * the returned value, it is owned by @self. + * + * Since: 1.20 + */ +const gchar * +mm_bearer_properties_get_profile_name (MMBearerProperties *self) +{ + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + + return mm_3gpp_profile_get_profile_name (self->priv->profile); +} +/*****************************************************************************/ + +/** * mm_bearer_properties_set_apn: * @self: a #MMBearerProperties. * @apn: Name of the access point. @@ -784,6 +822,9 @@ mm_bearer_properties_cmp (MMBearerProperties *a, if (!(flags & MM_BEARER_PROPERTIES_CMP_FLAGS_NO_PROFILE_ID) && (mm_3gpp_profile_get_profile_id (a->priv->profile) != mm_3gpp_profile_get_profile_id (b->priv->profile))) return FALSE; + if (!(flags & MM_BEARER_PROPERTIES_CMP_FLAGS_NO_PROFILE_NAME) && + !cmp_str (mm_3gpp_profile_get_profile_name (a->priv->profile), mm_3gpp_profile_get_profile_name (b->priv->profile), flags)) + return FALSE; if (!(flags & MM_BEARER_PROPERTIES_CMP_FLAGS_NO_ALLOW_ROAMING)) { if (a->priv->allow_roaming != b->priv->allow_roaming) return FALSE; diff --git a/libmm-glib/mm-bearer-properties.h b/libmm-glib/mm-bearer-properties.h index e6e4f537..14b351a6 100644 --- a/libmm-glib/mm-bearer-properties.h +++ b/libmm-glib/mm-bearer-properties.h @@ -73,6 +73,8 @@ void mm_bearer_properties_set_apn_type (MMBearerProperties *self, MMBearerApnType apn_type); void mm_bearer_properties_set_profile_id (MMBearerProperties *self, gint profile_id); +void mm_bearer_properties_set_profile_name (MMBearerProperties *self, + const gchar *profile_name); void mm_bearer_properties_set_allow_roaming (MMBearerProperties *self, gboolean allow_roaming); void mm_bearer_properties_set_rm_protocol (MMBearerProperties *self, @@ -87,6 +89,7 @@ const gchar *mm_bearer_properties_get_password (MMBearerProper MMBearerIpFamily mm_bearer_properties_get_ip_type (MMBearerProperties *self); MMBearerApnType mm_bearer_properties_get_apn_type (MMBearerProperties *self); gint mm_bearer_properties_get_profile_id (MMBearerProperties *self); +const gchar *mm_bearer_properties_get_profile_name (MMBearerProperties *self); gboolean mm_bearer_properties_get_allow_roaming (MMBearerProperties *self); MMModemCdmaRmProtocol mm_bearer_properties_get_rm_protocol (MMBearerProperties *self); MMBearerMultiplexSupport mm_bearer_properties_get_multiplex (MMBearerProperties *self); @@ -126,6 +129,7 @@ typedef enum { MM_BEARER_PROPERTIES_CMP_FLAGS_NO_RM_PROTOCOL = 1 << 3, MM_BEARER_PROPERTIES_CMP_FLAGS_NO_APN_TYPE = 1 << 4, MM_BEARER_PROPERTIES_CMP_FLAGS_NO_PROFILE_ID = 1 << 5, + MM_BEARER_PROPERTIES_CMP_FLAGS_NO_PROFILE_NAME = 1 << 6, } MMBearerPropertiesCmpFlags; gboolean mm_bearer_properties_cmp (MMBearerProperties *a, |