mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 16:56:25 +08:00
listener: use PX4_INFO_RAW instead of printf
Ensures that clients will get the output of the listener.
This commit is contained in:
@@ -65,7 +65,7 @@ topic_fields = ["uint64_t timestamp"]+["%s %s" % (convert_type(field.type), fiel
|
||||
}@
|
||||
|
||||
#include <cinttypes>
|
||||
#include <cstdio>
|
||||
#include <px4_log.h>
|
||||
#include <px4_defines.h>
|
||||
#include <uORB/topics/@(topic_name).h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
@@ -80,14 +80,14 @@ ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), _
|
||||
|
||||
void print_message(const @uorb_struct& message)
|
||||
{
|
||||
printf(" @(uorb_struct)\n");
|
||||
printf("\ttimestamp: %" PRIu64, message.timestamp);
|
||||
PX4_INFO_RAW(" @(uorb_struct)\n");
|
||||
PX4_INFO_RAW("\ttimestamp: %" PRIu64, message.timestamp);
|
||||
if (message.timestamp != 0) {
|
||||
printf(" (%.6f seconds ago)\n", hrt_elapsed_time(&message.timestamp) / 1e6);
|
||||
PX4_INFO_RAW(" (%.6f seconds ago)\n", hrt_elapsed_time(&message.timestamp) / 1e6);
|
||||
} else {
|
||||
printf("\n");
|
||||
PX4_INFO_RAW("\n");
|
||||
}
|
||||
@[for field in sorted_fields]@
|
||||
@( print_field(field) )@
|
||||
@[end for]@
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user