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_18.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/fig0_18.cpp') diff --git a/src/fig0_18.cpp b/src/fig0_18.cpp index cc82bec..ecbf7ba 100644 --- a/src/fig0_18.cpp +++ b/src/fig0_18.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,34 +65,42 @@ fig_result_t fig0_18(fig0_common_t& fig0, const display_settings_t &disp) Asu_flags = ((uint16_t)f[i+2] << 8) | (uint16_t)f[i+3]; Rfa = (f[i+4] >> 5); Number_clusters = (f[i+4] & 0x1F); - r.msgs.push_back(strprintf("SId=0x%X", SId)); - r.msgs.push_back(strprintf("Asu flags=0x%04x", Asu_flags)); + r.msgs.emplace_back("-"); + r.msgs.emplace_back(1, strprintf("SId=0x%X", SId)); + r.msgs.emplace_back(1, strprintf("Asu flags=0x%04x", Asu_flags)); if (Rfa != 0) { r.errors.push_back(strprintf("Rfa=%d invalid value", Rfa)); } - r.msgs.push_back(strprintf("Number of clusters=%d", Number_clusters)); + r.msgs.emplace_back(1, strprintf("Number of clusters=%d", Number_clusters)); key = ((uint32_t)fig0.oe() << 17) | ((uint32_t)fig0.pd() << 16) | (uint32_t)SId; - r.msgs.push_back(strprintf("database key=0x%05x", key)); + r.msgs.emplace_back(1, strprintf("database key=0x%05x", key)); // CEI Change Event Indication if ((Number_clusters == 0) && (Asu_flags == 0)) { - r.msgs.emplace_back("CEI"); + r.msgs.emplace_back("CEI=true"); } i += 5; + std::stringstream clusters_ss; for(j = 0; (j < Number_clusters) && (i < fig0.figlen); j++) { // iterate over Cluster Id - r.msgs.emplace_back(1, strprintf("Cluster Id=0x%X", f[i])); + if (j > 0) { + clusters_ss << ", "; + } + clusters_ss << strprintf("0x%X", f[i]); i++; } + r.msgs.emplace_back(1, "Cluster Ids: [" + clusters_ss.str() + "]"); + if (j < Number_clusters) { r.errors.push_back("missing Cluster Id, fig length too short !"); } + r.msgs.emplace_back(1, "Announcements:"); // decode announcement support types for (j = 0; j < 16; j++) { if (Asu_flags & (1 << j)) { - r.msgs.emplace_back(1, strprintf("Announcement support=%s", get_announcement_type(j))); + r.msgs.emplace_back(2, strprintf("- %s", get_announcement_type(j))); } } } -- cgit v1.2.3