From d4aaa436d9679524f910b13176d4af35bd6b14f8 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 28 Dec 2017 18:41:50 +0100 Subject: modem-3gpp: allow loading and changing EPS UE mode of operation The UE modes of operation for LTE are defined in 3GPP TS 24.301 (e.g. section 4.3 in v10.3.0): * PS mode 1: EPS only, 'voice centric' * PS mode 2: EPS only, 'data centric' * CS/PS mode 1: EPS and non-EPS, 'voice centric' * CS/PS mode 2: EPS and non-EPS, 'data centric' The mode specifies, among other things, how the UE should behave w.r.t CS fallback depending on the capabilities reported by the network. --- libmm-glib/mm-common-helpers.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libmm-glib/mm-common-helpers.c') diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c index f99e58d8..3a009ad3 100644 --- a/libmm-glib/mm-common-helpers.c +++ b/libmm-glib/mm-common-helpers.c @@ -758,6 +758,28 @@ mm_common_build_mode_combinations_default (void) return g_variant_builder_end (&builder); } +MMModem3gppEpsUeModeOperation +mm_common_get_eps_ue_mode_operation_from_string (const gchar *str, + GError **error) +{ + GEnumClass *enum_class; + guint i; + + enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_MODEM_3GPP_EPS_UE_MODE_OPERATION)); + + for (i = 0; enum_class->values[i].value_nick; i++) { + if (!g_ascii_strcasecmp (str, enum_class->values[i].value_nick)) + return enum_class->values[i].value; + } + + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Couldn't match '%s' with a valid MMModem3gppEpsUeModeOperation value", + str); + return MM_MODEM_3GPP_EPS_UE_MODE_OPERATION_UNKNOWN; +} + GArray * mm_common_oma_pending_network_initiated_sessions_variant_to_garray (GVariant *variant) { -- cgit v1.2.3-70-g09d2