From 853aa29be80ee397f64d18c4d9cce64be35aec14 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 13 Dec 2021 14:08:43 +0100 Subject: iface-modem-3gpp-profile-manager: support 'apn-type' as index field The modem may report the 'apn-type' field is the one to be used as index; if that's the case, allow setting and deleting profiles based on the given 'apn-type' field. This change also makes the internal profile management operations use one index field or another, based on what the protocol implements. --- src/mm-bearer-list.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mm-bearer-list.c') diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index 24fdac0a..790115eb 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -171,6 +171,22 @@ mm_bearer_list_find_by_profile_id (MMBearerList *self, return NULL; } +MMBaseBearer * +mm_bearer_list_find_by_apn_type (MMBearerList *self, + MMBearerApnType apn_type) +{ + GList *l; + + g_assert (apn_type != MM_BEARER_APN_TYPE_NONE); + + for (l = self->priv->bearers; l; l = g_list_next (l)) { + if (mm_base_bearer_get_apn_type (MM_BASE_BEARER (l->data)) == apn_type) + return g_object_ref (l->data); + } + + return NULL; +} + /*****************************************************************************/ typedef struct { -- cgit v1.2.3-70-g09d2