aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-common-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-12-28 18:41:50 +0100
committerAleksander Morgado <aleksander@aleksander.es>2018-01-20 15:41:07 +0100
commitd4aaa436d9679524f910b13176d4af35bd6b14f8 (patch)
tree649e8b340e495b18d41afc1887dd10c834100c9b /libmm-glib/mm-common-helpers.c
parentc5c9ab279d6362b2090010b4cad9ea49e9559423 (diff)
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.
Diffstat (limited to 'libmm-glib/mm-common-helpers.c')
-rw-r--r--libmm-glib/mm-common-helpers.c22
1 files changed, 22 insertions, 0 deletions
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)
{