DVBConfigParser.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Socket_Protocols_DVB_DVBConfigParser_
18 #define HH_SENF_Socket_Protocols_DVB_DVBConfigParser_ 1
19 
20 #include <string>
21 #include <map>
22 #include <fstream>
23 #include <boost/tokenizer.hpp>
24 #include <linux/dvb/frontend.h>
25 
26 namespace senf {
27 
29  {
30  struct DVBParams {
31  std::map<std::string, fe_spectral_inversion_t> inversion;
32  std::map<std::string, fe_bandwidth_t> bandwidth;
33  std::map<std::string, fe_code_rate_t> code_rate;
34  std::map<std::string, fe_guard_interval_t> guard_interval;
35  std::map<std::string, fe_hierarchy_t> hierarchy;
36  std::map<std::string, fe_modulation_t> modulation;
37  std::map<std::string, fe_transmit_mode_t> transmit_mode;
38  DVBParams();
39  };
40  static const DVBParams params;
41  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
42 
43  public:
44  DVBConfigParser(fe_type_t type_, const std::string & configFilePath = "");
46 
47  std::string getConfigLine(std::string channel);
48 
49  dvb_frontend_parameters getFrontendParam(std::string configLine);
50 
51  private:
52  fe_type_t type;
53  std::string configFilePath;
54  std::ifstream configFile;
55  void initConfigFile(std::string _configFilePath);
56 
57  dvb_frontend_parameters getFrontendParamDVB_T( const tokenizer & tokens);
58  dvb_frontend_parameters getFrontendParamDVB_C( const tokenizer & tokens);
59  dvb_frontend_parameters getFrontendParamDVB_S( const tokenizer & tokens);
60 
61  };
62 }
63 
64 #endif
u8 type
DVBConfigParser(fe_type_t type_, const std::string &configFilePath="")
dvb_frontend_parameters getFrontendParam(std::string configLine)
std::string getConfigLine(std::string channel)