summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-12-25 17:38:49 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-12-25 17:38:49 +0100
commit9a510ee0e34eebe79c5626b66e7493191b555cef (patch)
tree6324abda0c39fd3dad42b22e1ebb7dfbc7905d20
parent86a0a6d93e336655b5419b233a374a5fe7161e1f (diff)
downloaddabmux-9a510ee0e34eebe79c5626b66e7493191b555cef.tar.gz
dabmux-9a510ee0e34eebe79c5626b66e7493191b555cef.tar.bz2
dabmux-9a510ee0e34eebe79c5626b66e7493191b555cef.zip
Add datagroup option to config file
-rw-r--r--doc/example.mux7
-rw-r--r--src/ParserConfigfile.cpp11
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 + <n> (512))"
+ ; "packet address (default: 0x200 + <n> (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);