diff options
Diffstat (limited to 'src/utils.cpp')
-rw-r--r-- | src/utils.cpp | 126 |
1 files changed, 62 insertions, 64 deletions
diff --git a/src/utils.cpp b/src/utils.cpp index d5130b3..33b8a98 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -99,7 +99,7 @@ void header_message() fprintf(stderr, "(Communications Research Centre Canada)\n\n"); fprintf(stderr, - "Copyright (C) 2017 Matthias P. Braendli\n"); + "Copyright (C) 2018 Matthias P. Braendli\n"); fprintf(stderr, "LICENCE: GPLv3+\n\n"); fprintf(stderr, @@ -437,70 +437,68 @@ static void printFrequencyInformation(const shared_ptr<dabEnsemble>& ensemble) etiLog.level(info) << " None "; } for (const auto& fi : ensemble->frequency_information) { - etiLog.level(info) << " FI " << fi->uid; - etiLog.level(info) << " OE=" << (fi->other_ensemble ? 1 : 0); - for (const auto& fle : fi->frequency_information) { - etiLog.level(info) << " continuity " << (fle.continuity ? "true" : "false"); - switch (fle.rm) { - case RangeModulation::dab_ensemble: - etiLog.level(info) << " RM: DAB"; - etiLog.log(info, " EId 0x%04x", fle.fi_dab.eid); - break; - case RangeModulation::drm: - etiLog.level(info) << " RM: DRM"; - etiLog.log(info, " DRM Id 0x%06x", fle.fi_drm.drm_service_id); - break; - case RangeModulation::fm_with_rds: - etiLog.level(info) << " RM: FM (with RDS)"; - etiLog.log(info, " PI-Code 0x%04x", fle.fi_fm.pi_code); - break; - case RangeModulation::amss: - etiLog.level(info) << " RM: AMSS"; - etiLog.log(info, " AMSS Id 0x%06x", fle.fi_amss.amss_service_id); - break; - } - - switch (fle.rm) { - case RangeModulation::dab_ensemble: - for (const auto& f : fle.fi_dab.frequencies) { - stringstream ss; - ss << " " << f.uid << " "; - switch (f.control_field) { - case FrequencyInfoDab::ControlField_e::adjacent_no_mode: - ss << "Adjacent, w/o mode indication, "; - break; - case FrequencyInfoDab::ControlField_e::adjacent_mode1: - ss << "Adjacent, mode I, "; - break; - case FrequencyInfoDab::ControlField_e::disjoint_no_mode: - ss << "Disjoint, w/o mode indication, "; - break; - case FrequencyInfoDab::ControlField_e::disjoint_mode1: - ss << "Disjoint, mode I, "; - break; - } - ss << f.frequency; - etiLog.level(info) << ss.str(); - } - break; - case RangeModulation::drm: - etiLog.log(info, " ID 0x%02x", fle.fi_drm.drm_service_id); - for (const auto& f : fle.fi_drm.frequencies) { - etiLog.level(info) << " " << f; - } - break; - case RangeModulation::fm_with_rds: - for (const auto& f : fle.fi_fm.frequencies) { - etiLog.level(info) << " " << f; - } - break; - case RangeModulation::amss: - etiLog.log(info, " ID 0x%02x", fle.fi_amss.amss_service_id); - for (const auto& f : fle.fi_amss.frequencies) { - etiLog.level(info) << " " << f; + etiLog.level(info) << " FI " << fi.uid; + etiLog.level(info) << " OE=" << (fi.other_ensemble ? 1 : 0); + switch (fi.rm) { + case RangeModulation::dab_ensemble: + etiLog.level(info) << " RM: DAB"; + etiLog.log(info, " EId 0x%04x", fi.fi_dab.eid); + break; + case RangeModulation::drm: + etiLog.level(info) << " RM: DRM"; + etiLog.log(info, " DRM Id 0x%06x", fi.fi_drm.drm_service_id); + break; + case RangeModulation::fm_with_rds: + etiLog.level(info) << " RM: FM (with RDS)"; + etiLog.log(info, " PI-Code 0x%04x", fi.fi_fm.pi_code); + break; + case RangeModulation::amss: + etiLog.level(info) << " RM: AMSS"; + etiLog.log(info, " AMSS Id 0x%06x", fi.fi_amss.amss_service_id); + break; + } + etiLog.level(info) << " continuity " << (fi.continuity ? "true" : "false"); + + switch (fi.rm) { + case RangeModulation::dab_ensemble: + for (const auto& f : fi.fi_dab.frequencies) { + stringstream ss; + ss << " " << f.uid << " "; + switch (f.control_field) { + case FrequencyInfoDab::ControlField_e::adjacent_no_mode: + ss << "Adjacent, w/o mode indication, "; + break; + case FrequencyInfoDab::ControlField_e::adjacent_mode1: + ss << "Adjacent, mode I, "; + break; + case FrequencyInfoDab::ControlField_e::disjoint_no_mode: + ss << "Disjoint, w/o mode indication, "; + break; + case FrequencyInfoDab::ControlField_e::disjoint_mode1: + ss << "Disjoint, mode I, "; + break; } - break; - } + ss << f.frequency; + etiLog.level(info) << ss.str(); + } + break; + case RangeModulation::drm: + etiLog.log(info, " ID 0x%02x", fi.fi_drm.drm_service_id); + for (const auto& f : fi.fi_drm.frequencies) { + etiLog.level(info) << " " << f; + } + break; + case RangeModulation::fm_with_rds: + for (const auto& f : fi.fi_fm.frequencies) { + etiLog.level(info) << " " << f; + } + break; + case RangeModulation::amss: + etiLog.log(info, " ID 0x%02x", fi.fi_amss.amss_service_id); + for (const auto& f : fi.fi_amss.frequencies) { + etiLog.level(info) << " " << f; + } + break; } } } |