diff options
-rw-r--r-- | build-aux/qmi-codegen/utils.py | 4 | ||||
-rw-r--r-- | data/Makefile.am | 3 | ||||
-rw-r--r-- | data/qmi-service-uim.json | 101 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/Makefile.am | 3 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/libqmi-glib-common.sections | 12 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/libqmi-glib-docs.xml | 11 | ||||
-rw-r--r-- | libqmi-glib/Makefile.am | 2 | ||||
-rw-r--r-- | libqmi-glib/generated/Makefile.am | 27 | ||||
-rw-r--r-- | libqmi-glib/libqmi-glib.h | 3 | ||||
-rw-r--r-- | libqmi-glib/qmi-device.c | 5 | ||||
-rw-r--r-- | libqmi-glib/qmi-enums-uim.h | 69 | ||||
-rw-r--r-- | libqmi-glib/qmi-message.c | 7 |
12 files changed, 237 insertions, 10 deletions
diff --git a/build-aux/qmi-codegen/utils.py b/build-aux/qmi-codegen/utils.py index cb12962..55d4eae 100644 --- a/build-aux/qmi-codegen/utils.py +++ b/build-aux/qmi-codegen/utils.py @@ -76,8 +76,8 @@ def add_header_start(f, output_name, service): else: template += ( "#include \"qmi-enums-private.h\"\n") - # CTL, WDS, WMS, PDS and PBM don't have flags64 - if service != 'CTL' and service != 'WDS' and service != 'WMS' and service != 'PDS' and service != 'PBM': + # CTL, WDS, WMS, PDS, PBM and UIM don't have flags64 + if service != 'CTL' and service != 'WDS' and service != 'WMS' and service != 'PDS' and service != 'PBM' and service != 'UIM': template += ( "#include \"qmi-flags64-${service}.h\"\n") template += ( diff --git a/data/Makefile.am b/data/Makefile.am index d04a0d4..ca71d83 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -8,4 +8,5 @@ EXTRA_DIST = \ qmi-service-nas.json \ qmi-service-wms.json \ qmi-service-pds.json \ - qmi-service-pbm.json + qmi-service-pbm.json \ + qmi-service-uim.json diff --git a/data/qmi-service-uim.json b/data/qmi-service-uim.json new file mode 100644 index 0000000..ad80662 --- /dev/null +++ b/data/qmi-service-uim.json @@ -0,0 +1,101 @@ + +[ + // ********************************************************************************* + { "name" : "UIM", + "type" : "Service" }, + + // ********************************************************************************* + { "name" : "QMI Client UIM", + "type" : "Client" }, + + // ********************************************************************************* + { "name" : "QMI Message UIM", + "type" : "Message-ID-Enum" }, + + // ********************************************************************************* + { "name" : "Reset", + "type" : "Message", + "service" : "UIM", + "id" : "0x0000", + "version" : "1.0", + "output" : [ { "common-ref" : "Operation Result" } ] }, + + // ********************************************************************************* + { "name" : "Read Record", + "type" : "Message", + "service" : "UIM", + "id" : "0x0021", + "version" : "1.0", + "input" : [ { "name" : "Session Information", + "id" : "0x01", + "mandatory" : "yes", + "type" : "TLV", + "format" : "sequence", + "contents" : [ { "name" : "Session Type", + "format" : "guint8", + "public-format" : "QmiUimSessionType" }, + { "name" : "Application Identifier", + "format" : "string" } ] }, + { "name" : "File", + "id" : "0x02", + "mandatory" : "yes", + "type" : "TLV", + "format" : "sequence", + "contents" : [ { "name" : "File ID", + "format" : "guint16" }, + { "name" : "File Path", + "format" : "array", + "array-element" : { "format" : "guint16" } } ] }, + { "name" : "Record", + "id" : "0x03", + "mandatory" : "yes", + "type" : "TLV", + "format" : "sequence", + "contents" : [ { "name" : "Record Number", + "format" : "guint16" }, + { "name" : "Record Length", + "format" : "guint16" } ] }, + { "name" : "Last Record", + "id" : "0x10", + "mandatory" : "no", + "type" : "TLV", + "format" : "guint16" }, + { "name" : "Response In Indication Token", + "id" : "0x11", + "mandatory" : "no", + "type" : "TLV", + "format" : "guint32" } ], + "output" : [ { "common-ref" : "Operation Result" }, + { "name" : "Card result", + "id" : "0x10", + "mandatory" : "no", + "type" : "TLV", + "format" : "sequence", + "contents" : [ { "name" : "SW1", + "format" : "guint8" }, + { "name" : "SW2", + "format" : "guint8" } ] }, + { "name" : "Read Result", + "id" : "0x11", + "mandatory" : "no", + "type" : "TLV", + "format" : "array", + "size-prefix-format" : "guint16", + "array-element" : { "format" : "guint8" }, + "prerequisites" : [ { "common-ref" : "Success" } ] }, + { "name" : "Additional Read Result", + "id" : "0x12", + "mandatory" : "no", + "type" : "TLV", + "format" : "array", + "size-prefix-format" : "guint16", + "array-element" : { "format" : "guint8" }, + "prerequisites" : [ { "common-ref" : "Success" } ] }, + { "name" : "Response In Indication Token", + "id" : "0x13", + "mandatory" : "no", + "type" : "TLV", + "format" : "guint32", + "prerequisites" : [ { "common-ref" : "Success" } ] } ] } + +] diff --git a/docs/reference/libqmi-glib/Makefile.am b/docs/reference/libqmi-glib/Makefile.am index 8bc6b2a..825898e 100644 --- a/docs/reference/libqmi-glib/Makefile.am +++ b/docs/reference/libqmi-glib/Makefile.am @@ -13,7 +13,8 @@ ALL_SECTIONS = \ $(top_builddir)/libqmi-glib/generated/qmi-wds.sections \ $(top_builddir)/libqmi-glib/generated/qmi-wms.sections \ $(top_builddir)/libqmi-glib/generated/qmi-pds.sections \ - $(top_builddir)/libqmi-glib/generated/qmi-pbm.sections + $(top_builddir)/libqmi-glib/generated/qmi-pbm.sections \ + $(top_builddir)/libqmi-glib/generated/qmi-uim.sections $(DOC_MODULE)-sections.mstamp: $(ALL_SECTIONS) $(AM_V_GEN) \ diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections index ea8f759..e3b15fb 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-common.sections +++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections @@ -647,6 +647,18 @@ qmi_pbm_session_type_get_type </SECTION> <SECTION> +<FILE>qmi-enums-uim</FILE> +QmiUimSessionType +<SUBSECTION Methods> +qmi_uim_session_type_get_string +<SUBSECTION Private> +qmi_uim_session_type_build_string_from_mask +<SUBSECTION Standard> +QMI_TYPE_UIM_SESSION_TYPE +qmi_uim_session_type_get_type +</SECTION> + +<SECTION> <FILE>qmi-errors</FILE> QmiCoreError QmiProtocolError diff --git a/docs/reference/libqmi-glib/libqmi-glib-docs.xml b/docs/reference/libqmi-glib/libqmi-glib-docs.xml index c6bba3f..9e5e7ce 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-docs.xml +++ b/docs/reference/libqmi-glib/libqmi-glib-docs.xml @@ -218,6 +218,17 @@ </section> </chapter> + <chapter> + <title>User Identity Module (UIM) service</title> + <xi:include href="xml/qmi-client-uim.xml"/> + <xi:include href="xml/qmi-enums-uim.xml"/> + <section> + <title>UIM Requests</title> + <xi:include href="xml/qmi-message-uim-reset.xml"/> + <xi:include href="xml/qmi-message-uim-read-record.xml"/> + </section> + </chapter> + <chapter id="object-tree"> <title>Object Hierarchy</title> <xi:include href="xml/tree_index.sgml"/> diff --git a/libqmi-glib/Makefile.am b/libqmi-glib/Makefile.am index 20cb304..5ab5c26 100644 --- a/libqmi-glib/Makefile.am +++ b/libqmi-glib/Makefile.am @@ -24,6 +24,7 @@ libqmi_glib_la_SOURCES = \ qmi-enums-wms.h \ qmi-enums-pds.h \ qmi-enums-pbm.h \ + qmi-enums-uim.h \ qmi-enums.h qmi-enums-private.h \ qmi-utils.h qmi-utils.c \ qmi-message.h qmi-message.c \ @@ -50,6 +51,7 @@ include_HEADERS = \ qmi-enums-wms.h \ qmi-enums-pds.h \ qmi-enums-pbm.h \ + qmi-enums-uim.h \ qmi-utils.h \ qmi-message.h \ qmi-device.h \ diff --git a/libqmi-glib/generated/Makefile.am b/libqmi-glib/generated/Makefile.am index a376ab2..967d530 100644 --- a/libqmi-glib/generated/Makefile.am +++ b/libqmi-glib/generated/Makefile.am @@ -12,7 +12,8 @@ GENERATED_H = \ qmi-wds.h \ qmi-wms.h \ qmi-pds.h \ - qmi-pbm.h + qmi-pbm.h \ + qmi-uim.h GENERATED_C = \ qmi-error-types.c \ @@ -26,7 +27,8 @@ GENERATED_C = \ qmi-wds.c \ qmi-wms.c \ qmi-pds.c \ - qmi-pbm.c + qmi-pbm.c \ + qmi-uim.c GENERATED_SECTIONS = \ qmi-ctl.sections \ @@ -35,7 +37,8 @@ GENERATED_SECTIONS = \ qmi-wds.sections \ qmi-wms.sections \ qmi-pds.sections \ - qmi-pbm.sections + qmi-pbm.sections \ + qmi-uim.sections # Error types qmi-error-types.h: $(top_srcdir)/libqmi-glib/qmi-errors.h $(top_srcdir)/build-aux/templates/qmi-error-types-template.h @@ -65,10 +68,11 @@ ENUMS = \ $(top_srcdir)/libqmi-glib/qmi-enums-nas.h \ $(top_srcdir)/libqmi-glib/qmi-enums-wms.h \ $(top_srcdir)/libqmi-glib/qmi-enums-pds.h \ - $(top_srcdir)/libqmi-glib/qmi-enums-pbm.h + $(top_srcdir)/libqmi-glib/qmi-enums-pbm.h \ + $(top_srcdir)/libqmi-glib/qmi-enums-uim.h qmi-enum-types.h: $(ENUMS) $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h $(AM_V_GEN) $(GLIB_MKENUMS) \ - --fhead "#ifndef __LIBQMI_GLIB_ENUM_TYPES_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_H__\n#include \"qmi-enums.h\"\n#include \"qmi-enums-wds.h\"\n#include \"qmi-enums-dms.h\"\n#include \"qmi-enums-nas.h\"\n#include \"qmi-enums-wms.h\"\n#include \"qmi-enums-pds.h\"\n#include \"qmi-enums-pbm.h\"\n" \ + --fhead "#ifndef __LIBQMI_GLIB_ENUM_TYPES_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_H__\n#include \"qmi-enums.h\"\n#include \"qmi-enums-wds.h\"\n#include \"qmi-enums-dms.h\"\n#include \"qmi-enums-nas.h\"\n#include \"qmi-enums-wms.h\"\n#include \"qmi-enums-pds.h\"\n#include \"qmi-enums-pbm.h\"\n#include \"qmi-enums-uim.h\"\n" \ --template $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h \ --ftail "#endif /* __LIBQMI_GLIB_ENUM_TYPES_H__ */\n" \ $(ENUMS) > $@ @@ -180,6 +184,16 @@ qmi-pbm.h qmi-pbm.c qmi-pbm.sections: $(top_srcdir)/data/qmi-service-pbm.json $( --include $(top_srcdir)/data/qmi-common.json \ --output qmi-pbm +# UIM service +qmi-uim.h qmi-uim.c qmi-uim.sections: $(top_srcdir)/data/qmi-service-uim.json $(top_srcdir)/build-aux/qmi-codegen/*.py $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen + $(AM_V_GEN) \ + rm -f qmi-uim.h && \ + rm -f qmi-uim.c && \ + $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen \ + --input $(top_srcdir)/data/qmi-service-uim.json \ + --include $(top_srcdir)/data/qmi-common.json \ + --output qmi-uim + BUILT_SOURCES = $(GENERATED_H) $(GENERATED_C) nodist_libqmi_glib_generated_la_SOURCES = \ @@ -208,6 +222,7 @@ nodist_include_HEADERS = \ qmi-wds.h \ qmi-wms.h \ qmi-pds.h \ - qmi-pbm.h + qmi-pbm.h \ + qmi-uim.h CLEANFILES = $(GENERATED_H) $(GENERATED_C) $(GENERATED_SECTIONS) diff --git a/libqmi-glib/libqmi-glib.h b/libqmi-glib/libqmi-glib.h index c17685d..043c7d7 100644 --- a/libqmi-glib/libqmi-glib.h +++ b/libqmi-glib/libqmi-glib.h @@ -55,6 +55,9 @@ #include "qmi-enums-pbm.h" #include "qmi-pbm.h" +#include "qmi-enums-uim.h" +#include "qmi-uim.h" + /* generated */ #include "qmi-error-types.h" #include "qmi-enum-types.h" diff --git a/libqmi-glib/qmi-device.c b/libqmi-glib/qmi-device.c index 7b64a4a..625c34c 100644 --- a/libqmi-glib/qmi-device.c +++ b/libqmi-glib/qmi-device.c @@ -36,6 +36,7 @@ #include "qmi-wms.h" #include "qmi-pds.h" #include "qmi-pbm.h" +#include "qmi-uim.h" #include "qmi-utils.h" #include "qmi-error-types.h" #include "qmi-enum-types.h" @@ -852,6 +853,10 @@ qmi_device_allocate_client (QmiDevice *self, ctx->client_type = QMI_TYPE_CLIENT_PBM; break; + case QMI_SERVICE_UIM: + ctx->client_type = QMI_TYPE_CLIENT_UIM; + break; + default: g_simple_async_result_set_error (ctx->result, QMI_CORE_ERROR, diff --git a/libqmi-glib/qmi-enums-uim.h b/libqmi-glib/qmi-enums-uim.h new file mode 100644 index 0000000..6215a39 --- /dev/null +++ b/libqmi-glib/qmi-enums-uim.h @@ -0,0 +1,69 @@ +/* -*- 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_QMI_ENUMS_UIM_H_ +#define _LIBQMI_GLIB_QMI_ENUMS_UIM_H_ + +#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#error "Only <libqmi-glib.h> can be included directly." +#endif + +/** + * SECTION: qmi-enums-uim + * @title: UIM enumerations and flags + * + * This section defines enumerations and flags used in the UIM service + * interface. + */ + +/*****************************************************************************/ +/* Helper enums for the 'QMI UIM Read Record' request/response */ + +/** + * QmiUimSessionType: + * @QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING: Primary GSM/WCDMA provisioning. + * @QMI_UIM_SESSION_TYPE_PRIMARY_1X_PROVISIONING: Primary CDMA1x provisioning. + * @QMI_UIM_SESSION_TYPE_SECONDARY_GW_PROVISIONING: Secondary GSM/WCDMA provisioning. + * @QMI_UIM_SESSION_TYPE_SECONDARY_1X_PROVISIONING: Secondary CDMA1x provisioning. + * @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_1: Nonprovisioning on slot 1. + * @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_2: Nonprovisioning on slot 2. + * @QMI_UIM_SESSION_TYPE_CARD_SLOT_1: Card on slot 1. + * @QMI_UIM_SESSION_TYPE_CARD_SLOT_2: Card on slot 2. + * @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_1: Logical channel on slot 1. + * @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_2: Logical channel on slot 2. + * + * Type of UIM session. + */ +typedef enum { + QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING = 0, + QMI_UIM_SESSION_TYPE_PRIMARY_1X_PROVISIONING = 1, + QMI_UIM_SESSION_TYPE_SECONDARY_GW_PROVISIONING = 2, + QMI_UIM_SESSION_TYPE_SECONDARY_1X_PROVISIONING = 3, + QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_1 = 4, + QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_2 = 5, + QMI_UIM_SESSION_TYPE_CARD_SLOT_1 = 6, + QMI_UIM_SESSION_TYPE_CARD_SLOT_2 = 7, + QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_1 = 8, + QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_2 = 9 +} QmiUimSessionType; + +#endif /* _LIBQMI_GLIB_QMI_ENUMS_UIM_H_ */ diff --git a/libqmi-glib/qmi-message.c b/libqmi-glib/qmi-message.c index 6e7bf42..c3bd6e0 100644 --- a/libqmi-glib/qmi-message.c +++ b/libqmi-glib/qmi-message.c @@ -46,6 +46,7 @@ #include "qmi-nas.h" #include "qmi-wms.h" #include "qmi-pds.h" +#include "qmi-uim.h" /** * SECTION:qmi-message @@ -860,6 +861,9 @@ qmi_message_get_printable (QmiMessage *self, case QMI_SERVICE_PDS: contents = __qmi_message_pds_get_printable (self, line_prefix); break; + case QMI_SERVICE_UIM: + contents = __qmi_message_uim_get_printable (self, line_prefix); + break; default: break; } @@ -909,6 +913,9 @@ qmi_message_get_version_introduced (QmiMessage *self, case QMI_SERVICE_PDS: return __qmi_message_pds_get_version_introduced (self, major, minor); + case QMI_SERVICE_UIM: + return __qmi_message_uim_get_version_introduced (self, major, minor); + default: /* For the still unsupported services, cannot do anything */ return FALSE; |