diff options
-rw-r--r-- | data/Makefile.am | 3 | ||||
-rw-r--r-- | data/qmi-service-loc.json | 71 | ||||
-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 | 15 | ||||
-rw-r--r-- | src/libqmi-glib/Makefile.am | 2 | ||||
-rw-r--r-- | src/libqmi-glib/generated/Makefile.am | 26 | ||||
-rw-r--r-- | src/libqmi-glib/libqmi-glib.h | 3 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-device.c | 5 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-enums-loc.h | 64 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-message.c | 7 |
11 files changed, 204 insertions, 7 deletions
diff --git a/data/Makefile.am b/data/Makefile.am index 9c4b99b..0182ae7 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -13,4 +13,5 @@ EXTRA_DIST = \ qmi-service-uim.json \ qmi-service-oma.json \ qmi-service-wda.json \ - qmi-service-voice.json + qmi-service-voice.json \ + qmi-service-loc.json diff --git a/data/qmi-service-loc.json b/data/qmi-service-loc.json new file mode 100644 index 0000000..3d41e66 --- /dev/null +++ b/data/qmi-service-loc.json @@ -0,0 +1,71 @@ + +[ + // ********************************************************************************* + { "name" : "LOC", + "type" : "Service" }, + + // ********************************************************************************* + { "name" : "QMI Client LOC", + "type" : "Client", + "since" : "1.0" }, + + // ********************************************************************************* + { "name" : "QMI Message LOC", + "type" : "Message-ID-Enum" }, + + // ********************************************************************************* + { "name" : "QMI Indication LOC", + "type" : "Indication-ID-Enum" }, + + // ********************************************************************************* + { "name" : "Start", + "type" : "Message", + "service" : "LOC", + "id" : "0x0022", + "version" : "1.0", + "since" : "1.19", + "input" : [ { "name" : "Session ID", + "id" : "0x01", + "mandatory" : "no", + "type" : "TLV", + "since" : "1.19", + "format" : "guint8" }, + { "name" : "Intermediate Report State", + "id" : "0x12", + "mandatory" : "no", + "type" : "TLV", + "since" : "1.0", + "format" : "guint32", + "public-format" : "QmiLocIntermediateReportState" } ], + "output" : [ { "common-ref" : "Operation Result" } ] }, + + // ********************************************************************************* + { "name" : "Stop", + "type" : "Message", + "service" : "LOC", + "id" : "0x0023", + "version" : "1.0", + "since" : "1.19", + "input" : [ { "name" : "Session ID", + "id" : "0x01", + "mandatory" : "no", + "type" : "TLV", + "since" : "1.19", + "format" : "guint8" } ], + "output" : [ { "common-ref" : "Operation Result" } ] }, + + // ********************************************************************************* + + { "name" : "Position Report", + "type" : "Indication", + "service" : "LOC", + "id" : "0x0024", + "since" : "1.0", + "output" : [ { "name" : "Session ID", + "id" : "0x02", + "mandatory" : "no", + "type" : "TLV", + "since" : "1.0", + "format" : "guint8" } ] } + +] diff --git a/docs/reference/libqmi-glib/Makefile.am b/docs/reference/libqmi-glib/Makefile.am index 6f5cfd1..9f21396 100644 --- a/docs/reference/libqmi-glib/Makefile.am +++ b/docs/reference/libqmi-glib/Makefile.am @@ -18,7 +18,8 @@ ALL_SECTIONS = \ $(top_builddir)/src/libqmi-glib/generated/qmi-uim.sections \ $(top_builddir)/src/libqmi-glib/generated/qmi-oma.sections \ $(top_builddir)/src/libqmi-glib/generated/qmi-wda.sections \ - $(top_builddir)/src/libqmi-glib/generated/qmi-voice.sections + $(top_builddir)/src/libqmi-glib/generated/qmi-voice.sections \ + $(top_builddir)/src/libqmi-glib/generated/qmi-loc.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 9950b40..b78dc5e 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-common.sections +++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections @@ -1054,6 +1054,18 @@ qmi_voice_wcdma_amr_status_get_type </SECTION> <SECTION> +<FILE>qmi-enums-loc</FILE> +QmiLocIntermediateReportState +<SUBSECTION Methods> +qmi_loc_intermediate_report_state_get_string +<SUBSECTION Private> +qmi_loc_intermediate_report_state_build_string_from_mask +<SUBSECTION Standard> +QMI_TYPE_LOC_INTERMEDIATE_REPORT_STATE +qmi_loc_intermediate_report_state_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 2d5a7f3..233db45 100644 --- a/docs/reference/libqmi-glib/libqmi-glib-docs.xml +++ b/docs/reference/libqmi-glib/libqmi-glib-docs.xml @@ -369,6 +369,21 @@ </chapter> <chapter> + <title>Location Service (LOC)</title> + <xi:include href="xml/qmi-client-loc.xml"/> + <xi:include href="xml/qmi-enums-loc.xml"/> + <section> + <title>LOC Indications</title> + <xi:include href="xml/qmi-indication-loc-position-report.xml"/> + </section> + <section> + <title>LOC Requests</title> + <xi:include href="xml/qmi-message-loc-start.xml"/> + <xi:include href="xml/qmi-message-loc-stop.xml"/> + </section> + </chapter> + + <chapter> <title>Compatibility with older versions</title> <xi:include href="xml/qmi-compat.xml"/> </chapter> diff --git a/src/libqmi-glib/Makefile.am b/src/libqmi-glib/Makefile.am index e379b0b..43e60cc 100644 --- a/src/libqmi-glib/Makefile.am +++ b/src/libqmi-glib/Makefile.am @@ -31,6 +31,7 @@ libqmi_glib_la_SOURCES = \ qmi-enums-oma.h \ qmi-enums-wda.h \ qmi-enums-voice.h \ + qmi-enums-loc.h \ qmi-enums.h qmi-enums-private.h \ qmi-utils.h qmi-utils.c \ qmi-compat.h qmi-compat.c \ @@ -67,6 +68,7 @@ include_HEADERS = \ qmi-enums-oma.h \ qmi-enums-wda.h \ qmi-enums-voice.h \ + qmi-enums-loc.h \ qmi-utils.h \ qmi-message.h \ qmi-message-context.h \ diff --git a/src/libqmi-glib/generated/Makefile.am b/src/libqmi-glib/generated/Makefile.am index 77d48cb..5b4ca02 100644 --- a/src/libqmi-glib/generated/Makefile.am +++ b/src/libqmi-glib/generated/Makefile.am @@ -17,7 +17,8 @@ GENERATED_H = \ qmi-uim.h \ qmi-oma.h \ qmi-wda.h \ - qmi-voice.h + qmi-voice.h \ + qmi-loc.h GENERATED_C = \ qmi-error-types.c \ @@ -36,7 +37,8 @@ GENERATED_C = \ qmi-uim.c \ qmi-oma.c \ qmi-wda.c \ - qmi-voice.c + qmi-voice.c \ + qmi-loc.c GENERATED_SECTIONS = \ qmi-ctl.sections \ @@ -50,7 +52,8 @@ GENERATED_SECTIONS = \ qmi-uim.sections \ qmi-oma.sections \ qmi-wda.sections \ - qmi-voice.sections + qmi-voice.sections \ + qmi-loc.sections # Error types qmi-error-types.h: $(top_srcdir)/src/libqmi-glib/qmi-errors.h $(top_srcdir)/build-aux/templates/qmi-error-types-template.h @@ -86,10 +89,11 @@ ENUMS = \ $(top_srcdir)/src/libqmi-glib/qmi-enums-oma.h \ $(top_srcdir)/src/libqmi-glib/qmi-enums-wda.h \ $(top_srcdir)/src/libqmi-glib/qmi-enums-voice.h \ + $(top_srcdir)/src/libqmi-glib/qmi-enums-loc.h \ $(top_srcdir)/src/libqmi-glib/qmi-device.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-pdc.h\"\n#include \"qmi-enums-pbm.h\"\n#include \"qmi-enums-uim.h\"\n#include \"qmi-enums-oma.h\"\n#include \"qmi-enums-wda.h\"\n#include \"qmi-enums-voice.h\"\n#include \"qmi-device.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-pdc.h\"\n#include \"qmi-enums-pbm.h\"\n#include \"qmi-enums-uim.h\"\n#include \"qmi-enums-oma.h\"\n#include \"qmi-enums-wda.h\"\n#include \"qmi-enums-voice.h\"\n#include \"qmi-enums-loc.h\"\n#include \"qmi-device.h\"\n" \ --template $(top_srcdir)/build-aux/templates/qmi-enum-types-template.h \ --ftail "#endif /* __LIBQMI_GLIB_ENUM_TYPES_H__ */\n" \ $(ENUMS) > $@ @@ -251,6 +255,17 @@ qmi-voice.h qmi-voice.c qmi-voice.sections: $(top_srcdir)/data/qmi-service-voice --include $(top_srcdir)/data/qmi-common.json \ --output qmi-voice +# LOC service +qmi-loc.h qmi-loc.c qmi-loc.sections: $(top_srcdir)/data/qmi-service-loc.json $(top_srcdir)/build-aux/qmi-codegen/*.py $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen + $(AM_V_GEN) \ + rm -f qmi-loc.h && \ + rm -f qmi-loc.c && \ + $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen \ + --input $(top_srcdir)/data/qmi-service-loc.json \ + --include $(top_srcdir)/data/qmi-common.json \ + --output qmi-loc + + BUILT_SOURCES = $(GENERATED_H) $(GENERATED_C) nodist_libqmi_glib_generated_la_SOURCES = \ @@ -284,6 +299,7 @@ nodist_include_HEADERS = \ qmi-uim.h \ qmi-oma.h \ qmi-wda.h \ - qmi-voice.h + qmi-voice.h \ + qmi-loc.h CLEANFILES = $(GENERATED_H) $(GENERATED_C) $(GENERATED_SECTIONS) diff --git a/src/libqmi-glib/libqmi-glib.h b/src/libqmi-glib/libqmi-glib.h index e9c22e2..2ec1d3a 100644 --- a/src/libqmi-glib/libqmi-glib.h +++ b/src/libqmi-glib/libqmi-glib.h @@ -74,6 +74,9 @@ #include "qmi-enums-voice.h" #include "qmi-voice.h" +#include "qmi-enums-loc.h" +#include "qmi-loc.h" + /* generated */ #include "qmi-error-types.h" #include "qmi-enum-types.h" diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index a3dee23..2c96a65 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -52,6 +52,7 @@ #include "qmi-oma.h" #include "qmi-wda.h" #include "qmi-voice.h" +#include "qmi-loc.h" #include "qmi-utils.h" #include "qmi-error-types.h" #include "qmi-enum-types.h" @@ -1089,6 +1090,10 @@ qmi_device_allocate_client (QmiDevice *self, ctx->client_type = QMI_TYPE_CLIENT_VOICE; break; + case QMI_SERVICE_LOC: + ctx->client_type = QMI_TYPE_CLIENT_LOC; + break; + default: g_simple_async_result_set_error (ctx->result, QMI_CORE_ERROR, diff --git a/src/libqmi-glib/qmi-enums-loc.h b/src/libqmi-glib/qmi-enums-loc.h new file mode 100644 index 0000000..53d402c --- /dev/null +++ b/src/libqmi-glib/qmi-enums-loc.h @@ -0,0 +1,64 @@ +/* -*- 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. + * Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es> + */ + +#ifndef _LIBQMI_GLIB_QMI_ENUMS_LOC_H_ +#define _LIBQMI_GLIB_QMI_ENUMS_LOC_H_ + +#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#error "Only <libqmi-glib.h> can be included directly." +#endif + +/** + * SECTION: qmi-enums-loc + * @title: LOC enumerations and flags + * + * This section defines enumerations and flags used in the LOC service + * interface. + */ + +/*****************************************************************************/ +/* Helper enums for the 'QMI LOC Start' indication */ + +/** + * QmiLocIntermediateReportState: + * @QMI_LOC_INTERMEDIATE_REPORT_STATE_UNKNOWN: Unknown. + * @QMI_LOC_INTERMEDIATE_REPORT_STATE_ENABLE: Enable intermediate state reporting. + * @QMI_LOC_INTERMEDIATE_REPORT_STATE_DISABLE: Disable intermediate state reporting. + * + * Whether to enable or disable intermediate state reporting. + * + * Since: 1.19 + */ +typedef enum { + QMI_LOC_INTERMEDIATE_REPORT_STATE_UNKNOWN = 0, + QMI_LOC_INTERMEDIATE_REPORT_STATE_ENABLE = 1, + QMI_LOC_INTERMEDIATE_REPORT_STATE_DISABLE = 2, +} QmiLocIntermediateReportState; + +/** + * qmi_loc_intermediate_report_state_get_string: + * + * Since: 1.19 + */ + +#endif /* _LIBQMI_GLIB_QMI_ENUMS_LOC_H_ */ diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c index 8940de0..42c6596 100644 --- a/src/libqmi-glib/qmi-message.c +++ b/src/libqmi-glib/qmi-message.c @@ -52,6 +52,7 @@ #include "qmi-oma.h" #include "qmi-wda.h" #include "qmi-voice.h" +#include "qmi-loc.h" #define PACKED __attribute__((packed)) @@ -1539,6 +1540,9 @@ qmi_message_get_printable_full (QmiMessage *self, case QMI_SERVICE_VOICE: contents = __qmi_message_voice_get_printable (self, context, line_prefix); break; + case QMI_SERVICE_LOC: + contents = __qmi_message_loc_get_printable (self, context, line_prefix); + break; default: break; } @@ -1598,6 +1602,9 @@ qmi_message_get_version_introduced_full (QmiMessage *self, case QMI_SERVICE_WDA: return __qmi_message_wda_get_version_introduced (self, context, major, minor); + case QMI_SERVICE_LOC: + return __qmi_message_loc_get_version_introduced (self, context, major, minor); + default: /* For the still unsupported services, cannot do anything */ return FALSE; |