Added documentation and removed "find file bug" in configparser
[senf.git] / Socket / Protocols / DVB / DVBSocketController.cc
index 03981a0..942f153 100644 (file)
@@ -1,3 +1,26 @@
+// $Id$
+//
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+//     Anton Gillert <atx@berlios.de>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
 #include "senf/Utils/Exception.hh"
 #include "senf/Utils/Logger/Logger.hh"
 #include "senf/Utils/membind.hh"
@@ -24,20 +47,20 @@ senf::DVBSocketController::DVBSocketController(DVBFrontendHandle frontendHandle_
 prefix_ senf::DVBSocketController::~DVBSocketController()
 {
 }
-prefix_ void senf::DVBSocketController::tuneToCMD(const string & configLine, const string & mode){
+prefix_ void senf::DVBSocketController::tuneToCMD(const string & input, const string & mode){
     struct dvb_frontend_parameters frontend;
     
   
     // no valid configline, so it will be treaten like a channel name
-    if (configLine.find(":")==string::npos){
+    if (input.find(":")==string::npos){
         if (mode.c_str()[0]=='a')
-            tuneTo(configLine);
+            tuneTo(input);
         else
-            tuneTo_sync(configLine);
+            tuneTo_sync(input);
         return;
     }
-    // add psydo name to complete configline syntax
-    frontend = parser.getFrontendParam("foo:"+configLine);
+    // add psydo name "foo" to complete configline syntax
+    frontend = parser.getFrontendParam("foo:"+input);
     
     if (mode.c_str()[0]=='a'){
         switch (type) {
@@ -56,7 +79,7 @@ prefix_ void senf::DVBSocketController::tuneToCMD(const string & configLine, con
     }
     else {
         switch (type) {
-            case FE_QPSK: if (mode.c_str()[0]=='a')
+            case FE_QPSK:
                 tuneDVB_S_sync(frontend.frequency, frontend.inversion, frontend.u.qpsk.symbol_rate, frontend.u.qpsk.fec_inner);
                 break;
             case FE_QAM:
@@ -313,17 +336,17 @@ prefix_ string senf::DVBSocketController::status2String(fe_status_t status){
     if (status & FE_HAS_LOCK)
         return s += "HAS LOCK"; 
     if (status & FE_HAS_CARRIER)
-        s += "HAS CARRIER";
+        s += "HAS CARRIER ";
     if (status & FE_HAS_VITERBI)
-        s += "HAS VITERBI";
+        s += "HAS VITERBI ";
     if (status & FE_HAS_SYNC)
-        s += "HAS SYNC";
+        s += "HAS SYNC ";
     if (status & FE_HAS_SIGNAL)
-        s += "HAS SIGNAL";
+        s += "HAS SIGNAL ";
     if (status & FE_TIMEDOUT)
-        s += "TIMED OUT";
+        s += "TIMED OUT ";
     if (status & FE_REINIT)
-        s += "REINIT";
+        s += "REINIT ";
 
     return s;
 }
@@ -400,11 +423,11 @@ prefix_ void senf::DVBSocketController::initConsole(){
     
     dir.add("filter", &DVBSocketController::setSectionFilter)
         .arg("pid", "pid to filter")
-        .arg("filter", "filter", kw::default_value = 62)
-        .arg("flags", "or-able: DMX_CHECK_CRC(0x01), DMX_ONESHOT(0x02), DMX_IMMEDIATE_START(0x04), DMX_KERNEL_CLIENT(0x8000)", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC)
-        .arg("mask", "mask", kw::default_value = 0xff)
-        .arg("mode", "mode", kw::default_value = 0)
-        .arg("timeout", "timeout", kw::default_value = 0)
+        .arg("filter", "filter", kw::default_value = 62, kw::default_doc   = "0x3e")
+        .arg("flags", "or-able: DMX_CHECK_CRC(0x01), DMX_ONESHOT(0x02), DMX_IMMEDIATE_START(0x04), DMX_KERNEL_CLIENT(0x8000)", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc   = "0x05")
+        .arg("mask", "mask", kw::default_value = 0xff, kw::default_doc   = "0xff")
+        .arg("mode", "mode", kw::default_value = 0, kw::default_doc   = "0x00")
+        .arg("timeout", "timeout", kw::default_value = 0, kw::default_doc   = "0x00")
         .doc("Sets parameters for section filter.");
        
     dir.add("stop", &DVBSocketController::setBufferSize)