ITS
ParameterDENM.cpp
Go to the documentation of this file.
1 #include "ParameterDENM.h"
2 
4 {
5  read();
6  //readDebug();
7 }
8 
10 {
11  struct cfg_opt_t opts[] =
12  {
13 // CFG_INT("denmRequestPort", 5200, CFGF_NONE),
14 // CFG_STR("denmRequestAddress", "127.0.0.1", CFGF_NONE),
15 // CFG_INT("denmEventIndicationPort", 6200, CFGF_NONE),
16 // CFG_STR("denmEventIndicationAddress", "127.0.0.1", CFGF_NONE),
17  CFG_INT("mtAppDENMTrigger", 16, CFGF_NONE),
18  CFG_INT("mtAppDENMUpdate", 18, CFGF_NONE),
19  CFG_INT("mtAppDENMTermination", 20, CFGF_NONE),
20  CFG_INT("mtAppDENMResult", 22, CFGF_NONE),
21  CFG_BOOL("keepAliveForwarding", cfg_false, CFGF_NONE),
22 
23  CFG_END()
24  };
25 
26  cfg_t *cfg;
27 
28  cfg = cfg_init(opts, CFGF_NONE);
29 
30  cfg_add_searchpath(cfg, "/etc/its/config");
31  if(cfg_parse(cfg, "denm.conf") == CFG_PARSE_ERROR)
32  printf("PARSE_ERROR\n");
33 
34 // if((m_reqPort = cfg_getint(cfg, "denmRequestPort")) < 1024)
35 // m_reqPort = 5200;
36 
37 // m_reqAddress = QString(cfg_getstr(cfg, "denmRequestAddress"));
38 
39 // if((m_eventIndicationPort = cfg_getint(cfg, "denmEventIndicationPort")) < 1024)
40 // m_eventIndicationPort = 6200;
41 
42 // m_eventIndicationAddress = QString(cfg_getstr(cfg, "denmEventIndicationAddress"));
43 
44  m_mtAppDENMTrigger = cfg_getint(cfg, "mtAppDENMTrigger");
45  m_mtAppDENMUpdate = cfg_getint(cfg, "mtAppDENMUpdate");
46  m_mtAppDENMTermination = cfg_getint(cfg, "mtAppDENMTermination");
47  m_mtAppDENMResult = cfg_getint(cfg, "mtAppDENMResult");
48  m_kaf = cfg_getbool(cfg, "keepAliveForwarding");
49 
50  cfg_free(cfg);
51 }
52 
54 {
55  printf("-----------------------------------------------------------------\n\t\t\tReadDENM\n\n");
56 // printf("reqPort = %u\n\n", m_reqPort);
57 // printf("reqAddress = %s\n\n", m_reqAddress.toStdString().c_str());
58 // printf("eventIndicationPort = %u\n\n", m_eventIndicationPort);
59 // printf("eventIndicationAddress = %s\n\n", m_eventIndicationAddress.toStdString().c_str());
60  printf("mtAppDENMTrigger = %u\n\n", m_mtAppDENMTrigger);
61  printf("mtAppDENMUpdate = %u\n\n", m_mtAppDENMUpdate);
62  printf("mtAppDENMTermination = %u\n\n", m_mtAppDENMTermination);
63  printf("mtAppDENMResult = %u\n\n", m_mtAppDENMResult);
64  printf("keepAliveForwarding = %d\n\n", m_kaf);
65 }
66 
68 {
69 // this->m_mtAppDENMResult = other.m_mtAppDENMResult;
70 // this->m_mtAppDENMTermination = other.m_mtAppDENMTermination;
71 // this->m_mtAppDENMTrigger = other.m_mtAppDENMTrigger;
72 // this->m_mtAppDENMUpdate = other.m_mtAppDENMUpdate;
73 // this->m_reqPort = other.m_reqPort;
74 // this->m_reqAddress = other.m_reqAddress;
75 // this->m_eventIndicationPort = other.m_eventIndicationPort;
76  this->m_kaf = other.m_kaf;
77  return *this;
78 }
DENM configuration initializer.
void read()
read Configuration file reading.
void readDebug()
readDebug Configuration printing.
quint8 m_mtAppDENMUpdate
Definition: ParameterDENM.h:73
quint8 m_mtAppDENMResult
Definition: ParameterDENM.h:75
ParameterDENM & operator=(const ParameterDENM &other)
operator= ParameterDENM affectation operator.
quint8 m_mtAppDENMTrigger
Definition: ParameterDENM.h:72
quint8 m_mtAppDENMTermination
Definition: ParameterDENM.h:74
ParameterDENM()
ParameterDENM Default constructor.