def display_pmecc_header(file_name, val):
	name = "pmecc_header"
	json_file=open(file_name)
	data = json.load(json_file)
	#pprint(data["pmecc_header"]["usePmecc"])
	if name in data:
		bitfieldsparser.parse_bitfield(data[name]["struct"], val)
	else:
		print('Error: Cannot find the key name: %s in the json file: %s' % (name, file_name))
	json_file.close()
Esempio n. 2
0
def display_pmecc_header(file_name, val):
    name = "pmecc_header"
    json_file = open(file_name)
    data = json.load(json_file)
    # pprint(data["pmecc_header"]["usePmecc"])
    if data.has_key(name):
        bitfieldsparser.parse_bitfield(data[name]["struct"], val)
    else:
        print "Error: Cannot find the kay name: %s in the json file: %s" % (name, file_name)
    json_file.close()