aboutsummaryrefslogtreecommitdiff
path: root/src/mm-bearer-list.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-12-13 14:08:43 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-12-26 10:12:11 +0100
commit853aa29be80ee397f64d18c4d9cce64be35aec14 (patch)
treecca7f1a813e979b42e8ecacd156102e8e751ef20 /src/mm-bearer-list.c
parent0d0ad722d9da2039ad71ece9c8ae4b1786c7f757 (diff)
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.
Diffstat (limited to 'src/mm-bearer-list.c')
-rw-r--r--src/mm-bearer-list.c16
1 files changed, 16 insertions, 0 deletions
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 {