diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | build-aux/qmi-codegen/utils.py | 1 | ||||
-rw-r--r-- | build-aux/templates/Makefile.am | 4 | ||||
-rw-r--r-- | build-aux/templates/qmi-flags64-types-template.c | 66 | ||||
-rw-r--r-- | build-aux/templates/qmi-flags64-types-template.h | 22 | ||||
-rw-r--r-- | libqmi-glib/Makefile.am | 26 | ||||
-rw-r--r-- | libqmi-glib/libqmi-glib.h | 2 | ||||
-rw-r--r-- | libqmi-glib/qmi-enum-types-static.c | 198 | ||||
-rw-r--r-- | libqmi-glib/qmi-enum-types-static.h | 40 | ||||
-rw-r--r-- | libqmi-glib/qmi-enums-dms.h | 171 | ||||
-rw-r--r-- | libqmi-glib/qmi-flags64-dms.h | 201 |
11 files changed, 316 insertions, 417 deletions
@@ -40,6 +40,8 @@ libqmi-glib/qmi-error-types.c libqmi-glib/qmi-error-types.h libqmi-glib/qmi-enum-types.h libqmi-glib/qmi-enum-types.c +libqmi-glib/qmi-flags64-types.h +libqmi-glib/qmi-flags64-types.c libqmi-glib/qmi-ctl.h libqmi-glib/qmi-ctl.c libqmi-glib/qmi-dms.h diff --git a/build-aux/qmi-codegen/utils.py b/build-aux/qmi-codegen/utils.py index ebea84b..bff3713 100644 --- a/build-aux/qmi-codegen/utils.py +++ b/build-aux/qmi-codegen/utils.py @@ -71,6 +71,7 @@ def add_header_start(f, output_name): "#include <gio/gio.h>\n" "\n" "#include \"qmi-enum-types.h\"\n" + "#include \"qmi-flags64-types.h\"\n" "#include \"qmi-message.h\"\n" "#include \"qmi-client.h\"\n" "\n" diff --git a/build-aux/templates/Makefile.am b/build-aux/templates/Makefile.am index 110e8e3..e1fcfd1 100644 --- a/build-aux/templates/Makefile.am +++ b/build-aux/templates/Makefile.am @@ -3,4 +3,6 @@ EXTRA_DIST = \ qmi-error-types-template.h \ qmi-error-types-template.c \ qmi-enum-types-template.h \ - qmi-enum-types-template.c + qmi-enum-types-template.c \ + qmi-flags64-types-template.h \ + qmi-flags64-types-template.c diff --git a/build-aux/templates/qmi-flags64-types-template.c b/build-aux/templates/qmi-flags64-types-template.c new file mode 100644 index 0000000..e8feb96 --- /dev/null +++ b/build-aux/templates/qmi-flags64-types-template.c @@ -0,0 +1,66 @@ +/*** BEGIN file-header ***/ + +typedef struct { + guint64 value; + const gchar *value_name; + const gchar *value_nick; +} GFlags64Value; + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +static const GFlags64Value @enum_name@_values[] = { +/*** END value-header ***/ +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } +}; + +gchar * +@enum_name@_build_string_from_mask (@EnumName@ mask) +{ + guint i; + gboolean first = TRUE; + GString *str = NULL; + + for (i = 0; @enum_name@_values[i].value_nick; i++) { + /* We also look for exact matches */ + if (mask == @enum_name@_values[i].value) { + if (str) + g_string_free (str, TRUE); + return g_strdup (@enum_name@_values[i].value_nick); + } + + /* Build list with single-bit masks */ + if (mask & @enum_name@_values[i].value) { + guint c; + gulong number = @enum_name@_values[i].value; + + for (c = 0; number; c++) + number &= number - 1; + + if (c == 1) { + if (!str) + str = g_string_new (""); + g_string_append_printf (str, "%s%s", + first ? "" : ", ", + @enum_name@_values[i].value_nick); + if (first) + first = FALSE; + } + } + } + + return (str ? g_string_free (str, FALSE) : NULL); +} + +/*** END value-tail ***/ + +/*** BEGIN file-tail ***/ +/*** END file-tail ***/ diff --git a/build-aux/templates/qmi-flags64-types-template.h b/build-aux/templates/qmi-flags64-types-template.h new file mode 100644 index 0000000..20d44a7 --- /dev/null +++ b/build-aux/templates/qmi-flags64-types-template.h @@ -0,0 +1,22 @@ +/*** BEGIN file-header ***/ + +#include <glib-object.h> + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ + +gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); + +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +/*** END file-tail ***/ diff --git a/libqmi-glib/Makefile.am b/libqmi-glib/Makefile.am index 0b6093d..b4f6a0e 100644 --- a/libqmi-glib/Makefile.am +++ b/libqmi-glib/Makefile.am @@ -24,7 +24,7 @@ qmi-error-types.c: qmi-errors.h qmi-error-types.h $(top_srcdir)/build-aux/templa --template $(top_srcdir)/build-aux/templates/qmi-error-types-template.c \ qmi-errors.h > $@ -# Enum types +# Enum/Flag types ENUMS = qmi-enums.h qmi-enums-wds.h qmi-enums-dms.h qmi-enums-nas.h qmi-dms.h qmi-wds.h qmi-nas.h qmi-ctl.h qmi-enum-types.h: $(ENUMS) $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h qmi-ctl.stamp qmi-dms.stamp qmi-wds.stamp qmi-nas.stamp $(AM_V_GEN) $(GLIB_MKENUMS) \ @@ -39,6 +39,21 @@ qmi-enum-types.c: $(ENUMS) qmi-enum-types.h $(top_srcdir)/build-aux/templates/qm --template $(top_srcdir)/build-aux/templates/qmi-enum-types-template.c \ $(ENUMS) > $@ +# 64bit flag types +FLAGS64 = qmi-flags64-dms.h +qmi-flags64-types.h: $(FLAGS64) $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.h qmi-dms.stamp + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#ifndef __LIBQMI_GLIB_FLAGS64_TYPES_H__\n#define __LIBQMI_GLIB_FLAGS64_TYPES_H__\n#include \"qmi-flags64-dms.h\"\n" \ + --template $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.h \ + --ftail "#endif /* __LIBQMI_GLIB_FLAGS64_TYPES_H__ */\n" \ + $(FLAGS64) > $@ + +qmi-flags64-types.c: $(FLAGS64) qmi-flags64-types.h $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.c + $(AM_V_GEN) $(GLIB_MKENUMS) \ + --fhead "#include \"qmi-flags64-types.h\"\n" \ + --template $(top_srcdir)/build-aux/templates/qmi-flags64-types-template.c \ + $(FLAGS64) > $@ + # CTL service qmi-ctl.stamp: $(top_srcdir)/data/qmi-service-ctl.json $(top_srcdir)/build-aux/qmi-codegen/*.py $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen $(AM_V_GEN) \ @@ -90,7 +105,7 @@ qmi-message.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.h qmi-dms.h qmi-wds.h qmi-ctl.h: qmi-ctl.stamp qmi-ctl.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.stamp qmi-dms.h: qmi-dms.stamp -qmi-dms.c: qmi-error-types.h qmi-enum-types.h qmi-dms.stamp +qmi-dms.c: qmi-error-types.h qmi-enum-types.h qmi-flags64-types.h qmi-dms.stamp qmi-wds.h: qmi-wds.stamp qmi-wds.c: qmi-error-types.h qmi-enum-types.h qmi-wds.stamp qmi-nas.h: qmi-nas.stamp @@ -102,8 +117,7 @@ libqmi_glib_la_SOURCES = \ qmi-enums-wds.h \ qmi-enums-dms.h \ qmi-enums-nas.h \ - qmi-enums.h qmi-enum-types.h qmi-enum-types.c \ - qmi-enum-types-static.h qmi-enum-types-static.c \ + qmi-enums.h qmi-enum-types.h qmi-enum-types.c qmi-flags64-types.h qmi-flags64-types.c \ qmi-utils.h qmi-utils.c \ qmi-message.h qmi-message.c \ qmi-device.h qmi-device.c \ @@ -122,12 +136,12 @@ includedir = @includedir@/libqmi-glib include_HEADERS = \ libqmi-glib.h \ qmi-errors.h qmi-error-types.h \ - qmi-enums.h qmi-enum-types.h qmi-enum-types-static.h \ + qmi-enums.h qmi-enum-types.h qmi-flags64-types.h \ qmi-message.h \ qmi-device.h \ qmi-client.h \ qmi-ctl.h \ - qmi-enums-dms.h qmi-dms.h \ + qmi-enums-dms.h qmi-flags64-dms.h qmi-dms.h \ qmi-enums-wds.h qmi-wds.h \ qmi-enums-nas.h qmi-nas.h diff --git a/libqmi-glib/libqmi-glib.h b/libqmi-glib/libqmi-glib.h index 33f782e..74e05a6 100644 --- a/libqmi-glib/libqmi-glib.h +++ b/libqmi-glib/libqmi-glib.h @@ -26,7 +26,7 @@ #include "qmi-errors.h" #include "qmi-error-types.h" #include "qmi-enum-types.h" -#include "qmi-enum-types-static.h" +#include "qmi-flags64-types.h" #include "qmi-device.h" #include "qmi-client.h" diff --git a/libqmi-glib/qmi-enum-types-static.c b/libqmi-glib/qmi-enum-types-static.c deleted file mode 100644 index 0d54a0e..0000000 --- a/libqmi-glib/qmi-enum-types-static.c +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * libqmi-glib -- GLib/GIO based library to control QMI devices - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright (C) 2012 Google, Inc. - */ - -#include "qmi-enum-types-static.h" - -typedef struct { - guint64 value; - const gchar *value_name; - const gchar *value_nick; -} GFlags64Value; - -/*****************************************************************************/ -/* Band capability (64-bit flags) - * Not handled in GType, just provide the helper build_string_from_mask() */ - -static const GFlags64Value qmi_dms_band_capability_values[] = { - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_A_SYSTEM, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_A_SYSTEM", "band-class-0-a-system" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_B_SYSTEM, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_B_SYSTEM", "band-class-0-b-system" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_1_ALL_BLOCKS, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_1_ALL_BLOCKS", "band-class-1-all-blocks" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_2, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_2", "band-class-2" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_3_A_SYSTEM, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_3_A_SYSTEM", "band-class-3-a-system" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_4_ALL_BLOCKS, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_4_ALL_BLOCKS", "band-class-4-all-blocks" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_5_ALL_BLOCKS, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_5_ALL_BLOCKS", "band-class-5-all-blocks" }, - { QMI_DMS_BAND_CAPABILITY_GSM_DCS, "QMI_DMS_BAND_CAPABILITY_GSM_DCS", "gsm-dcs" }, - { QMI_DMS_BAND_CAPABILITY_GSM_EGSM, "QMI_DMS_BAND_CAPABILITY_GSM_EGSM", "gsm-egsm" }, - { QMI_DMS_BAND_CAPABILITY_GSM_PGSM, "QMI_DMS_BAND_CAPABILITY_GSM_PGSM", "gsm-pgsm" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_6, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_6", "band-class-6" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_7, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_7", "band-class-7" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_8, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_8", "band-class-8" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_9, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_9", "band-class-9" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_10, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_10", "band-class-10" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_11, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_11", "band-class-11" }, - { QMI_DMS_BAND_CAPABILITY_GSM_450, "QMI_DMS_BAND_CAPABILITY_GSM_450", "gsm-450" }, - { QMI_DMS_BAND_CAPABILITY_GSM_480, "QMI_DMS_BAND_CAPABILITY_GSM_480", "gsm-480" }, - { QMI_DMS_BAND_CAPABILITY_GSM_750, "QMI_DMS_BAND_CAPABILITY_GSM_750", "gsm-750" }, - { QMI_DMS_BAND_CAPABILITY_GSM_850, "QMI_DMS_BAND_CAPABILITY_GSM_850", "gsm-850" }, - { QMI_DMS_BAND_CAPABILITY_GSM_RAILWAYS, "QMI_DMS_BAND_CAPABILITY_GSM_RAILWAYS", "gsm-railways" }, - { QMI_DMS_BAND_CAPABILITY_GSM_PCS, "QMI_DMS_BAND_CAPABILITY_GSM_PCS", "gsm-pcs" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_2100, "QMI_DMS_BAND_CAPABILITY_WCDMA_2100", "wcdma-2100" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900, "QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900", "wcdma-pcs-1900" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800, "QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800", "wcdma-dcs-1800" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US, "QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US", "wcdma-1700-us" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_850_US, "QMI_DMS_BAND_CAPABILITY_WCDMA_850_US", "wcdma-850-us" }, - { QMI_DMS_BAND_CAPABILITY_QWCDMA_800, "QMI_DMS_BAND_CAPABILITY_QWCDMA_800", "qwcdma-800" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_12, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_12", "band-class-12" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_14, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_14", "band-class-14" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_15, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_15", "band-class-15" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_2600, "QMI_DMS_BAND_CAPABILITY_WCDMA_2600", "wcdma-2600" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_900, "QMI_DMS_BAND_CAPABILITY_WCDMA_900", "wcdma-900" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN, "QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN", "wcdma-1700-japan" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_16, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_16", "band-class-16" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_17, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_17", "band-class-17" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_18, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_18", "band-class-18" }, - { QMI_DMS_BAND_CAPABILITY_BAND_CLASS_19, "QMI_DMS_BAND_CAPABILITY_BAND_CLASS_19", "band-class-19" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN, "QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN", "wcdma-850-japan" }, - { QMI_DMS_BAND_CAPABILITY_WCDMA_1500, "QMI_DMS_BANDQMI_DMS_BAND_CAPABILITY_WCDMA_170000" }, - { 0, NULL, NULL } -}; - -/* Flags-specific method to build a string with the given mask. - * We get a comma separated list of the nicks of the GFlagsValues. - * Note that this will be valid even if the GFlagsClass is not referenced - * anywhere. */ -gchar * -qmi_dms_band_capability_build_string_from_mask (QmiDmsBandCapability mask) -{ - guint i; - gboolean first = TRUE; - GString *str = NULL; - - for (i = 0; qmi_dms_band_capability_values[i].value_nick; i++) { - /* We also look for exact matches */ - if (mask == qmi_dms_band_capability_values[i].value) { - if (str) - g_string_free (str, TRUE); - return g_strdup (qmi_dms_band_capability_values[i].value_nick); - } - - /* Build list with single-bit masks */ - if (mask & qmi_dms_band_capability_values[i].value) { - guint c; - guint64 number = qmi_dms_band_capability_values[i].value; - - for (c = 0; number; c++) - number &= number - 1; - - if (c == 1) { - if (!str) - str = g_string_new (""); - g_string_append_printf (str, "%s%s", - first ? "" : ", ", - qmi_dms_band_capability_values[i].value_nick); - if (first) - first = FALSE; - } - } - } - - return (str ? g_string_free (str, FALSE) : NULL); -} - - -/*****************************************************************************/ -/* Band capability (64-bit flags) - * Not handled in GType, just provide the helper build_string_from_mask() */ - -static const GFlags64Value qmi_dms_lte_band_capability_values[] = { - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_1, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_1", "1" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_2, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_2", "2" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_3, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_3", "3" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_4, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_4", "4" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_5, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_5", "5" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_6, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_6", "6" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_7, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_7", "7" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_8, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_8", "8" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_9, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_9", "9" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_10, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_10", "10" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_11, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_11", "11" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_12, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_12", "12" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_13, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_13", "13" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_14, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_14", "14" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_17, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_17", "17" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_18, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_18", "18" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_19, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_19", "19" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_20, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_20", "20" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_21, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_21", "21" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_24, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_24", "24" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_25, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_25", "25" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_33, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_33", "33" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_34, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_34", "34" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_35, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_35", "35" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_36, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_36", "36" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_37, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_37", "37" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_38, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_38", "38" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_39, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_39", "39" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_40, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_40", "40" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_41, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_41", "41" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_42, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_42", "42" }, - { QMI_DMS_LTE_BAND_CAPABILITY_BAND_43, "QMI_DMS_LTE_BAND_CAPABILITY_BAND_43", "43" }, - { 0, NULL, NULL } -}; - -gchar * -qmi_dms_lte_band_capability_build_string_from_mask (QmiDmsLteBandCapability mask) -{ - guint i; - gboolean first = TRUE; - GString *str = NULL; - - for (i = 0; qmi_dms_lte_band_capability_values[i].value_nick; i++) { - /* We also look for exact matches */ - if (mask == qmi_dms_lte_band_capability_values[i].value) { - if (str) - g_string_free (str, TRUE); - return g_strdup (qmi_dms_lte_band_capability_values[i].value_nick); - } - - /* Build list with single-bit masks */ - if (mask & qmi_dms_lte_band_capability_values[i].value) { - guint c; - guint64 number = qmi_dms_lte_band_capability_values[i].value; - - for (c = 0; number; c++) - number &= number - 1; - - if (c == 1) { - if (!str) - str = g_string_new (""); - g_string_append_printf (str, "%s%s", - first ? "" : ", ", - qmi_dms_lte_band_capability_values[i].value_nick); - if (first) - first = FALSE; - } - } - } - - return (str ? g_string_free (str, FALSE) : NULL); -} diff --git a/libqmi-glib/qmi-enum-types-static.h b/libqmi-glib/qmi-enum-types-static.h deleted file mode 100644 index ed9eb3a..0000000 --- a/libqmi-glib/qmi-enum-types-static.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * libqmi-glib -- GLib/GIO based library to control QMI devices - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright (C) 2012 Google, Inc. - */ - -#ifndef __LIBQMI_GLIB_ENUM_TYPES_STATIC_H__ -#define __LIBQMI_GLIB_ENUM_TYPES_STATIC_H__ - -#include <glib-object.h> - -#include "qmi-enums-dms.h" - -G_BEGIN_DECLS - -/* Band capability (64-bit flags) */ -gchar *qmi_dms_band_capability_build_string_from_mask (QmiDmsBandCapability mask); - -/* LTE Band capability (64-bit flags) */ -gchar *qmi_dms_lte_band_capability_build_string_from_mask (QmiDmsLteBandCapability mask); - -G_END_DECLS - -#endif /* __LIBQMI_GLIB_ENUM_TYPES_STATIC_H__ */ diff --git a/libqmi-glib/qmi-enums-dms.h b/libqmi-glib/qmi-enums-dms.h index 4252688..9c4c743 100644 --- a/libqmi-glib/qmi-enums-dms.h +++ b/libqmi-glib/qmi-enums-dms.h @@ -299,177 +299,6 @@ typedef enum { } QmiDmsUimState; /*****************************************************************************/ -/* Helper enums for the 'QMI DMS Get Band Capability' message */ - -/** - * QmiDmsBandCapability: - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_A_SYSTEM: Band class 0, A-system. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_B_SYSTEM: Band class 0, B-system. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_1_ALL_BLOCKS: Band class 1, all blocks. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_2: Band class 2. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_3_A_SYSTEM: Band class 3, A-system. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_4_ALL_BLOCKS: Band class 4, all blocks. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_5_ALL_BLOCKS: Band class 5, all blocks. - * @QMI_DMS_BAND_CAPABILITY_GSM_DCS: GSM DCS band. - * @QMI_DMS_BAND_CAPABILITY_GSM_EGSM: GSM Extended GSM band (900). - * @QMI_DMS_BAND_CAPABILITY_GSM_PGSM: GSM Primary GSM band (900). - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_6: Band class 6. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_7: Band class 7. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_8: Band class 8. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_9: Band class 9. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_10: Band class 10. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_11: Band class 11. - * @QMI_DMS_BAND_CAPABILITY_GSM_450: GSM 450 band. - * @QMI_DMS_BAND_CAPABILITY_GSM_480: GSM 480 band. - * @QMI_DMS_BAND_CAPABILITY_GSM_750: GSM 750 band. - * @QMI_DMS_BAND_CAPABILITY_GSM_850: GSM 850 band. - * @QMI_DMS_BAND_CAPABILITY_GSM_RAILWAYS: GSM railways band (900). - * @QMI_DMS_BAND_CAPABILITY_GSM_PCS: GSM PCS band (1900). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_2100: WCDMA 2100 band (Europe, Japan, China). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900: WCDMA PCS 1900 band (US). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800: WCDMA DCS 1800 band (Europe, China). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US: WCDMA 1700 band (US). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_850_US: WCDMA 850 band (US). - * @QMI_DMS_BAND_CAPABILITY_QWCDMA_800: QWCDMA 850 band (Japan). - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_12: Band class 12. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_14: Band class 14. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_15: Band class 15. - * @QMI_DMS_BAND_CAPABILITY_WCDMA_2600: WCDMA 2600 band (Europe). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_900: WCDMA 900 band (Europe, Japan). - * @QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN: WCDMA 1700 band (Japan). - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_16: Band class 16. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_17: Band class 17. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_18: Band class 18. - * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_19: Band class 19. - * @QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN: WCDMA 850 band (Japan) - * @QMI_DMS_BAND_CAPABILITY_WCDMA_1500: WCDMA 1500 band. - * - * Frequency bands. - */ -typedef enum { /*< skip >*/ - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_A_SYSTEM = 1 << 0, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_B_SYSTEM = 1 << 1, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_1_ALL_BLOCKS = 1 << 2, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_2 = 1 << 3, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_3_A_SYSTEM = 1 << 4, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_4_ALL_BLOCKS = 1 << 5, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_5_ALL_BLOCKS = 1 << 6, - QMI_DMS_BAND_CAPABILITY_GSM_DCS = 1 << 7, - QMI_DMS_BAND_CAPABILITY_GSM_EGSM = 1 << 8, - QMI_DMS_BAND_CAPABILITY_GSM_PGSM = 1 << 9, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_6 = 1 << 10, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_7 = 1 << 11, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_8 = 1 << 12, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_9 = 1 << 13, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_10 = 1 << 14, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_11 = 1 << 15, - QMI_DMS_BAND_CAPABILITY_GSM_450 = 1 << 16, - QMI_DMS_BAND_CAPABILITY_GSM_480 = 1 << 17, - QMI_DMS_BAND_CAPABILITY_GSM_750 = 1 << 18, - QMI_DMS_BAND_CAPABILITY_GSM_850 = 1 << 19, - QMI_DMS_BAND_CAPABILITY_GSM_RAILWAYS = 1 << 20, - QMI_DMS_BAND_CAPABILITY_GSM_PCS = 1 << 21, - QMI_DMS_BAND_CAPABILITY_WCDMA_2100 = 1 << 22, - QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900 = 1 << 23, - QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800 = 1 << 24, - QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US = 1 << 25, - QMI_DMS_BAND_CAPABILITY_WCDMA_850_US = 1 << 26, - QMI_DMS_BAND_CAPABILITY_QWCDMA_800 = 1 << 27, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_12 = 1 << 28, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_14 = 1 << 29, - /* Bit 30 reserved */ - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_15 = 1 << 31, - /* Bits 32-47 reserved */ - QMI_DMS_BAND_CAPABILITY_WCDMA_2600 = ((guint64) 1) << 48, - QMI_DMS_BAND_CAPABILITY_WCDMA_900 = ((guint64) 1) << 49, - QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN = ((guint64) 1) << 50, - /* Bits 51-55 reserved */ - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_16 = ((guint64) 1) << 56, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_17 = ((guint64) 1) << 57, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_18 = ((guint64) 1) << 58, - QMI_DMS_BAND_CAPABILITY_BAND_CLASS_19 = ((guint64) 1) << 59, - QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN = ((guint64) 1) << 60, - QMI_DMS_BAND_CAPABILITY_WCDMA_1500 = ((guint64) 1) << 61, - /* Bits 62-63 reserved */ -} QmiDmsBandCapability; - -/** - * QmiDmsLteBandCapability: - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_1: LTE EUTRAN Band 1 - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_2: LTE EUTRAN Band 2. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_3: LTE EUTRAN Band 3. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_4: LTE EUTRAN Band 4. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_5: LTE EUTRAN Band 5. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_6: LTE EUTRAN Band 6. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_7: LTE EUTRAN Band 7. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_8: LTE EUTRAN Band 8. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_9: LTE EUTRAN Band 9. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_10: LTE EUTRAN Band 10. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_11: LTE EUTRAN Band 11. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_12: LTE EUTRAN Band 12. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_13: LTE EUTRAN Band 13. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_14: LTE EUTRAN Band 14. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_17: LTE EUTRAN Band 17. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_18: LTE EUTRAN Band 18. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_19: LTE EUTRAN Band 19. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_20: LTE EUTRAN Band 20. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_21: LTE EUTRAN Band 21. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_24: LTE EUTRAN Band 24. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_25: LTE EUTRAN Band 25. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_33: LTE EUTRAN Band 33. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_34: LTE EUTRAN Band 34. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_35: LTE EUTRAN Band 35. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_36: LTE EUTRAN Band 36. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_37: LTE EUTRAN Band 37. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_38: LTE EUTRAN Band 38. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_39: LTE EUTRAN Band 39. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_40: LTE EUTRAN Band 40. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_41: LTE EUTRAN Band 41. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_42: LTE EUTRAN Band 42. - * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_43: LTE EUTRAN Band 43. - * - * LTE-specific Frequency bands. - */ -typedef enum { /*< skip >*/ - QMI_DMS_LTE_BAND_CAPABILITY_BAND_1 = 1 << 0, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_2 = 1 << 1, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_3 = 1 << 2, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_4 = 1 << 3, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_5 = 1 << 4, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_6 = 1 << 5, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_7 = 1 << 6, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_8 = 1 << 7, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_9 = 1 << 8, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_10 = 1 << 9, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_11 = 1 << 10, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_12 = 1 << 11, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_13 = 1 << 12, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_14 = 1 << 13, - /* Bit 14-15 reserved */ - QMI_DMS_LTE_BAND_CAPABILITY_BAND_17 = 1 << 16, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_18 = 1 << 17, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_19 = 1 << 18, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_20 = 1 << 19, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_21 = 1 << 20, - /* Bit 21-22 reserved */ - QMI_DMS_LTE_BAND_CAPABILITY_BAND_24 = 1 << 23, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_25 = 1 << 24, - /* Bit 25-31 reserved */ - QMI_DMS_LTE_BAND_CAPABILITY_BAND_33 = ((guint64) 1) << 32, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_34 = ((guint64) 1) << 33, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_35 = ((guint64) 1) << 34, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_36 = ((guint64) 1) << 35, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_37 = ((guint64) 1) << 36, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_38 = ((guint64) 1) << 37, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_39 = ((guint64) 1) << 38, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_40 = ((guint64) 1) << 39, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_41 = ((guint64) 1) << 40, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_42 = ((guint64) 1) << 41, - QMI_DMS_LTE_BAND_CAPABILITY_BAND_43 = ((guint64) 1) << 42 - /* Bit 43-64 reserved */ -} QmiDmsLteBandCapability; - -/*****************************************************************************/ /* Helper enums for the 'QMI DMS Set Time' message */ /** diff --git a/libqmi-glib/qmi-flags64-dms.h b/libqmi-glib/qmi-flags64-dms.h new file mode 100644 index 0000000..18761bd --- /dev/null +++ b/libqmi-glib/qmi-flags64-dms.h @@ -0,0 +1,201 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * libqmi-glib -- GLib/GIO based library to control QMI devices + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2012 Lanedo GmbH <aleksander@lanedo.com> + * Copyright (C) 2012 Google, Inc. + */ + +#ifndef _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ +#define _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ + +#include <glib.h> + + +/*****************************************************************************/ +/* Helper enums for the 'QMI DMS Get Band Capability' message */ + +/** + * QmiDmsBandCapability: + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_A_SYSTEM: Band class 0, A-system. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_B_SYSTEM: Band class 0, B-system. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_1_ALL_BLOCKS: Band class 1, all blocks. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_2: Band class 2. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_3_A_SYSTEM: Band class 3, A-system. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_4_ALL_BLOCKS: Band class 4, all blocks. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_5_ALL_BLOCKS: Band class 5, all blocks. + * @QMI_DMS_BAND_CAPABILITY_GSM_DCS: GSM DCS band. + * @QMI_DMS_BAND_CAPABILITY_GSM_EGSM: GSM Extended GSM band (900). + * @QMI_DMS_BAND_CAPABILITY_GSM_PGSM: GSM Primary GSM band (900). + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_6: Band class 6. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_7: Band class 7. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_8: Band class 8. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_9: Band class 9. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_10: Band class 10. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_11: Band class 11. + * @QMI_DMS_BAND_CAPABILITY_GSM_450: GSM 450 band. + * @QMI_DMS_BAND_CAPABILITY_GSM_480: GSM 480 band. + * @QMI_DMS_BAND_CAPABILITY_GSM_750: GSM 750 band. + * @QMI_DMS_BAND_CAPABILITY_GSM_850: GSM 850 band. + * @QMI_DMS_BAND_CAPABILITY_GSM_RAILWAYS: GSM railways band (900). + * @QMI_DMS_BAND_CAPABILITY_GSM_PCS: GSM PCS band (1900). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_2100: WCDMA 2100 band (Europe, Japan, China). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900: WCDMA PCS 1900 band (US). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800: WCDMA DCS 1800 band (Europe, China). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US: WCDMA 1700 band (US). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_850_US: WCDMA 850 band (US). + * @QMI_DMS_BAND_CAPABILITY_QWCDMA_800: QWCDMA 850 band (Japan). + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_12: Band class 12. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_14: Band class 14. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_15: Band class 15. + * @QMI_DMS_BAND_CAPABILITY_WCDMA_2600: WCDMA 2600 band (Europe). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_900: WCDMA 900 band (Europe, Japan). + * @QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN: WCDMA 1700 band (Japan). + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_16: Band class 16. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_17: Band class 17. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_18: Band class 18. + * @QMI_DMS_BAND_CAPABILITY_BAND_CLASS_19: Band class 19. + * @QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN: WCDMA 850 band (Japan) + * @QMI_DMS_BAND_CAPABILITY_WCDMA_1500: WCDMA 1500 band. + * + * Frequency bands. + */ +typedef enum { + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_A_SYSTEM = 1 << 0, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_0_B_SYSTEM = 1 << 1, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_1_ALL_BLOCKS = 1 << 2, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_2 = 1 << 3, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_3_A_SYSTEM = 1 << 4, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_4_ALL_BLOCKS = 1 << 5, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_5_ALL_BLOCKS = 1 << 6, + QMI_DMS_BAND_CAPABILITY_GSM_DCS = 1 << 7, + QMI_DMS_BAND_CAPABILITY_GSM_EGSM = 1 << 8, + QMI_DMS_BAND_CAPABILITY_GSM_PGSM = 1 << 9, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_6 = 1 << 10, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_7 = 1 << 11, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_8 = 1 << 12, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_9 = 1 << 13, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_10 = 1 << 14, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_11 = 1 << 15, + QMI_DMS_BAND_CAPABILITY_GSM_450 = 1 << 16, + QMI_DMS_BAND_CAPABILITY_GSM_480 = 1 << 17, + QMI_DMS_BAND_CAPABILITY_GSM_750 = 1 << 18, + QMI_DMS_BAND_CAPABILITY_GSM_850 = 1 << 19, + QMI_DMS_BAND_CAPABILITY_GSM_RAILWAYS = 1 << 20, + QMI_DMS_BAND_CAPABILITY_GSM_PCS = 1 << 21, + QMI_DMS_BAND_CAPABILITY_WCDMA_2100 = 1 << 22, + QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900 = 1 << 23, + QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800 = 1 << 24, + QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US = 1 << 25, + QMI_DMS_BAND_CAPABILITY_WCDMA_850_US = 1 << 26, + QMI_DMS_BAND_CAPABILITY_QWCDMA_800 = 1 << 27, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_12 = 1 << 28, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_14 = 1 << 29, + /* Bit 30 reserved */ + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_15 = 1 << 31, + /* Bits 32-47 reserved */ + QMI_DMS_BAND_CAPABILITY_WCDMA_2600 = ((guint64) 1) << 48, + QMI_DMS_BAND_CAPABILITY_WCDMA_900 = ((guint64) 1) << 49, + QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN = ((guint64) 1) << 50, + /* Bits 51-55 reserved */ + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_16 = ((guint64) 1) << 56, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_17 = ((guint64) 1) << 57, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_18 = ((guint64) 1) << 58, + QMI_DMS_BAND_CAPABILITY_BAND_CLASS_19 = ((guint64) 1) << 59, + QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN = ((guint64) 1) << 60, + QMI_DMS_BAND_CAPABILITY_WCDMA_1500 = ((guint64) 1) << 61, + /* Bits 62-63 reserved */ +} QmiDmsBandCapability; + +/** + * QmiDmsLteBandCapability: + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_1: LTE EUTRAN Band 1 + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_2: LTE EUTRAN Band 2. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_3: LTE EUTRAN Band 3. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_4: LTE EUTRAN Band 4. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_5: LTE EUTRAN Band 5. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_6: LTE EUTRAN Band 6. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_7: LTE EUTRAN Band 7. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_8: LTE EUTRAN Band 8. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_9: LTE EUTRAN Band 9. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_10: LTE EUTRAN Band 10. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_11: LTE EUTRAN Band 11. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_12: LTE EUTRAN Band 12. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_13: LTE EUTRAN Band 13. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_14: LTE EUTRAN Band 14. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_17: LTE EUTRAN Band 17. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_18: LTE EUTRAN Band 18. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_19: LTE EUTRAN Band 19. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_20: LTE EUTRAN Band 20. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_21: LTE EUTRAN Band 21. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_24: LTE EUTRAN Band 24. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_25: LTE EUTRAN Band 25. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_33: LTE EUTRAN Band 33. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_34: LTE EUTRAN Band 34. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_35: LTE EUTRAN Band 35. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_36: LTE EUTRAN Band 36. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_37: LTE EUTRAN Band 37. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_38: LTE EUTRAN Band 38. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_39: LTE EUTRAN Band 39. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_40: LTE EUTRAN Band 40. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_41: LTE EUTRAN Band 41. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_42: LTE EUTRAN Band 42. + * @QMI_DMS_LTE_BAND_CAPABILITY_BAND_43: LTE EUTRAN Band 43. + * + * LTE-specific Frequency bands. + */ +typedef enum { + QMI_DMS_LTE_BAND_CAPABILITY_BAND_1 = 1 << 0, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_2 = 1 << 1, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_3 = 1 << 2, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_4 = 1 << 3, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_5 = 1 << 4, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_6 = 1 << 5, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_7 = 1 << 6, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_8 = 1 << 7, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_9 = 1 << 8, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_10 = 1 << 9, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_11 = 1 << 10, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_12 = 1 << 11, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_13 = 1 << 12, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_14 = 1 << 13, + /* Bit 14-15 reserved */ + QMI_DMS_LTE_BAND_CAPABILITY_BAND_17 = 1 << 16, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_18 = 1 << 17, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_19 = 1 << 18, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_20 = 1 << 19, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_21 = 1 << 20, + /* Bit 21-22 reserved */ + QMI_DMS_LTE_BAND_CAPABILITY_BAND_24 = 1 << 23, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_25 = 1 << 24, + /* Bit 25-31 reserved */ + QMI_DMS_LTE_BAND_CAPABILITY_BAND_33 = ((guint64) 1) << 32, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_34 = ((guint64) 1) << 33, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_35 = ((guint64) 1) << 34, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_36 = ((guint64) 1) << 35, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_37 = ((guint64) 1) << 36, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_38 = ((guint64) 1) << 37, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_39 = ((guint64) 1) << 38, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_40 = ((guint64) 1) << 39, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_41 = ((guint64) 1) << 40, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_42 = ((guint64) 1) << 41, + QMI_DMS_LTE_BAND_CAPABILITY_BAND_43 = ((guint64) 1) << 42 + /* Bit 43-64 reserved */ +} QmiDmsLteBandCapability; + +#endif /* _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ */ |