diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-08-15 13:42:23 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-08-15 14:00:48 +0200 |
commit | d20b9a0c8f90fbc373dbd5757b5c6a03bbfd8c83 (patch) | |
tree | b32dc3a732377b2d094145d929bf39b44ee4366c /src/MuxElements.cpp | |
parent | 55a66f6408042abfd102f92fd0072a000d8e0235 (diff) | |
download | dabmux-d20b9a0c8f90fbc373dbd5757b5c6a03bbfd8c83.tar.gz dabmux-d20b9a0c8f90fbc373dbd5757b5c6a03bbfd8c83.tar.bz2 dabmux-d20b9a0c8f90fbc373dbd5757b5c6a03bbfd8c83.zip |
Add FIG0/19
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r-- | src/MuxElements.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 2f45651..452e179 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -3,7 +3,7 @@ 2011, 2012 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2014 + Copyright (C) 2014, 2015 Matthias P. Braendli, matthias.braendli@mpb.li */ /* @@ -28,6 +28,7 @@ #include "MuxElements.h" #include <boost/algorithm/string.hpp> +#include <boost/format.hpp> const unsigned short Sub_Channel_SizeTable[64] = { 16, 21, 24, 29, 35, 24, 29, 35, @@ -44,6 +45,50 @@ const unsigned short Sub_Channel_SizeTable[64] = { using namespace std; +std::string AnnouncementCluster::tostring() const +{ + stringstream ss; + ss << " cluster id : " << (int)cluster_id; + ss << " flags : 0x" << boost::format("%04x") % flags; + ss << " subchannel : " << subchanneluid; + if (m_active) { + ss << " *"; + } + + return ss.str(); +} + +void AnnouncementCluster::set_parameter(const string& parameter, + const string& value) +{ + if (parameter == "active") { + stringstream ss; + ss << value; + ss >> m_active; + } + else { + stringstream ss; + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } +} + +const string AnnouncementCluster::get_parameter(const string& parameter) const +{ + stringstream ss; + if (parameter == "active") { + ss << m_active; + } + else { + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } + return ss.str(); +} + + int DabLabel::setLabel(const std::string& label) { size_t len = label.length(); |