diff --git a/DStarGateway/DStarGatewayApp.cpp b/DStarGateway/DStarGatewayApp.cpp index b29c2c0..940fc8f 100644 --- a/DStarGateway/DStarGatewayApp.cpp +++ b/DStarGateway/DStarGatewayApp.cpp @@ -240,6 +240,10 @@ bool CDStarGatewayApp::createThread() delete restrictList; } + // Drats + TDRats drats; + m_config->getDRats(drats); + // Setup the repeaters bool ddEnabled = false; bool atLeastOneRepeater = false; @@ -261,7 +265,7 @@ bool CDStarGatewayApp::createThread() rptrConfig.reflectorReconnect, rptrConfig.frequency, #ifdef USE_DRATS - true, + drats.enabled, #endif rptrConfig.offset, rptrConfig.range, diff --git a/DStarGateway/DStarGatewayConfig.cpp b/DStarGateway/DStarGatewayConfig.cpp index 9fd97c0..635a647 100644 --- a/DStarGateway/DStarGatewayConfig.cpp +++ b/DStarGateway/DStarGatewayConfig.cpp @@ -57,6 +57,9 @@ bool CDStarGatewayConfig::load() #endif ret = loadDaemon(cfg) && ret; ret = loadAccessControl(cfg) && ret; +#ifdef USE_DRATS + ret = loadDRats(cfg) && ret; +#endif } if(ret) { @@ -360,6 +363,15 @@ bool CDStarGatewayConfig::loadAccessControl(const CConfig & cfg) return ret; } +#ifdef USE_DRATS +bool CDStarGatewayConfig::loadDRats(const CConfig & cfg) +{ + bool ret = cfg.getValue("DRats", "enabled", m_drats.enabled, false); + + return ret; +} +#endif + bool CDStarGatewayConfig::open(CConfig & cfg) { try { @@ -465,4 +477,11 @@ void CDStarGatewayConfig::getDaemon(TDaemon & gen) const void CDStarGatewayConfig::getAccessControl(TAccessControl & accessControl) const { accessControl = m_accessControl; -} \ No newline at end of file +} + +#if USE_DRATS +void CDStarGatewayConfig::getDRats(TDRats & drats) const +{ + drats = m_drats; +} +#endif \ No newline at end of file diff --git a/DStarGateway/DStarGatewayConfig.h b/DStarGateway/DStarGatewayConfig.h index b39dd84..fdb5339 100644 --- a/DStarGateway/DStarGatewayConfig.h +++ b/DStarGateway/DStarGatewayConfig.h @@ -115,6 +115,12 @@ typedef struct { bool enabled; } TDCS; +#ifdef USE_DRATS +typedef struct { + bool enabled; +} TDRats; +#endif + typedef struct { bool enabled; std::string url; @@ -164,6 +170,9 @@ public: #endif void getDaemon(TDaemon & gen) const; void getAccessControl(TAccessControl & accessControl) const; +#ifdef USE_DRATS + void getDRats(TDRats & drats) const; +#endif private: bool open(CConfig & cfg); @@ -183,6 +192,9 @@ private: #endif bool loadDaemon(const CConfig & cfg); bool loadAccessControl(const CConfig & cfg); +#ifdef USE_DRATS + bool loadDRats(const CConfig & cfg); +#endif std::string m_fileName; TGateway m_gateway; @@ -199,6 +211,9 @@ private: #endif TDaemon m_daemon; TAccessControl m_accessControl; +#ifdef USE_DRATS + TDRats m_drats; +#endif std::vector m_repeaters; std::vector m_ircDDB; diff --git a/DStarGateway/example.cfg b/DStarGateway/example.cfg index 5d117bb..731da4e 100644 --- a/DStarGateway/example.cfg +++ b/DStarGateway/example.cfg @@ -172,6 +172,9 @@ enabled=true # There is no reason to disable this enabled=true hostfileUrl=http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster +[DRats] +enabled=false # Defaults to false. The program need to be compiled with DRats support for DRats to be actually enabled + [Remote] enabled=false port=4242