diff options
author | Dan Williams <dcbw@redhat.com> | 2017-04-17 13:40:09 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2017-04-17 13:59:22 -0500 |
commit | 4da476f676678d83a5c73b94c4337c9a437fb6a1 (patch) | |
tree | c01a92efc533683c01170ca03ea24329e1798dcb /src/libqmi-glib | |
parent | 07da0340043b3b4d3ffc005e0a10b4776157a0fe (diff) | |
download | external_libqmi-4da476f676678d83a5c73b94c4337c9a437fb6a1.zip external_libqmi-4da476f676678d83a5c73b94c4337c9a437fb6a1.tar.gz external_libqmi-4da476f676678d83a5c73b94c4337c9a437fb6a1.tar.bz2 |
loc: add boilerplate and start/stop message skeletons
Diffstat (limited to 'src/libqmi-glib')
-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 |
6 files changed, 102 insertions, 5 deletions
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; |