summaryrefslogtreecommitdiff
path: root/src/qmicli/qmicli-helpers.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-02-19 09:20:21 +0100
committerAleksander Morgado <aleksander@aleksander.es>2019-02-19 23:23:37 +0100
commite0df9a1e712e90a0d0cf8560922bfc61e88d8b56 (patch)
tree0367645ba30ea482dd2e4aa4fd235e9e010dc0ca /src/qmicli/qmicli-helpers.h
parent0f516b41c1090d7744afccb767c90b3df13f8dd0 (diff)
downloadlibqmi-e0df9a1e712e90a0d0cf8560922bfc61e88d8b56.tar.gz
qmicli: define common code for the string to enum parsersaleksander/dw5821e-extensions
Diffstat (limited to 'src/qmicli/qmicli-helpers.h')
-rw-r--r--src/qmicli/qmicli-helpers.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qmicli/qmicli-helpers.h b/src/qmicli/qmicli-helpers.h
index 439e1e4b..5dbfdfe8 100644
--- a/src/qmicli/qmicli-helpers.h
+++ b/src/qmicli/qmicli-helpers.h
@@ -26,6 +26,29 @@
#ifndef __QMICLI_HELPERS_H__
#define __QMICLI_HELPERS_H__
+/* Common helpers to read enums from strings */
+#define QMICLI_ENUM_LIST \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsOperatingMode, dms_operating_mode, "operating mode") \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsUimFacility, dms_uim_facility, "facility") \
+ QMICLI_ENUM_LIST_ITEM (QmiPdcConfigurationType, pdc_configuration_type, "configuration type") \
+ QMICLI_ENUM_LIST_ITEM (QmiNasRadioInterface, nas_radio_interface, "radio interface") \
+ QMICLI_ENUM_LIST_ITEM (QmiDeviceExpectedDataFormat, device_expected_data_format, "device expected data format") \
+ QMICLI_ENUM_LIST_ITEM (QmiWdaLinkLayerProtocol, wda_link_layer_protocol, "link layer protocol") \
+ QMICLI_ENUM_LIST_ITEM (QmiWdaDataAggregationProtocol, wda_data_aggregation_protocol, "data aggregation protocol") \
+ QMICLI_ENUM_LIST_ITEM (QmiDataEndpointType, data_endpoint_type, "data endpoint type") \
+ QMICLI_ENUM_LIST_ITEM (QmiWdsAutoconnectSetting, wds_autoconnect_setting, "autoconnect setting") \
+ QMICLI_ENUM_LIST_ITEM (QmiWdsAutoconnectSettingRoaming, wds_autoconnect_setting_roaming, "autoconnect setting roaming") \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsBootImageDownloadMode, dms_boot_image_download_mode, "boot image download mode") \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsHpDeviceMode, dms_hp_device_mode, "hp device mode") \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsSwiUsbComposition, dms_swi_usb_composition, "swi usb composition") \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsDellDeviceMode, dms_dell_device_mode, "dell device mode") \
+ QMICLI_ENUM_LIST_ITEM (QmiDmsDellFirmwareVersionType, dms_dell_firmware_version_type, "dell firmware version type")
+
+#define QMICLI_ENUM_LIST_ITEM(TYPE,TYPE_UNDERSCORE,DESCR) \
+ gboolean qmicli_read_## TYPE_UNDERSCORE ##_from_string (const gchar *str, TYPE *out);
+QMICLI_ENUM_LIST
+#undef QMICLI_ENUM_LIST_ITEM
+
gchar *qmicli_get_raw_data_printable (const GArray *data,
gsize max_line_length,
const gchar *new_line_prefix);