system/uORB: using lib_sprintf to output va_format and printf normal info in aosp adb shell

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-06-15 16:38:00 +08:00 committed by Lup Yuen Lee
parent f0db02740b
commit 2ae831f40d
2 changed files with 6 additions and 2 deletions

View File

@ -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,

View File

@ -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.