12 d.append({'enumtype': e.enumtype})
20 d = {'reply': e.reply}
24 d['events'] = e.events
36 d.append([b.fieldtype, b.fieldname])
37 elif b.type == 'Array':
39 d.append([b.fieldtype, b.fieldname, b.length, b.lengthfield])
41 d.append([b.fieldtype, b.fieldname, b.length])
42 elif b.type == 'Union':
45 raise ValueError("Error in processing array type %s" % b)
49 c['crc'] = "{0:#0{1}x}".format(t.crc, 10)
59 def run(filename, s, file_crc):
62 j['types'] = walk_defs([o for o in s['types'] if o.__class__.__name__ == 'Typedef'])
63 j['messages'] = walk_defs(s['Define'])
64 j['unions'] = walk_defs([o for o in s['types'] if o.__class__.__name__ == 'Union'])
65 j['enums'] = walk_enums([o for o in s['types'] if o.__class__.__name__ == 'Enum'])
66 j['services'] = walk_services(s['Service'])
67 j['aliases'] = s['Alias']
68 j['vl_api_version'] = hex(file_crc)
69 return json.dumps(j, indent=4, separators=(',', ': '))