12 d.append({'enumtype': e.enumtype})
20 d = {'reply': e.reply}
24 d['events'] = e.events
37 f = [b.fieldtype, b.fieldname]
38 elif b.type == 'Array':
40 f = [b.fieldtype, b.fieldname, b.length, b.lengthfield]
42 f = [b.fieldtype, b.fieldname, b.length]
44 raise ValueError("Error in processing array type %s" % b)
48 c['crc'] = "{0:#0{1}x}".format(t.crc, 10)
58 def run(filename, s, file_crc):
61 j['types'] = walk_defs(s['typedefs'])
62 j['messages'] = walk_defs(s['defines'])
63 j['enums'] = walk_enums(s['enums'])
64 j['services'] = walk_services(s['services'])
65 j['vl_api_version'] = hex(file_crc)
66 return json.dumps(j, indent=4, separators=(',', ': '))