From fe3d7e34ccc5ee6defcf4f32177e57832ee359d4 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sat, 19 May 2012 12:34:44 +0200 Subject: [PATCH] data: let the `Result' TLV be a common type --- data/qmi-common.json | 12 +++++++++ data/qmi-service-ctl.json | 51 ++++++--------------------------------- src/Makefile.am | 1 + 3 files changed, 21 insertions(+), 43 deletions(-) create mode 100644 data/qmi-common.json diff --git a/data/qmi-common.json b/data/qmi-common.json new file mode 100644 index 0000000..6087534 --- /dev/null +++ b/data/qmi-common.json @@ -0,0 +1,12 @@ +[ + + { "name" : "Result", + "id" : "0x02", + "mandatory" : "yes", + "type" : "TLV", + "format" : "struct", + "contents" : [ { "name" : "Error Status", + "type" : "guint16" }, + { "name" : "Error Code", + "type" : "guint16" } ] } +] diff --git a/data/qmi-service-ctl.json b/data/qmi-service-ctl.json index a1ee85c..0bf182d 100644 --- a/data/qmi-service-ctl.json +++ b/data/qmi-service-ctl.json @@ -10,17 +10,8 @@ "type" : "Message", "service" : "CTL", "id" : "0x0021", - "output" : [ - { "name" : "Result", - "id" : "0x02", - "mandatory" : "yes", - "type" : "TLV", - "format" : "struct", - "contents" : [ { "name" : "Error Status", - "type" : "guint16" }, - { "name" : "Error Code", - "type" : "guint16" } ] }, - + "output" : [ { "name" : "Result", + "type" : "common-TLV" }, { "name" : "Service list", "id" : "0x01", "mandatory" : "yes", @@ -47,17 +38,8 @@ "mandatory" : "yes", "type" : "TLV", "format" : "guint8" } ], - "output" : [ - { "name" : "Result", - "id" : "0x02", - "mandatory" : "yes", - "type" : "TLV", - "format" : "struct", - "contents" : [ { "name" : "Error Status", - "type" : "guint16" }, - { "name" : "Error Code", - "type" : "guint16" } ] }, - + "output" : [ { "name" : "Result", + "type" : "common-TLV" }, { "name" : "Allocation Info", "id" : "0x01", "mandatory" : "yes", @@ -84,17 +66,8 @@ "type" : "guint8" }, { "name" : "Cid", "type" : "guint8" } ] } ], - "output" : [ - { "name" : "Result", - "id" : "0x02", - "mandatory" : "yes", - "type" : "TLV", - "format" : "struct", - "contents" : [ { "name" : "Error Status", - "type" : "guint16" }, - { "name" : "Error Code", - "type" : "guint16" } ] }, - + "output" : [ { "name" : "Result", + "type" : "common-TLV" }, { "name" : "Release Info", "id" : "0x01", "mandatory" : "yes", @@ -112,14 +85,6 @@ "type" : "Message", "service" : "CTL", "id" : "0x0027", - "output" : [ - { "name" : "Result", - "id" : "0x02", - "mandatory" : "yes", - "type" : "TLV", - "format" : "struct", - "contents" : [ { "name" : "Error Status", - "type" : "guint16" }, - { "name" : "Error Code", - "type" : "guint16" } ] } ] } + "output" : [ { "name" : "Result", + "type" : "common-TLV" } ] } ] diff --git a/src/Makefile.am b/src/Makefile.am index e3d4ae7..6b33e23 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,6 +41,7 @@ qmi-enum-types.c: $(ENUMS) qmi-enum-types.h $(top_srcdir)/build-aux/templates/qm 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) $(top_srcdir)/build-aux/qmi-codegen/qmi-codegen \ --input $(top_srcdir)/data/qmi-service-ctl.json \ + --include $(top_srcdir)/data/qmi-common.json \ --output qmi-ctl && \ touch $@