diff options
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r-- | src/MuxElements.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index be0906e..adc6a60 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -404,6 +404,19 @@ void DabService::set_parameter(const string& parameter, throw ParameterError(ss.str()); } } + else if (parameter == "pty") { + int newpty = std::stoi(value); // International code, 5 bits + + if (newpty >= 0 and newpty < (1<<5)) { + pty = newpty; + } + else { + stringstream ss; + ss << m_name << " pty is out of bounds"; + etiLog.level(warn) << ss.str(); + throw ParameterError(ss.str()); + } + } else { stringstream ss; ss << "Parameter '" << parameter << @@ -418,6 +431,9 @@ const string DabService::get_parameter(const string& parameter) const if (parameter == "label") { ss << label.long_label() << "," << label.short_label(); } + else if (parameter == "pty") { + ss << (int)pty; + } else { ss << "Parameter '" << parameter << "' is not exported by controllable " << get_rc_name(); |