diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-04 10:36:04 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-04-29 10:13:22 +0000 |
commit | 62cbf7fa86a3f4773184186b7f937a7bee8b0e5a (patch) | |
tree | ea212942aa9c24578bc7662752b7ab73777db9ab /src/mm-modem-helpers.h | |
parent | dd7938b3e48bf9726146ab5c4b941c056b9cbce9 (diff) |
modem-helpers: new profile list helpers
The new helpers allow converting a PDP context list returned from the
+CGDCONT? parser to a list of 3GPP profile objects.
The new mm_3gpp_profile_list_find_best() method is equivalent to the
mm_3gpp_select_best_cid() one, but using profile objects as
input/output instead of specific settings.
The unit tests that were testing mm_3gpp_select_best_cid() are also
converted to use mm_3gpp_profile_list_find_best().
Diffstat (limited to 'src/mm-modem-helpers.h')
-rw-r--r-- | src/mm-modem-helpers.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h index dfa71884..c16ddb64 100644 --- a/src/mm-modem-helpers.h +++ b/src/mm-modem-helpers.h @@ -470,6 +470,31 @@ gboolean mm_3gpp_rssnr_level_to_rssnr (gint rssnr_level, GStrv mm_3gpp_parse_emergency_numbers (const char *raw, GError **error); +/* PDP context -> profile */ +MM3gppProfile *mm_3gpp_profile_new_from_pdp_context (MM3gppPdpContext *pdp_context); + +/* Profile list operations */ +GList *mm_3gpp_profile_list_new_from_pdp_context_list (GList *pdp_context_list); +void mm_3gpp_profile_list_free (GList *profile_list); + +gint mm_3gpp_profile_list_find_empty (GList *profile_list, + gint min_profile_id, + gint max_profile_id, + GError **error); +gint mm_3gpp_profile_list_find_best (GList *profile_list, + MM3gppProfile *requested, + GEqualFunc cmp_apn, + MM3gppProfileCmpFlags cmp_flags, + gint min_profile_id, + gint max_profile_id, + gpointer log_object, + MM3gppProfile **out_reused, + gboolean *out_overwritten); + +MM3gppProfile *mm_3gpp_profile_list_find_by_profile_id (GList *profile_list, + gint profile_id, + GError **error); + /*****************************************************************************/ /* CDMA specific helpers and utilities */ /*****************************************************************************/ |