summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-14 15:51:02 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-14 16:11:43 +0100
commit35670b8021a6f8c3a2ab742aecb5ef41bc1c73d2 (patch)
treebd6f93056b4d28f14b0413fb3b94362e12f322c5
parentd6923be4bd2e198b4cba161e8040072128bd392c (diff)
downloaddabmux-35670b8021a6f8c3a2ab742aecb5ef41bc1c73d2.tar.gz
dabmux-35670b8021a6f8c3a2ab742aecb5ef41bc1c73d2.tar.bz2
dabmux-35670b8021a6f8c3a2ab742aecb5ef41bc1c73d2.zip
correct RC mistakes
-rw-r--r--README2
-rw-r--r--doc/example.mux49
-rw-r--r--src/MuxElements.h4
-rw-r--r--src/ParserConfigfile.cpp2
-rw-r--r--src/RemoteControl.cpp15
-rw-r--r--src/dabInputZmq.h4
6 files changed, 47 insertions, 29 deletions
diff --git a/README b/README
index 99237c5..a917667 100644
--- a/README
+++ b/README
@@ -15,7 +15,7 @@ In addition to the features of CRC-DabMux, this fork contains:
- supports logging to syslog
- supports ZMQ input monitoring with munin tool
- supports a Telnet Remote Control for setting/getting parameters
- (this is, for now, not used yet)
+ (can change subchannel and component labels)
The src/ directory contains the source code of ODR-DabMux.
diff --git a/doc/example.mux b/doc/example.mux
index 8372a78..04bdddc 100644
--- a/doc/example.mux
+++ b/doc/example.mux
@@ -49,6 +49,10 @@ remotecontrol {
; some features export
; Set the port to 0 to disable the server
telnetport 12721
+
+ ; the remote control server makes use of the unique identifiers
+ ; for the subchannels, services and components. Make sure you
+ ; chose them so that you can identify them.
}
; Some ensemble parameters
@@ -62,19 +66,19 @@ ensemble {
; Definition of DAB services
services {
; Each service has it's own unique identifier, that is
- ; only used throughout the configuration file
- funk {
+ ; used throughout the configuration file and for the RC.
+ srv-fu {
label "Funk"
shortlabel "Fu"
pty 0
language 0
; also supports id
}
- luschtig {
+ srv-lu {
label "Luschtig"
; pty, language, shortlabel and id can be omitted, and will take default values
}
- rick {
+ srv-ri {
label "rick"
shortlabel "rick"
}
@@ -85,7 +89,7 @@ services {
; supported types are : audio, bridge, data, enhancedpacket,
; dabplus, dmb, packet, test
subchannels {
- funk {
+ sub-fu {
type audio
; example file input
inputfile "funk.mp2"
@@ -98,7 +102,7 @@ subchannels {
id 10
protection 5
}
- luschtig {
+ sub-lu {
type audio
inputfile "luschtig.mp2"
nonblock false
@@ -106,7 +110,7 @@ subchannels {
id 3
;protection 5
}
- rick {
+ sub-ri {
type dabplus
; example file input
;inputfile "rick.dabp"
@@ -120,7 +124,7 @@ subchannels {
protection 1
}
- rick2 {
+ sub-ri2 {
type dabplus
; for dabplus types, you can use the ZeroMQ input (if compiled in)
; with the following configuration:
@@ -134,9 +138,8 @@ subchannels {
; For now, each component links one service to one subchannel
components {
- ; the component unique identifiers are not used anywhere, but
- ; are useful to disambiguate different components.
- funky {
+ ; the component unique identifiers are used for the RC.
+ comp-fu {
; 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
@@ -144,8 +147,8 @@ components {
label funk
shortlabel fu
- service funk
- subchannel funk
+ service srv-fu
+ subchannel sub-fu
; for packet components, the fields
; "user application type in FIG 0/13 for packet mode"
@@ -155,25 +158,29 @@ components {
; are supported, with the same syntax as in the manpage
}
- luschtigy {
+ comp-lu {
+ ; labels are maximum 16 characters in length
label luschtig
+
+ ; a shortlabel is created by dropping some letters from the
+ ; label, max length 8
shortlabel lu
- service luschtig
- subchannel luschtig
+ service srv-lu
+ subchannel sub-lu
}
- ricky {
+ comp-ri {
label "rick"
shortlabel "rick"
- service rick
- subchannel rick
+ service srv-ri
+ subchannel sub-ri
}
}
; A list of outputs, in the format
-; unique_id "uri"
+; unique-id "uri"
outputs {
- foobar "fifo:///dev/stdout?type=raw"
+ stdout "fifo:///dev/stdout?type=raw"
; ZeroMQ output example
; zmq "zmq+tcp://*:8080"
diff --git a/src/MuxElements.h b/src/MuxElements.h
index 41037b5..711f3cf 100644
--- a/src/MuxElements.h
+++ b/src/MuxElements.h
@@ -168,7 +168,7 @@ class DabComponent : public RemoteControllable
{
public:
DabComponent(std::string uid) :
- RemoteControllable("Component " + uid)
+ RemoteControllable(uid)
{
RC_ADD_PARAMETER(label, "Label and shortlabel [label,short]");
}
@@ -205,7 +205,7 @@ class DabService : public RemoteControllable
{
public:
DabService(std::string uid) :
- RemoteControllable("Service " + uid)
+ RemoteControllable(uid)
{
RC_ADD_PARAMETER(label, "Label and shortlabel [label,short]");
}
diff --git a/src/ParserConfigfile.cpp b/src/ParserConfigfile.cpp
index d5dba9e..9f62bdd 100644
--- a/src/ParserConfigfile.cpp
+++ b/src/ParserConfigfile.cpp
@@ -380,6 +380,8 @@ void parse_configfile(string configuration_file,
DabComponent* component = new DabComponent(componentuid);
+ component->enrol_at(*rc);
+
component->serviceId = service->id;
component->subchId = subchannel->id;
component->SCIdS = SCIdS_per_service[service]++;
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp
index 3c1c24a..a075497 100644
--- a/src/RemoteControl.cpp
+++ b/src/RemoteControl.cpp
@@ -179,9 +179,18 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command)
}
}
else if (cmd[0] == "set") {
- if (cmd.size() == 4) {
+ if (cmd.size() >= 4) {
try {
- set_param_(cmd[1], cmd[2], cmd[3]);
+ stringstream new_param_value;
+ for (int i = 3; i < cmd.size(); i++) {
+ new_param_value << cmd[i];
+
+ if (i+1 < cmd.size()) {
+ new_param_value << " ";
+ }
+ }
+
+ set_param_(cmd[1], cmd[2], new_param_value.str());
reply(socket, "ok");
}
catch (ParameterError &e) {
@@ -193,7 +202,7 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command)
}
else
{
- reply(socket, "Incorrect parameters for command 'get'");
+ reply(socket, "Incorrect parameters for command 'set'");
}
}
else if (cmd[0] == "quit") {
diff --git a/src/dabInputZmq.h b/src/dabInputZmq.h
index e3d6153..cd8df6f 100644
--- a/src/dabInputZmq.h
+++ b/src/dabInputZmq.h
@@ -98,7 +98,7 @@ class DabInputZmqBase : public DabInputBase, public RemoteControllable {
class DabInputZmqMPEG : public DabInputZmqBase {
public:
DabInputZmqMPEG(const std::string name)
- : DabInputZmqBase("MPEG " + name) {
+ : DabInputZmqBase(name) {
RC_ADD_PARAMETER(buffer,
"Size of the input buffer [mpeg frames]");
}
@@ -110,7 +110,7 @@ class DabInputZmqMPEG : public DabInputZmqBase {
class DabInputZmqAAC : public DabInputZmqBase {
public:
DabInputZmqAAC(const std::string name)
- : DabInputZmqBase("AAC+ " + name) {
+ : DabInputZmqBase(name) {
RC_ADD_PARAMETER(buffer,
"Size of the input buffer [aac superframes]");
}