diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-17 10:16:40 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-18 13:14:38 +0200 |
commit | 3d26f413008f02cc729ddadb0aa0673f0a40722f (patch) | |
tree | 90360dd2d29549bde6007b87b580eff968a04552 | |
parent | 1f2c21aba1150aebebcb80a8f21c82afb213a8f0 (diff) |
pds: setup generation of the PDS service support
Including "PDS Reset".
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | build-aux/qmi-codegen/utils.py | 4 | ||||
-rw-r--r-- | data/Makefile.am | 3 | ||||
-rw-r--r-- | data/qmi-service-pds.json | 23 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/libqmi-glib-docs.xml | 6 | ||||
-rw-r--r-- | libqmi-glib/Makefile.am | 31 | ||||
-rw-r--r-- | libqmi-glib/libqmi-glib.h | 1 | ||||
-rw-r--r-- | libqmi-glib/qmi-device.c | 5 | ||||
-rw-r--r-- | libqmi-glib/qmi-enums-pds.h | 27 | ||||
-rw-r--r-- | libqmi-glib/qmi-message.c | 7 |
10 files changed, 99 insertions, 10 deletions
@@ -54,6 +54,8 @@ libqmi-glib/qmi-nas.h libqmi-glib/qmi-nas.c libqmi-glib/qmi-wms.h libqmi-glib/qmi-wms.c +libqmi-glib/qmi-pds.h +libqmi-glib/qmi-pds.c libqmi-glib/*.stamp libqmi-glib/test/.libs diff --git a/build-aux/qmi-codegen/utils.py b/build-aux/qmi-codegen/utils.py index 5f37d31..a2a94db 100644 --- a/build-aux/qmi-codegen/utils.py +++ b/build-aux/qmi-codegen/utils.py @@ -74,8 +74,8 @@ def add_header_start(f, output_name, service): if service != 'CTL': template += ( "#include \"qmi-enums-${service}.h\"\n") - # CTL, WDS and WMS don't have flags64 - if service != 'CTL' and service != 'WDS' and service != 'WMS': + # CTL, WDS, WMS and PDS don't have flags64 + if service != 'CTL' and service != 'WDS' and service != 'WMS' and service != 'PDS': template += ( "#include \"qmi-flags64-${service}.h\"\n") template += ( diff --git a/data/Makefile.am b/data/Makefile.am index a9890e8..458dda5 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -6,4 +6,5 @@ EXTRA_DIST = \ qmi-service-dms.json \ qmi-service-wds.json \ qmi-service-nas.json \ - qmi-service-wms.json + qmi-service-wms.json \ + qmi-service-pds.json diff --git a/data/qmi-service-pds.json b/data/qmi-service-pds.json new file mode 100644 index 0000000..9c6f096 --- /dev/null +++ b/data/qmi-service-pds.json @@ -0,0 +1,23 @@ + +[ + // ********************************************************************************* + { "name" : "PDS", + "type" : "Service" }, + + // ********************************************************************************* + { "name" : "QMI Client PDS", + "type" : "Client" }, + + // ********************************************************************************* + { "name" : "QMI Message PDS", + "type" : "Message-ID-Enum" }, + + // ********************************************************************************* + { "name" : "Reset", + "type" : "Message", + "service" : "PDS", + "id" : "0x0000", + "version" : "1.0", + "output" : [ { "common-ref" : "Operation Result" } ] } + +] diff --git a/docs/reference/libqmi-glib/libqmi-glib-docs.xml b/docs/reference/libqmi-glib/libqmi-glib-docs.xml index b9ff1bd..02d5394 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-docs.xml +++ b/docs/reference/libqmi-glib/libqmi-glib-docs.xml @@ -81,6 +81,12 @@ <xi:include href="xml/qmi-enums-wms.xml"/> </chapter> + <chapter> + <title>Position Determination Service (PDS)</title> + <xi:include href="xml/qmi-pds.xml"/> + <xi:include href="xml/qmi-enums-pds.xml"/> + </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 69b84ef..b4e57c7 100644 --- a/libqmi-glib/Makefile.am +++ b/libqmi-glib/Makefile.am @@ -31,10 +31,10 @@ qmi-error-quarks.c: qmi-errors.h qmi-error-types.h $(top_srcdir)/build-aux/templ qmi-errors.h > $@ # Enum/Flag types -ENUMS = qmi-enums.h qmi-enums-wds.h qmi-enums-dms.h qmi-enums-nas.h qmi-enums-wms.h +ENUMS = qmi-enums.h qmi-enums-wds.h qmi-enums-dms.h qmi-enums-nas.h qmi-enums-wms.h qmi-enums-pds.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" \ + --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" \ --template $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h \ --ftail "#endif /* __LIBQMI_GLIB_ENUM_TYPES_H__ */\n" \ $(ENUMS) > $@ @@ -115,10 +115,21 @@ qmi-wms.stamp: $(top_srcdir)/data/qmi-service-wms.json $(top_srcdir)/build-aux/q --output qmi-wms && \ touch $@ +# PDS service +qmi-pds.stamp: $(top_srcdir)/data/qmi-service-pds.json $(top_srcdir)/build-aux/qmi-codegen/*.py $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen + $(AM_V_GEN) \ + rm -f qmi-pds.h && \ + rm -f qmi-pds.c && \ + $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen \ + --input $(top_srcdir)/data/qmi-service-pds.json \ + --include $(top_srcdir)/data/qmi-common.json \ + --output qmi-pds && \ + touch $@ + # Additional dependencies -qmi-device.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.h qmi-dms.h qmi-wds.h qmi-nas.h qmi-wms.h +qmi-device.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.h qmi-dms.h qmi-wds.h qmi-nas.h qmi-wms.h qmi-pds.h qmi-client.c: qmi-error-types.h qmi-enum-types.h -qmi-message.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.h qmi-dms.h qmi-wds.h qmi-nas.h qmi-wms.h +qmi-message.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.h qmi-dms.h qmi-wds.h qmi-nas.h qmi-wms.h qmi-pds.h qmi-ctl.h: qmi-ctl.stamp qmi-ctl.c: qmi-error-types.h qmi-enum-types.h qmi-ctl.h qmi-dms.h: qmi-dms.stamp qmi-enums-dms.h @@ -130,6 +141,8 @@ qmi-nas.h: qmi-nas.stamp qmi-enums-nas.h qmi-nas.c: qmi-error-types.h qmi-enum-types.h qmi-flags64-types.h qmi-nas.h qmi-wms.h: qmi-wms.stamp qmi-enums-wms.h qmi-wms.c: qmi-error-types.h qmi-enum-types.h qmi-wms.h +qmi-pds.h: qmi-pds.stamp qmi-enums-pds.h +qmi-pds.c: qmi-error-types.h qmi-enum-types.h qmi-pds.h libqmi_glib_la_SOURCES = \ libqmi-glib.h \ @@ -138,6 +151,7 @@ libqmi_glib_la_SOURCES = \ qmi-enums-dms.h \ qmi-enums-nas.h \ qmi-enums-wms.h \ + qmi-enums-pds.h \ 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 \ @@ -149,7 +163,8 @@ nodist_libqmi_glib_la_SOURCES = \ qmi-dms.c qmi-dms.h \ qmi-wds.c qmi-wds.h \ qmi-nas.c qmi-nas.h \ - qmi-wms.c qmi-wms.h + qmi-wms.c qmi-wms.h \ + qmi-pds.c qmi-pds.h libqmi_glib_la_LIBADD = \ $(LIBQMI_GLIB_LIBS) @@ -166,11 +181,13 @@ include_HEADERS = \ qmi-enums-dms.h qmi-flags64-dms.h qmi-dms.h \ qmi-enums-wds.h qmi-wds.h \ qmi-enums-nas.h qmi-flags64-nas.h qmi-nas.h \ - qmi-enums-wms.h qmi-wms.h + qmi-enums-wms.h qmi-wms.h \ + qmi-enums-pds.h qmi-pds.h CLEANFILES = \ qmi-ctl.h qmi-ctl.c qmi-ctl.stamp \ qmi-dms.h qmi-dms.c qmi-dms.stamp \ qmi-wds.h qmi-wds.c qmi-wds.stamp \ qmi-nas.h qmi-nas.c qmi-nas.stamp \ - qmi-wms.h qmi-wms.c qmi-wms.stamp + qmi-wms.h qmi-wms.c qmi-wms.stamp \ + qmi-pds.h qmi-pds.c qmi-pds.stamp diff --git a/libqmi-glib/libqmi-glib.h b/libqmi-glib/libqmi-glib.h index 73d4999..23b9738 100644 --- a/libqmi-glib/libqmi-glib.h +++ b/libqmi-glib/libqmi-glib.h @@ -33,5 +33,6 @@ #include "qmi-wds.h" #include "qmi-nas.h" #include "qmi-wms.h" +#include "qmi-pds.h" #endif /* _LIBQMI_GLIB_H_ */ diff --git a/libqmi-glib/qmi-device.c b/libqmi-glib/qmi-device.c index 46dcdec..89aaafb 100644 --- a/libqmi-glib/qmi-device.c +++ b/libqmi-glib/qmi-device.c @@ -34,6 +34,7 @@ #include "qmi-wds.h" #include "qmi-nas.h" #include "qmi-wms.h" +#include "qmi-pds.h" #include "qmi-utils.h" #include "qmi-error-types.h" #include "qmi-enum-types.h" @@ -700,6 +701,10 @@ qmi_device_allocate_client (QmiDevice *self, ctx->client_type = QMI_TYPE_CLIENT_WMS; break; + case QMI_SERVICE_PDS: + ctx->client_type = QMI_TYPE_CLIENT_PDS; + break; + default: g_simple_async_result_set_error (ctx->result, QMI_CORE_ERROR, diff --git a/libqmi-glib/qmi-enums-pds.h b/libqmi-glib/qmi-enums-pds.h new file mode 100644 index 0000000..506ac33 --- /dev/null +++ b/libqmi-glib/qmi-enums-pds.h @@ -0,0 +1,27 @@ +/* -*- 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_PDS_H_ +#define _LIBQMI_GLIB_QMI_ENUMS_PDS_H_ + + +#endif /* _LIBQMI_GLIB_QMI_ENUMS_PDS_H_ */ diff --git a/libqmi-glib/qmi-message.c b/libqmi-glib/qmi-message.c index c3ebb08..6d4e58b 100644 --- a/libqmi-glib/qmi-message.c +++ b/libqmi-glib/qmi-message.c @@ -43,6 +43,7 @@ #include "qmi-wds.h" #include "qmi-nas.h" #include "qmi-wms.h" +#include "qmi-pds.h" #define PACKED __attribute__((packed)) @@ -702,6 +703,9 @@ qmi_message_get_printable (QmiMessage *self, case QMI_SERVICE_WMS: contents = qmi_message_wms_get_printable (self, line_prefix); break; + case QMI_SERVICE_PDS: + contents = qmi_message_pds_get_printable (self, line_prefix); + break; default: break; } @@ -738,6 +742,9 @@ qmi_message_get_version_introduced (QmiMessage *self, case QMI_SERVICE_WMS: return qmi_message_wms_get_version_introduced (self, major, minor); + case QMI_SERVICE_PDS: + return qmi_message_pds_get_version_introduced (self, major, minor); + default: /* For the still unsupported services, cannot do anything */ return FALSE; |