summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-07 14:18:18 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-07 14:18:18 +0100
commit2330cc824c22f296075dbab35e7b5bcd02cf8c77 (patch)
tree02147bd46bb1131e56aa20d409a85b6b9a7f379e
parent8a93130b066efd90f5b7d775cb1b5812e7677863 (diff)
downloaddabmux-2330cc824c22f296075dbab35e7b5bcd02cf8c77.tar.gz
dabmux-2330cc824c22f296075dbab35e7b5bcd02cf8c77.tar.bz2
dabmux-2330cc824c22f296075dbab35e7b5bcd02cf8c77.zip
add figtype and address parameters for packet components
-rw-r--r--doc/example.mux12
-rw-r--r--src/ParserConfigfile.cpp32
2 files changed, 44 insertions, 0 deletions
diff --git a/doc/example.mux b/doc/example.mux
index eed3c11..8e5fbb9 100644
--- a/doc/example.mux
+++ b/doc/example.mux
@@ -132,10 +132,22 @@ components {
; the component unique identifiers are not used anywhere, but
; are useful to disambiguate different components.
funky {
+ ; specifies audio -or- packet type, defaults to zero when not given
+ ; audio: foreground=0, background=1, multi-channel=2
+ ; data: unspecified=0, TMC=1, EWS=2, ITTS=3, paging=4, TDC=5, IP=59, MOT=60, proprietary=61
+ type 0
+
label funk
shortlabel fu
service funk
subchannel funk
+
+ ; for packet components, the fields
+ ; "user application type in FIG 0/13 for packet mode"
+ ;figtype
+ ; and "packet address (default: 0x200 + <n> (512))"
+ ;address
+ ; are supported, with the same syntax as in the manpage
}
luschtigy {
diff --git a/src/ParserConfigfile.cpp b/src/ParserConfigfile.cpp
index 947bd64..9468a32 100644
--- a/src/ParserConfigfile.cpp
+++ b/src/ParserConfigfile.cpp
@@ -349,6 +349,10 @@ void parse_configfile(string configuration_file,
throw runtime_error(ss.str());
}
+ int figType = pt_comp.get<int>("figtype", -1);
+ int packet_address = pt_comp.get<int>("address", -1);
+ uint8_t component_type = pt_comp.get<uint8_t>("type", 0);
+
dabComponent* component = new dabComponent();
memset(component, 0, sizeof(dabComponent));
@@ -357,6 +361,7 @@ void parse_configfile(string configuration_file,
component->serviceId = service->id;
component->subchId = subchannel->id;
component->SCIdS = SCIdS_per_service[service]++;
+ component->type = component_type;
try {
string label = pt_comp.get<string>("label");
@@ -379,6 +384,33 @@ void parse_configfile(string configuration_file,
"Component with uid %s has no short label.\n", componentuid.c_str());
}
+ if (figType != -1) {
+ if (! component->isPacketComponent(ensemble->subchannels)) {
+ stringstream ss;
+ ss << "Component with uid " << componentuid << " is not packet, cannot have figtype defined !";
+ throw runtime_error(ss.str());
+ }
+
+ if (figType >= (1<<12)) {
+ stringstream ss;
+ ss << "Component with uid " << componentuid << ": figtype '" << figType << "' is too large !";
+ throw runtime_error(ss.str());
+ }
+
+ component->packet.appType = figType;
+ }
+
+ if (packet_address != -1) {
+ if (! component->isPacketComponent(ensemble->subchannels)) {
+ stringstream ss;
+ ss << "Component with uid " << componentuid << " is not packet, cannot have address defined !";
+ throw runtime_error(ss.str());
+ }
+
+ component->packet.address = packet_address;
+ }
+
+
ensemble->components.push_back(component);
}