From 2ae831f40da3779d4e793d1eb2b6c77208864169 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sat, 15 Jun 2024 16:38:00 +0800 Subject: [PATCH] system/uORB: using lib_sprintf to output va_format and printf normal info in aosp adb shell Signed-off-by: dongjiuzhu1 --- system/uorb/uORB/uORB.c | 6 +++++- system/uorb/uORB/uORB.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c index d979277cb..67bf6461b 100644 --- a/system/uorb/uORB/uORB.c +++ b/system/uorb/uORB/uORB.c @@ -348,11 +348,15 @@ int orb_sscanf(FAR const char *buf, FAR const char *format, FAR void *data) void orb_info(FAR const char *format, FAR const char *name, FAR const void *data) { + struct lib_stdoutstream_s stdoutstream; struct va_format vaf; vaf.fmt = format; vaf.va = (va_list *)data; - uorbinfo_raw("%s(now:%" PRIu64 "):%pB\n", name, orb_absolute_time(), &vaf); + + lib_stdoutstream(&stdoutstream, stdout); + lib_sprintf(&stdoutstream.common, "%s(now:%" PRIu64 "):%pB", + name, orb_absolute_time(), &vaf); } int orb_fprintf(FAR FILE *stream, FAR const char *format, diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index e2434acea..5c82d4807 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -121,7 +121,7 @@ typedef struct sensor_device_info_s orb_info_t; # define uorbdebug uorbnone #endif -#define uorbinfo_raw(fmt, ...) syslog(LOG_INFO, fmt "\n", ##__VA_ARGS__) +#define uorbinfo_raw(fmt, ...) printf(fmt "\n", ##__VA_ARGS__) /* Generates a pointer to the uORB metadata structure for * a given topic.