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 | |
parent | 79523abe80b3a6e00feacb0cdc378f357b918bbf (diff) | |
download | dabmux-c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa.tar.gz dabmux-c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa.tar.bz2 dabmux-c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa.zip |
Add PTy to RC
-rw-r--r-- | src/DabMultiplexer.h | 12 | ||||
-rw-r--r-- | src/MuxElements.cpp | 16 | ||||
-rw-r--r-- | src/MuxElements.h | 1 | ||||
-rw-r--r-- | src/fig/FIG0.h | 1 |
4 files changed, 26 insertions, 4 deletions
diff --git a/src/DabMultiplexer.h b/src/DabMultiplexer.h index f454d20..bafefff 100644 --- a/src/DabMultiplexer.h +++ b/src/DabMultiplexer.h @@ -381,10 +381,14 @@ struct FIGtype0_17_programme { uint16_t SId; uint8_t NFC:2; uint8_t Rfa:2; - uint8_t CC:1; - uint8_t L:1; - uint8_t PS:1; - uint8_t SD:1; + uint8_t CC:1; // Complimentary code + uint8_t L:1; // Signals presence of language field + uint8_t PS:1; // Primary/Secondary + // PS==0: language refers to primary service component + // PS==1: language refers to secondary service component + uint8_t SD:1; // Static/Dynamic + // SD==0: PTy and language may not represent the current programme contents + // SD==1: PTy and language represent the current programme contents } PACKED; struct FIGtype0_18 { 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(); diff --git a/src/MuxElements.h b/src/MuxElements.h index 9fe2aeb..dc84ccb 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -338,6 +338,7 @@ class DabService : public RemoteControllable uid(uid) { RC_ADD_PARAMETER(label, "Label and shortlabel [label,short]"); + RC_ADD_PARAMETER(pty, "Programme Type"); } std::string uid; diff --git a/src/fig/FIG0.h b/src/fig/FIG0.h index e6101b5..2dc6483 100644 --- a/src/fig/FIG0.h +++ b/src/fig/FIG0.h @@ -183,6 +183,7 @@ class FIG0_13 : public IFIG }; // FIG type 0/17 +// Programme Type (PTy) class FIG0_17 : public IFIG { public: |