diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-30 12:22:22 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-09-30 12:22:22 +0200 |
commit | 72374f4ba67a8330d197bc3c91dc6a44fa16a69c (patch) | |
tree | e3881e588cd5b8d4af1ba32afb0b80f61225bb75 | |
parent | 2e3d29936f70c3c8183a4e2dcb0f967b73de2ec0 (diff) | |
download | dabmux-72374f4ba67a8330d197bc3c91dc6a44fa16a69c.tar.gz dabmux-72374f4ba67a8330d197bc3c91dc6a44fa16a69c.tar.bz2 dabmux-72374f4ba67a8330d197bc3c91dc6a44fa16a69c.zip |
Print linking info on startup
-rw-r--r-- | doc/servicelinking.mux | 2 | ||||
-rw-r--r-- | src/ConfigParser.cpp | 4 | ||||
-rw-r--r-- | src/MuxElements.cpp | 17 | ||||
-rw-r--r-- | src/MuxElements.h | 13 | ||||
-rw-r--r-- | src/utils.cpp | 37 |
5 files changed, 53 insertions, 20 deletions
diff --git a/doc/servicelinking.mux b/doc/servicelinking.mux index 7012fef..7fd90ba 100644 --- a/doc/servicelinking.mux +++ b/doc/servicelinking.mux @@ -110,7 +110,7 @@ subchannels { } sub-ri { type dabplus - inputfile "tcp://*:9000" + inputfile "tcp://*:9001" bitrate 96 id 2 protection 3 diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index af43421..2ca83d3 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -177,7 +177,8 @@ void parse_linkage(boost::property_tree::ptree& pt, } auto linkageset = make_shared<LinkageSet>(setuid, lsn, hard, international); - linkageset->set_active(active); + linkageset->active = active; + linkageset->keyservice = service_uid; // TODO check if it exists auto pt_list = pt_set.get_child_optional("list"); if (not pt_list) { @@ -224,6 +225,7 @@ void parse_linkage(boost::property_tree::ptree& pt, linkageset->id_list.push_back(link); } + ensemble->linkagesets.push_back(linkageset); } } } diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 60f49be..656e294 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -664,25 +664,20 @@ unsigned short DabSubchannel::getSizeDWord(void) const LinkageSet::LinkageSet(string name, uint16_t lsn, bool hard, bool international) : RemoteControllable(name), - m_lsn(lsn), - m_active(false), - m_hard(hard), - m_international(international) + lsn(lsn), + active(false), + hard(hard), + international(international) { RC_ADD_PARAMETER(active, "Activate this linkage set [0 or 1]"); } -void LinkageSet::set_active(bool active) -{ - m_active = active; -} - void LinkageSet::set_parameter(const string& parameter, const string& value) { if (parameter == "active") { stringstream ss; ss << value; - ss >> m_active; + ss >> active; } else { stringstream ss; @@ -696,7 +691,7 @@ const string LinkageSet::get_parameter(const string& parameter) const { stringstream ss; if (parameter == "active") { - ss << m_active; + ss << active; } else { ss << "Parameter '" << parameter << diff --git a/src/MuxElements.h b/src/MuxElements.h index 93c291f..8285e61 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -439,23 +439,22 @@ struct ServiceLink { class LinkageSet : public RemoteControllable { public: LinkageSet(std::string name, uint16_t lsn, bool hard, bool international); - void set_active(bool active); std::list<ServiceLink> id_list; - private: /* Linkage Set Number is a 12-bit number that identifies the linkage * set in a country (requires coordination between multiplex operators * in a country) */ - uint16_t m_lsn; + uint16_t lsn; - bool m_active; // Remote-controllable - bool m_hard; - bool m_international; + bool active; // Remote-controllable + bool hard; + bool international; - DabService *m_keyservice; + std::string keyservice; + private: /* Remote control */ virtual void set_parameter(const std::string& parameter, const std::string& value); diff --git a/src/utils.cpp b/src/utils.cpp index 98ec22d..5b48f21 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -551,6 +551,41 @@ void printSubchannels(vector<DabSubchannel*>& subchannels) } } +static void printLinking(const shared_ptr<dabEnsemble> ensemble) +{ + etiLog.log(info, " Linkage Sets"); + for (const auto& linkageset : ensemble->linkagesets) { + etiLog.level(info) << " set " << linkageset->get_rc_name(); + etiLog.log(info, " LSN 0x%04x", linkageset->lsn); + etiLog.level(info) << " active " << (linkageset->active ? "true" : "false"); + etiLog.level(info) << " " << (linkageset->hard ? "hard" : "soft"); + etiLog.level(info) << " international " << (linkageset->international ? "true" : "false"); + etiLog.level(info) << " key service " << linkageset->keyservice; + + etiLog.level(info) << " ID list"; + for (const auto& link : linkageset->id_list) { + switch (link.type) { + case ServiceLinkType::DAB: + etiLog.level(info) << " type DAB"; + break; + case ServiceLinkType::FM: + etiLog.level(info) << " type FM"; + break; + case ServiceLinkType::DRM: + etiLog.level(info) << " type DRM"; + break; + case ServiceLinkType::AMSS: + etiLog.level(info) << " type AMSS"; + break; + } + etiLog.log(info, " id 0x%04x", link.id); + if (linkageset->international) { + etiLog.log(info, " ecc 0x%04x", link.ecc); + } + } + } +} + void printEnsemble(const shared_ptr<dabEnsemble> ensemble) { etiLog.log(info, "Ensemble"); @@ -583,5 +618,7 @@ void printEnsemble(const shared_ptr<dabEnsemble> ensemble) etiLog.level(info) << cluster->tostring(); } } + + printLinking(ensemble); } |