diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-03 22:23:34 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-29 10:13:22 +0000 |
commit | dd7938b3e48bf9726146ab5c4b941c056b9cbce9 (patch) | |
tree | 61ab88acf930eedb97fa594008451599db3270ed /src/mm-bearer-list.c | |
parent | e4ef8319ec71b673b322279081636c70835f700b (diff) |
bearer-list: allow lookup by connected profile id
Some of the operations performed by the profile management interface
will require checking whether the operation is attempted on a profile
for which there is a known connected bearer object.
We introduce a new method to lookup a bearer in the bearer list by its
connected profile id.
Diffstat (limited to 'src/mm-bearer-list.c')
-rw-r--r-- | src/mm-bearer-list.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index b0694588..71f3b9e3 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -155,6 +155,22 @@ mm_bearer_list_find_by_path (MMBearerList *self, return NULL; } +MMBaseBearer * +mm_bearer_list_find_by_profile_id (MMBearerList *self, + gint profile_id) +{ + GList *l; + + g_assert (profile_id != MM_3GPP_PROFILE_ID_UNKNOWN); + + for (l = self->priv->bearers; l; l = g_list_next (l)) { + if (mm_base_bearer_get_profile_id (MM_BASE_BEARER (l->data)) == profile_id) + return g_object_ref (l->data); + } + + return NULL; +} + /*****************************************************************************/ typedef struct { |