aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmicli/qmicli-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmicli/qmicli-helpers.c')
-rw-r--r--src/qmicli/qmicli-helpers.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/qmicli/qmicli-helpers.c b/src/qmicli/qmicli-helpers.c
index 46e17db..0711253 100644
--- a/src/qmicli/qmicli-helpers.c
+++ b/src/qmicli/qmicli-helpers.c
@@ -547,6 +547,48 @@ qmicli_read_link_layer_protocol_from_string (const gchar *str,
}
gboolean
+qmicli_read_data_aggregation_protocol_from_string (const gchar *str,
+ QmiWdaDataAggregationProtocol *out)
+{
+ GType type;
+ GEnumClass *enum_class;
+ GEnumValue *enum_value;
+
+ type = qmi_wda_data_aggregation_protocol_get_type ();
+ enum_class = G_ENUM_CLASS (g_type_class_ref (type));
+ enum_value = g_enum_get_value_by_nick (enum_class, str);
+
+ if (enum_value)
+ *out = (QmiWdaDataAggregationProtocol)enum_value->value;
+ else
+ g_printerr ("error: invalid data aggregation protocol value given: '%s'\n", str);
+
+ g_type_class_unref (enum_class);
+ return !!enum_value;
+}
+
+gboolean
+qmicli_read_data_endpoint_type_from_string (const gchar *str,
+ QmiDataEndpointType *out)
+{
+ GType type;
+ GEnumClass *enum_class;
+ GEnumValue *enum_value;
+
+ type = qmi_data_endpoint_type_get_type ();
+ enum_class = G_ENUM_CLASS (g_type_class_ref (type));
+ enum_value = g_enum_get_value_by_nick (enum_class, str);
+
+ if (enum_value)
+ *out = (QmiDataEndpointType)enum_value->value;
+ else
+ g_printerr ("error: invalid data aggregation protocol value given: '%s'\n", str);
+
+ g_type_class_unref (enum_class);
+ return !!enum_value;
+}
+
+gboolean
qmicli_read_autoconnect_setting_from_string (const gchar *str,
QmiWdsAutoconnectSetting *out)
{