aboutsummaryrefslogtreecommitdiffstats
path: root/src/etisnoop.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-04-27 01:39:20 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-04-27 01:39:20 +0200
commit0616c12772c4995d0a22b803127af156a37a3a7d (patch)
tree0561c72fa58cc71209edc196e4706b850b000868 /src/etisnoop.cpp
parent36d70772c7ba15bf1d769f7ec54ba129377f4617 (diff)
downloadetisnoop-0616c12772c4995d0a22b803127af156a37a3a7d.tar.gz
etisnoop-0616c12772c4995d0a22b803127af156a37a3a7d.tar.bz2
etisnoop-0616c12772c4995d0a22b803127af156a37a3a7d.zip
Refactor FIG0/X message generation
Diffstat (limited to 'src/etisnoop.cpp')
-rw-r--r--src/etisnoop.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/etisnoop.cpp b/src/etisnoop.cpp
index 7137d2e..1ebdf70 100644
--- a/src/etisnoop.cpp
+++ b/src/etisnoop.cpp
@@ -1,6 +1,6 @@
/*
Copyright (C) 2014 CSP Innovazione nelle ICT s.c.a r.l. (http://www.csp.it/)
- Copyright (C) 2016 Matthias P. Braendli (http://www.opendigitalradio.org)
+ Copyright (C) 2017 Matthias P. Braendli (http://www.opendigitalradio.org)
Copyright (C) 2015 Data Path
This program is free software: you can redistribute it and/or modify
@@ -701,8 +701,23 @@ void decodeFIG(
figs.push_back(figtype, fig0.ext(), figlen);
- bool complete = fig0_select(fig0, disp);
- rate_announce_fig(figtype, fig0.ext(), complete);
+ auto fig_result = fig0_select(fig0, disp);
+ for (const auto& msg : fig_result.msgs) {
+ std::string s;
+ for (int i = 0; i < msg.level; i++) {
+ s += " ";
+ }
+ s += msg.msg;
+ printbuf(s.c_str(), disp.indent+1, nullptr, 0);
+ }
+ if (not fig_result.errors.empty()) {
+ printf("ERRORS:\n");
+ for (const auto& err : fig_result.errors) {
+ printbuf(err.c_str(), disp.indent+1, nullptr, 0);
+ }
+ }
+
+ rate_announce_fig(figtype, fig0.ext(), fig_result.complete);
}
break;