Updated xml to json generator for events

This commit is contained in:
Suvendhu Hansa 2022-03-25 09:38:51 +00:00 committed by Vivek Kumar Dutta
parent 5740cedb5a
commit 29a6ada1f7
3 changed files with 614 additions and 643 deletions

View file

@ -62,6 +62,7 @@
"protocols": [
"usp"
],
"output": {
"CommandKey": {
"type": "string",
"read": true,
@ -109,6 +110,7 @@
],
"datatype": "JSONObject"
}
}
},
"FactoryReset()": {
"type": "command",
@ -38535,6 +38537,7 @@
"protocols": [
"usp"
],
"output": {
"BSSID": {
"type": "string",
"read": true,
@ -38641,6 +38644,7 @@
],
"datatype": "string"
}
}
},
"Device.WiFi.DataElements.AssociationEvent.AssociationEventData.{i}.": {
"type": "object",
@ -39070,6 +39074,7 @@
"protocols": [
"usp"
],
"output": {
"BSSID": {
"type": "string",
"read": true,
@ -39198,6 +39203,7 @@
],
"datatype": "string"
}
}
},
"Device.WiFi.DataElements.DisassociationEvent.DisassociationEventData.{i}.": {
"type": "object",
@ -39375,6 +39381,7 @@
"protocols": [
"usp"
],
"output": {
"MACAddress": {
"type": "string",
"read": true,
@ -39424,6 +39431,7 @@
],
"datatype": "string"
}
}
},
"Device.WiFi.DataElements.FailedConnectionEvent.FailedConnectionEventData.{i}.": {
"type": "object",
@ -49375,16 +49383,6 @@
],
"access": true,
"array": true,
"mapping": {
"type": "uci",
"uci": {
"file": "network",
"section": {
"type": "interface"
},
"dmmapfile": "dmmap_network"
}
},
"Enable": {
"type": "boolean",
"read": true,
@ -49394,20 +49392,7 @@
"cwmp",
"usp"
],
"datatype": "boolean",
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "network.interface",
"method": "status",
"args": {
"interface": "@Name"
},
"key": "up"
}
}
]
"datatype": "boolean"
},
"Status": {
"type": "string",
@ -49427,19 +49412,6 @@
"NotPresent",
"LowerLayerDown",
"Error"
],
"mapping": [
{
"type": "ubus",
"ubus": {
"object": "network.interface",
"method": "status",
"args": {
"interface": "@Name"
},
"key": "up"
}
}
]
},
"Alias": {
@ -76833,21 +76805,6 @@
"pattern": [
"",
"([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "network",
"section": {
"type": "interface",
"index": "@i-1"
},
"option": {
"name": "mac"
}
}
}
]
},
"ChaddrExclude": {
@ -86046,6 +86003,7 @@
"protocols": [
"usp"
],
"output": {
"Data": {
"type": "string",
"read": true,
@ -86056,6 +86014,7 @@
],
"datatype": "string"
}
}
},
"ForceCollection()": {
"type": "command",
@ -86661,6 +86620,7 @@
"protocols": [
"usp"
],
"output": {
"UUID": {
"type": "string",
"read": true,
@ -86777,6 +86737,7 @@
"Uninstall"
]
}
}
},
"Device.SoftwareModules.ExecEnv.{i}.": {
"type": "object",
@ -100076,6 +100037,7 @@
"protocols": [
"usp"
],
"output": {
"Command": {
"type": "string",
"read": true,
@ -100190,6 +100152,7 @@
}
]
}
}
},
"AddCertificate()": {
"type": "command",
@ -100896,6 +100859,7 @@
"protocols": [
"usp"
],
"output": {
"CommandKey": {
"type": "string",
"read": true,
@ -100906,6 +100870,7 @@
],
"datatype": "string"
}
}
},
"AddMyCertificate()": {
"type": "command",
@ -102623,6 +102588,7 @@
"protocols": [
"usp"
],
"output": {
"ParamPath": {
"type": "string",
"read": true,
@ -102645,6 +102611,7 @@
}
}
}
}
},
"Device.Standby.": {
"type": "object",

View file

@ -183,7 +183,8 @@ def generate_datamodel_tree(filename):
# Object Table
if obj_found == 1:
if obj_found_in_list == 0:
for value in LIST_OBJ:
obj_list = LIST_OBJ
for value in obj_list:
val = value.split(":")
if val[1] == table_name:
parent_obj = val[0]
@ -213,7 +214,8 @@ def generate_datamodel_tree(filename):
# Parameter Table
if param_found == 1:
if obj_found_in_list == 0:
for value in LIST_PARAM:
param_list = LIST_PARAM
for value in param_list:
val = value.split(":")
if val[1] == table_name:
parent_obj = val[0]

View file

@ -667,6 +667,7 @@ def printEVENT(dmparam, dmobject, _bbfdm_type):
"\"protocols\" : [\"usp\"]"), file=fp)
if has_param:
print("\"output\" : {", file=fp)
fp.close()
for param in dmparam:
@ -675,6 +676,7 @@ def printEVENT(dmparam, dmobject, _bbfdm_type):
if has_param:
fp = open('./.json_tmp', 'a', encoding='utf-8')
print("}", file=fp)
print("}", file=fp)
fp.close()