Add flag to aos_dump and log_cat to print integers in hex format.
Define new --use_hex flag on aos_dump and log_cat applications that
controls how integers are formatted in the output.
Add use_hex field to JsonOptions struct used by FlatbufferToJson.
Update internal helpers used by FlatbufferToJson to act on new tag.
Change-Id: I26dea2cc37de3af4a1e10852e0df8ff93a696802
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/aos_dump.cc b/aos/aos_dump.cc
index 2fe4955..86f4305 100644
--- a/aos/aos_dump.cc
+++ b/aos/aos_dump.cc
@@ -26,6 +26,7 @@
DEFINE_int32(timeout, -1,
"The max time in milliseconds to wait for messages before "
"exiting. -1 means forever, 0 means don't wait.");
+DEFINE_bool(use_hex, false, "Are integers in the messages printed in hex notation.");
namespace {
@@ -48,7 +49,7 @@
aos::FlatbufferToJson(
builder, channel->schema(), static_cast<const uint8_t *>(context.data),
{FLAGS_pretty, static_cast<size_t>(FLAGS_max_vector_size),
- FLAGS_pretty_max});
+ FLAGS_pretty_max, FLAGS_use_hex});
if (FLAGS_print_timestamps) {
if (context.monotonic_remote_time != context.monotonic_event_time) {