From b84d4f382507d3eedee33d36927de5847d5456ad Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Mon, 8 Oct 2018 20:30:31 -0300 Subject: [PATCH] Enable YSF network debug for DMR2YSF --- DMR2YSF/Conf.cpp | 8 ++++++++ DMR2YSF/Conf.h | 6 ++++-- DMR2YSF/DMR2YSF.cpp | 3 ++- DMR2YSF/DMR2YSF.ini | 1 + DMR2YSF/Version.h | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DMR2YSF/Conf.cpp b/DMR2YSF/Conf.cpp index 7c49d39..1858a65 100644 --- a/DMR2YSF/Conf.cpp +++ b/DMR2YSF/Conf.cpp @@ -44,6 +44,7 @@ m_localAddress(), m_localPort(0U), m_fcsFile(), m_daemon(false), +m_debug(false), m_dmrId(0U), m_dmrRptAddress(), m_dmrRptPort(0U), @@ -129,6 +130,8 @@ bool CConf::read() m_fcsFile = value; else if (::strcmp(key, "Daemon") == 0) m_daemon = ::atoi(value) == 1; + else if (::strcmp(key, "Debug") == 0) + m_debug = ::atoi(value) == 1; } else if (section == SECTION_DMR_NETWORK) { if (::strcmp(key, "Id") == 0) m_dmrId = (unsigned int)::atoi(value); @@ -205,6 +208,11 @@ bool CConf::getDaemon() const return m_daemon; } +bool CConf::getDebug() const +{ + return m_debug; +} + unsigned int CConf::getDMRId() const { return m_dmrId; diff --git a/DMR2YSF/Conf.h b/DMR2YSF/Conf.h index 3dc879d..a41854e 100644 --- a/DMR2YSF/Conf.h +++ b/DMR2YSF/Conf.h @@ -39,7 +39,8 @@ public: unsigned int getLocalPort() const; std::string getFCSFile() const; bool getDaemon() const; - + bool getDebug() const; + // The DMR Network section unsigned int getDMRId() const; std::string getDMRRptAddress() const; @@ -70,7 +71,8 @@ private: unsigned int m_localPort; std::string m_fcsFile; bool m_daemon; - + bool m_debug; + unsigned int m_dmrId; std::string m_dmrRptAddress; unsigned int m_dmrRptPort; diff --git a/DMR2YSF/DMR2YSF.cpp b/DMR2YSF/DMR2YSF.cpp index f5232fd..ebec9ef 100644 --- a/DMR2YSF/DMR2YSF.cpp +++ b/DMR2YSF/DMR2YSF.cpp @@ -259,8 +259,9 @@ int CDMR2YSF::run() unsigned int dstPort = m_conf.getDstPort(); std::string localAddress = m_conf.getLocalAddress(); unsigned int localPort = m_conf.getLocalPort(); + unsigned int ysfdebug = m_conf.getDebug(); - m_ysfNetwork = new CYSFNetwork(localAddress, localPort, m_callsign, false); + m_ysfNetwork = new CYSFNetwork(localAddress, localPort, m_callsign, ysfdebug); m_ysfNetwork->setDestination(dstAddress, dstPort); ret = m_ysfNetwork->open(); diff --git a/DMR2YSF/DMR2YSF.ini b/DMR2YSF/DMR2YSF.ini index 5c718e6..7382bd6 100644 --- a/DMR2YSF/DMR2YSF.ini +++ b/DMR2YSF/DMR2YSF.ini @@ -6,6 +6,7 @@ LocalAddress=127.0.0.1 LocalPort=3200 FCSRooms=FCSRooms.txt Daemon=0 +Debug=0 [DMR Network] Id=1234567 diff --git a/DMR2YSF/Version.h b/DMR2YSF/Version.h index b6c4ff2..7c2d284 100644 --- a/DMR2YSF/Version.h +++ b/DMR2YSF/Version.h @@ -20,6 +20,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20180902"; +const char* VERSION = "20181008"; #endif