events: emit warning if foramt and params don't match

This commit is contained in:
Matthias Ringwald 2017-02-20 12:38:53 +01:00
parent a713a5a8ad
commit 6397af06fa

View File

@ -242,20 +242,24 @@ def create_events(events):
if not event_group in [ 'BTSTACK', 'GAP', 'HCI', 'HSP', 'HFP', 'SDP', 'ANCS', 'SM', 'L2CAP', 'RFCOMM', 'GATT', 'BNEP', 'ATT', 'AVDTP', 'AVRCP']:
print("// %s " % event_name)
continue
print(event_name)
event_name = format_function_name(event_name)
# print(event_name)
base_name = format_function_name(event_name)
length_name = ''
offset = 2
supported = all_fields_supported(format)
if is_le_event(event_group):
fout.write("#ifdef ENABLE_BLE\n")
if len(format) != len(args):
print(event_name.upper())
print ("Format %s does not match params %s " % (format, args))
print
for f, arg in zip(format, args):
field_name = arg
if field_name.lower() == 'subevent_code':
offset += 1
continue
field_type = f
text = create_getter(event_name, field_name, field_type, offset, supported)
text = create_getter(base_name, field_name, field_type, offset, supported)
fout.write(text)
if field_type in 'RT':
break