From 9a510ee0e34eebe79c5626b66e7493191b555cef Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 25 Dec 2014 17:38:49 +0100 Subject: Add datagroup option to config file --- doc/example.mux | 7 +++++-- src/ParserConfigfile.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/example.mux b/doc/example.mux index 2b0134e..e64636c 100644 --- a/doc/example.mux +++ b/doc/example.mux @@ -220,9 +220,12 @@ components { ; for packet components, the fields ; "user application type in FIG 0/13 for packet mode" ;figtype - ; and "packet address (default: 0x200 + (512))" + ; "packet address (default: 0x200 + (512))" ;address - ; are supported, with the same syntax as in the manpage + ; are supported, with the same syntax as in the manpage. + ; The -d option on the command line is: + ;datagroup (true|false) + ; and defaults to false. } comp-lu { diff --git a/src/ParserConfigfile.cpp b/src/ParserConfigfile.cpp index 2ae6555..1a954d7 100644 --- a/src/ParserConfigfile.cpp +++ b/src/ParserConfigfile.cpp @@ -400,6 +400,7 @@ void parse_configfile(string configuration_file, int figType = hexparse(pt_comp.get("figtype", "-1")); int packet_address = hexparse(pt_comp.get("address", "-1")); + int packet_datagroup = pt_comp.get("datagroup", false); uint8_t component_type = hexparse(pt_comp.get("type", "0")); DabComponent* component = new DabComponent(componentuid); @@ -475,6 +476,16 @@ void parse_configfile(string configuration_file, component->packet.address = packet_address; } + if (packet_datagroup) { + if (! component->isPacketComponent(ensemble->subchannels)) { + stringstream ss; + ss << "Component with uid " << componentuid << + " is not packet, cannot have datagroup enabled !"; + throw runtime_error(ss.str()); + } + + component->packet.datagroup = packet_datagroup; + } ensemble->components.push_back(component); -- cgit v1.2.3