listener print strings

This commit is contained in:
Daniel Agar
2019-07-30 10:47:10 -04:00
parent ca74b3fef1
commit 0dc8119c89
5 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -3,4 +3,4 @@
uint64 timestamp # time since system start (microseconds)
uint8 severity # log level (same as in the linux kernel, starting with 0)
uint8[127] text
char[127] text
+1 -1
View File
@@ -1,4 +1,4 @@
uint64 timestamp # time since system start (microseconds)
uint8[50] text
char[50] text
uint8 severity # log level (same as in the linux kernel, starting with 0)
+1 -1
View File
@@ -1,5 +1,5 @@
uint64 timestamp # time since system start (microseconds)
uint8[100] cmd
char[100] cmd
uint32 MAX_STRLEN = 100
uint32 strlen
uint32 sequence
+1 -1
View File
@@ -5,4 +5,4 @@ uint64 timestamp # time since system start (microseconds)
uint8 MAX_REPORT_TASK_NAME_LEN = 16
uint16 stack_free
uint8[16] task_name
char[16] task_name
@@ -303,6 +303,8 @@ def print_field(field):
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);")
elif is_array and 'char' in field.type:
print("PX4_INFO_RAW(\"\\t" + field.name + ": \\\"%." + str(array_length) + "s\\\" \\n\", message." + field.name + ");")
else:
print("PX4_INFO_RAW(\"\\t" + field.name + ": " +
c_type + "\\n\", " + field_name + ");")