From fa97e6417eed3b7acffc014209a1691588cb8acd Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 28 Apr 2017 14:39:27 +0200 Subject: Adapt FIG1/x to new result struct, improve FIG filter --- src/utils.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/utils.cpp') diff --git a/src/utils.cpp b/src/utils.cpp index 75aa880..3e741c9 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -83,6 +83,38 @@ void printbuf(std::string header, printbuf(header, disp, buffer, size, desc); } +void printfig(string header, + const display_settings_t &disp, + uint8_t* buffer, + size_t size, + string desc) +{ + if (disp.print) { + for (int i = 0; i < disp.indent; i++) { + printf("\t"); + } + + printf("%s", header.c_str()); + + if (verbosity > 1) { + if (size != 0) { + printf(": "); + } + + for (size_t i = 0; i < size; i++) { + printf("%02x ", buffer[i]); + } + } + + if (desc != "") { + printf(" [%s] ", desc.c_str()); + } + + printf("\n"); + } +} + + void printbuf(string header, const display_settings_t &disp, uint8_t* buffer, -- cgit v1.2.3