diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-11-27 11:53:42 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-11-27 11:53:42 +0100 |
commit | c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa (patch) | |
tree | 879979c2fa841d213236f381e66ce794af3d2973 /src/MuxElements.cpp | |
parent | 79523abe80b3a6e00feacb0cdc378f357b918bbf (diff) | |
download | dabmux-c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa.tar.gz dabmux-c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa.tar.bz2 dabmux-c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa.zip |
Add PTy to RC
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(); |