qmi-codegen: use a `common-ref' field to specify common dictionaries, like TLVs
This commit is contained in:
parent
5ee73a0f3e
commit
de514133ce
|
@ -52,10 +52,10 @@ class Container:
|
|||
|
||||
# First, look for references to common types
|
||||
for field_dictionary in dictionary:
|
||||
if field_dictionary['type'] == 'common-TLV':
|
||||
if 'common-ref' in field_dictionary:
|
||||
for common in common_objects_dictionary:
|
||||
if common['name'] == field_dictionary['name'] and \
|
||||
common['type'] == 'TLV':
|
||||
if common['type'] == 'TLV' and \
|
||||
common['common-ref'] == field_dictionary['common-ref']:
|
||||
# Replace the reference with the actual common dictionary
|
||||
dictionary.remove(field_dictionary)
|
||||
dictionary.append(common)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
[
|
||||
|
||||
{ "name" : "Result",
|
||||
"id" : "0x02",
|
||||
"mandatory" : "yes",
|
||||
"type" : "TLV",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Error Status",
|
||||
"type" : "guint16" },
|
||||
{ "name" : "Error Code",
|
||||
"type" : "guint16" } ] }
|
||||
{ "common-ref" : "Operation Result",
|
||||
"name" : "Result",
|
||||
"id" : "0x02",
|
||||
"mandatory" : "yes",
|
||||
"type" : "TLV",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Error Status",
|
||||
"type" : "guint16" },
|
||||
{ "name" : "Error Code",
|
||||
"type" : "guint16" } ] }
|
||||
]
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0021",
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Service list",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
@ -38,8 +37,7 @@
|
|||
"mandatory" : "yes",
|
||||
"type" : "TLV",
|
||||
"format" : "guint8" } ],
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Allocation Info",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
@ -66,8 +64,7 @@
|
|||
"type" : "guint8" },
|
||||
{ "name" : "Cid",
|
||||
"type" : "guint8" } ] } ],
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Release Info",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
@ -85,6 +82,5 @@
|
|||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0027",
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" } ] }
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] }
|
||||
]
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
"type" : "Message",
|
||||
"service" : "DMS",
|
||||
"id" : "0x0025",
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Esn",
|
||||
"id" : "0x10",
|
||||
"mandatory" : "no",
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
"mandatory" : "no",
|
||||
"type" : "TLV",
|
||||
"format" : "string" } ],
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Packet Data Handle",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
@ -71,15 +70,13 @@
|
|||
"mandatory" : "yes",
|
||||
"type" : "TLV",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" } ] },
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
{ "name" : "Get Packet Service Status",
|
||||
"type" : "Message",
|
||||
"service" : "WDS",
|
||||
"id" : "0x0022",
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Connection Status",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
@ -93,8 +90,7 @@
|
|||
"type" : "Message",
|
||||
"service" : "WDS",
|
||||
"id" : "0x0044",
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Current",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
@ -125,8 +121,7 @@
|
|||
"type" : "Message",
|
||||
"service" : "WDS",
|
||||
"id" : "0x0037",
|
||||
"output" : [ { "name" : "Result",
|
||||
"type" : "common-TLV" },
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Current",
|
||||
"id" : "0x01",
|
||||
"mandatory" : "yes",
|
||||
|
|
Loading…
Reference in New Issue