uORB print_message add device_id pretty print

This commit is contained in:
Daniel Agar
2018-08-30 16:06:42 -04:00
committed by Lorenz Meier
parent 7cc0e69fcd
commit af6098b9ea
3 changed files with 44 additions and 0 deletions
@@ -250,6 +250,10 @@ def print_field(field):
print("if (message.timestamp != 0) {\n\t\tPX4_INFO_RAW(\"\\t" + field.name + \
": " + c_type + " (%.6f seconds ago)\\n\", " + field_name + \
", hrt_elapsed_time(&message.timestamp) / 1e6);\n\t} else {\n\t\tPX4_INFO_RAW(\"\\n\");\n\t}" )
elif field.name == 'device_id':
print("char device_id_buffer[80];")
print("device::Device::device_id_print_buffer(device_id_buffer, sizeof(device_id_buffer), message.device_id);")
print("PX4_INFO_RAW(\"\\tdevice_id: %d (%s) \\n\", message.device_id, device_id_buffer);" )
else:
print("PX4_INFO_RAW(\"\\t" + field.name + ": " + c_type + "\\n\", " + field_name + ");" )