From 618c88a6e3c594b8382b4c61710a968c6adcdf49 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 3 Mar 2018 18:03:17 +0100 Subject: Output YAML --- src/fig0_25.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/fig0_25.cpp') diff --git a/src/fig0_25.cpp b/src/fig0_25.cpp index 9aa64c0..bf02d13 100644 --- a/src/fig0_25.cpp +++ b/src/fig0_25.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2014 CSP Innovazione nelle ICT s.c.a r.l. (http://www.csp.it/) - Copyright (C) 2017 Matthias P. Braendli (http://www.opendigitalradio.org) + Copyright (C) 2018 Matthias P. Braendli (http://www.opendigitalradio.org) Copyright (C) 2015 Data Path This program is free software: you can redistribute it and/or modify @@ -65,7 +65,8 @@ fig_result_t fig0_25(fig0_common_t& fig0, const display_settings_t &disp) Asu_flags = ((uint16_t)f[i+2] << 8) | (uint16_t)f[i+3]; Rfu = (f[i+4] >> 4); Number_EIds = (f[i+4] & 0x0F); - r.msgs.push_back(strprintf("SId=0x%X", SId)); + r.msgs.emplace_back("-"); + r.msgs.emplace_back(1, strprintf("SId=0x%X", SId)); r.msgs.emplace_back(1, strprintf("Asu flags=0x%X", Asu_flags)); r.msgs.emplace_back(1, strprintf("Number of EIds=%d", Number_EIds)); @@ -78,26 +79,31 @@ fig_result_t fig0_25(fig0_common_t& fig0, const display_settings_t &disp) // CEI Change Event Indication if (Number_EIds == 0) { - r.msgs.emplace_back(1, "CEI"); + r.msgs.emplace_back(1, "CEI=true"); } i += 5; + std::stringstream eid_ss; for (j = 0; j < Number_EIds && i < fig0.figlen - 1; j++) { // iterate over EIds EId = ((uint16_t)f[i] << 8) | (uint16_t)f[i+1]; - r.msgs.emplace_back(2, strprintf("EId=0x%X", EId)); + if (j > 0) { + eid_ss << ", "; + } + eid_ss << strprintf("0x%04x", EId); i += 2; } + r.msgs.emplace_back(1, "EIds: [" + eid_ss.str() + "]"); if (j < Number_EIds) { r.errors.push_back("missing EId, fig length too short !"); } - // decode fig0.oe() announcement support types + r.msgs.emplace_back(1, "OE Announcement support:"); + // decode OE announcement support types for (j = 0; j < 16; j++) { if (Asu_flags & (1 << j)) { - r.msgs.emplace_back(2, - strprintf("fig0.oe() Announcement support=%s", get_announcement_type(j))); + r.msgs.emplace_back(2, strprintf("- %s", get_announcement_type(j))); } } } -- cgit v1.2.3