From 2330cc824c22f296075dbab35e7b5bcd02cf8c77 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Feb 2014 14:18:18 +0100 Subject: add figtype and address parameters for packet components --- doc/example.mux | 12 ++++++++++++ src/ParserConfigfile.cpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) 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 + (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("figtype", -1); + int packet_address = pt_comp.get("address", -1); + uint8_t component_type = pt_comp.get("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("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); } -- cgit v1.2.3