From: atx23 Date: Wed, 7 Jan 2009 10:32:05 +0000 (+0000) Subject: Added documentation and removed "find file bug" in configparser X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=5ecf55a6f934911cb3a6ccdd7e62b7a307c7e7a0;p=senf.git Added documentation and removed "find file bug" in configparser git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1040 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/Protocols/DVB/DVBConfigParser.cc b/Socket/Protocols/DVB/DVBConfigParser.cc index 23a88ee..fa57d9f 100644 --- a/Socket/Protocols/DVB/DVBConfigParser.cc +++ b/Socket/Protocols/DVB/DVBConfigParser.cc @@ -82,6 +82,7 @@ prefix_ void senf::DVBConfigParser::initConfigFile(string configFilePath_){ } configFilePath_ = configPath; } + configFilePath = configFilePath_; configFile.open( configFilePath.c_str(), ios_base::in); if(configFile.bad()) SENF_LOG((senf::log::IMPORTANT) ("Could not open channels file"<< configFilePath << "." )); @@ -97,7 +98,6 @@ prefix_ string senf::DVBConfigParser::getConfigLine(string channel) if(configFile.bad()) SENF_THROW_SYSTEM_EXCEPTION("Could not read channels file: ") << configFilePath << "."; - configFile.seekg(0); while (configFile.good()){ getline( configFile, configLine ); SENF_LOG((senf::log::NOTICE) ("configLine: " << configLine )); diff --git a/Socket/Protocols/DVB/DVBSocketController.cc b/Socket/Protocols/DVB/DVBSocketController.cc index 85b5222..942f153 100644 --- a/Socket/Protocols/DVB/DVBSocketController.cc +++ b/Socket/Protocols/DVB/DVBSocketController.cc @@ -79,7 +79,7 @@ prefix_ void senf::DVBSocketController::tuneToCMD(const string & input, const st } 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: @@ -336,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; } @@ -423,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) diff --git a/Socket/Protocols/DVB/DVBSocketController.hh b/Socket/Protocols/DVB/DVBSocketController.hh index 6e731df..26ecd6b 100644 --- a/Socket/Protocols/DVB/DVBSocketController.hh +++ b/Socket/Protocols/DVB/DVBSocketController.hh @@ -42,7 +42,11 @@ namespace senf { * synchronous, which means e.g. "tuneTo_sync" will return when the tuning operation on the card succeed, * no matter how long it takes. The second (preferred) method is to tune asynchronous. The call "tuneTo" will return * immediately and (if a callback was set) call the callback when the tuning operation succeeds. - * + *

+ * Note that you may have to take draw backs in using this API. This dues to the implementation of the DVB device driver which you or your kernel choose. + * It has shown that the completeness of implementations vary from driver to driver. + * This wrapper provides the full Frontend API which is defined by Convergence . + * You have to find out which parts of these functionality are implemented by your preferred device driver by your own. */ class DVBSocketController : boost::noncopyable { @@ -56,12 +60,12 @@ public: ~DVBSocketController(); void tuneToCMD( const std::string & input, const std::string & mode = "async");///< Tunes a DVB device given by the type of the DVBFrontendHandle - /**< Tunes a DVB device by a channel name or complete configuration line. + /**< Tunes a DVB device by a channel name or complete configuration line. This method was created for use in Senf-Console. \param[in] input A channel name or a complete configuration line. If a channel name is given it would be searched in the config file. \param[in] mode The mode in which it will tune "sync" or "async"*/ void tuneTo(const std::string & channel); - ///< Tunes a DVB device given by the type of the DVBFrontendHandle - /**< Tunes a DVB device, given by the type of the DVBFrontendHandle, by a channel name in asynchronous mode + ///< Tunes a DVB device to a channel + /**< Tunes a DVB device to a channel whose parameters are stored in a configfile. The method determines the type of DVB device by it self. \param[in] channel A channel name which will be looked up in config file.*/ void tuneDVB_S(unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate); @@ -85,11 +89,21 @@ public: dvb_frontend_event tuneTo_sync( const std::string & channel ); ///< Tunes a DVB device given by the type of the DVBFrontendHandle /**< Tunes a DVB device, given by the type of the DVBFrontendHandle, by a channel name in synchronous mode - \param[in] channel A channel name which will be looked up in config file.*/ + \param[in] channel A channel name which will be looked up in config file. + \returns dvb_frontend_event + \note The member "dvb_frontend_event.status" should be correct by the + most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitly not set by: + Cinergy T² (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27) + */ dvb_frontend_event tuneDVB_S_sync(unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate); ///< Tunes a DVB-S device - /**< Tunes a DVB-S device in synchronous mode. Needs full configuration */ + /**< Tunes a DVB-S device in synchronous mode. Needs full configuration + \returns dvb_frontend_event + \note The member "dvb_frontend_event.status" should be correct by the + most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitly not set by: + Cinergy T² (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27) + */ dvb_frontend_event tuneDVB_T_sync(unsigned int frequency, fe_spectral_inversion_t inversion, fe_bandwidth_t bandwidth, fe_code_rate_t code_rate_HP, /* high priority stream code rate */ @@ -99,13 +113,22 @@ public: fe_guard_interval_t guard_interval, fe_hierarchy_t hierarsourcechy_information); ///< Tunes a DVB-T device - /**< Tunes a DVB-T device in synchronous mode. Needs full configuration */ + /**< Tunes a DVB-T device in synchronous mode. Needs full configuration + \returns dvb_frontend_event + \note The member "dvb_frontend_event.status" should be correct by the + most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitly not set by: + Cinergy T² (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27) + */ dvb_frontend_event tuneDVB_C_sync(unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbol_rate, fe_code_rate_t fec_inner, fe_modulation_t modulation); ///< Tunes a DVB-C device - /**< Tunes a DVB-C device in synchronous mode. Needs full configuration */ - + /**< Tunes a DVB-C device in synchronous mode. Needs full configuration + \returns dvb_frontend_event + \note The member "dvb_frontend_event.status" should be correct by the + most device driver implementations. But "dvb_frontend_event.parameters" maybe not and is definitly not set by: + Cinergy T² (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27) + */ fe_type_t getType(); ///< Returns the type of the card. The type is defined in frontend.h std::string getTypeString(); ///< Returns the type of the card. @@ -117,7 +140,7 @@ public: unsigned int bitErrorRate(); ///< Returns the bit error rate /**< Returns the bit error rate. - \note This function may not be implemented by your specific driver implementation. In this case the output is random.*/ + \note This function may not be implemented by your specific driver implementation. In this case the output is random. This is true for: Cinergy T² (2.6.27), Terratec Cinergy DT USB XS Diversity (2.6.27)*/ unsigned int signalToNoiseRatio(); ///< Returns the signal to noise ratio /**< Returns the signal to noise ratio