diff --git a/Conf.cpp b/Conf.cpp index 42e02f4..075a392 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -103,6 +103,7 @@ m_dstarModule("C"), m_dstarSelfOnly(false), m_dstarBlackList(), m_dstarAckReply(true), +m_dstarAckTime(750U), m_dstarErrorReply(true), m_dmrEnabled(false), m_dmrBeacons(false), @@ -382,6 +383,8 @@ bool CConf::read() } } else if (::strcmp(key, "AckReply") == 0) m_dstarAckReply = ::atoi(value) == 1; + else if (::strcmp(key, "AckTime") == 0) + m_dstarAckTime = (unsigned int)::atoi(value); else if (::strcmp(key, "ErrorReply") == 0) m_dstarErrorReply = ::atoi(value) == 1; } else if (section == SECTION_DMR) { @@ -829,6 +832,11 @@ bool CConf::getDStarAckReply() const return m_dstarAckReply; } +unsigned int CConf::getDStarAckTime() const +{ + return m_dstarAckTime; +} + bool CConf::getDStarErrorReply() const { return m_dstarErrorReply; diff --git a/Conf.h b/Conf.h index f46bd3f..8845b52 100644 --- a/Conf.h +++ b/Conf.h @@ -94,6 +94,7 @@ public: bool getDStarSelfOnly() const; std::vector getDStarBlackList() const; bool getDStarAckReply() const; + unsigned int getDStarAckTime() const; bool getDStarErrorReply() const; // The DMR section @@ -250,6 +251,7 @@ private: bool m_dstarSelfOnly; std::vector m_dstarBlackList; bool m_dstarAckReply; + unsigned int m_dstarAckTime; bool m_dstarErrorReply; bool m_dmrEnabled; diff --git a/DStarControl.cpp b/DStarControl.cpp index fa73a7a..02abbde 100644 --- a/DStarControl.cpp +++ b/DStarControl.cpp @@ -36,7 +36,7 @@ bool CallsignCompare(const std::string& arg, const unsigned char* my) // #define DUMP_DSTAR -CDStarControl::CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, bool errorReply, const std::vector& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper) : +CDStarControl::CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, unsigned int ackTime, bool errorReply, const std::vector& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper) : m_callsign(NULL), m_gateway(NULL), m_selfOnly(selfOnly), @@ -59,8 +59,8 @@ m_networkWatchdog(1000U, 0U, 1500U), m_rfTimeoutTimer(1000U, timeout), m_netTimeoutTimer(1000U, timeout), m_packetTimer(1000U, 0U, 300U), -m_ackTimer(1000U, 0U, 750U), -m_errTimer(1000U, 0U, 750U), +m_ackTimer(1000U, 0U, ackTime), +m_errTimer(1000U, 0U, ackTime), m_interval(), m_elapsed(), m_rfFrames(0U), diff --git a/DStarControl.h b/DStarControl.h index ddc67bd..6f93336 100644 --- a/DStarControl.h +++ b/DStarControl.h @@ -37,7 +37,7 @@ class CDStarControl { public: - CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, bool errorReply, const std::vector& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper); + CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, unsigned int ackTime, bool errorReply, const std::vector& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper); ~CDStarControl(); bool writeModem(unsigned char* data, unsigned int len); diff --git a/MMDVM.ini b/MMDVM.ini index 968864a..3ab581d 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -66,6 +66,7 @@ Enable=1 Module=C SelfOnly=0 AckReply=1 +AckTime=750 ErrorReply=1 [DMR] diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index c3dd6f5..f1c4c45 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -335,22 +335,24 @@ int CMMDVMHost::run() CDStarControl* dstar = NULL; if (m_dstarEnabled) { - std::string module = m_conf.getDStarModule(); - bool selfOnly = m_conf.getDStarSelfOnly(); + std::string module = m_conf.getDStarModule(); + bool selfOnly = m_conf.getDStarSelfOnly(); std::vector blackList = m_conf.getDStarBlackList(); - bool ackReply = m_conf.getDStarAckReply(); - bool errorReply = m_conf.getDStarErrorReply(); + bool ackReply = m_conf.getDStarAckReply(); + unsigned int ackTime = m_conf.getDStarAckTime(); + bool errorReply = m_conf.getDStarErrorReply(); LogInfo("D-Star Parameters"); LogInfo(" Module: %s", module.c_str()); LogInfo(" Self Only: %s", selfOnly ? "yes" : "no"); LogInfo(" Ack Reply: %s", ackReply ? "yes" : "no"); + LogInfo(" Ack Time: %ums", ackTime); LogInfo(" Error Reply: %s", errorReply ? "yes" : "no"); if (blackList.size() > 0U) LogInfo(" Black List: %u", blackList.size()); - dstar = new CDStarControl(m_callsign, module, selfOnly, ackReply, errorReply, blackList, m_dstarNetwork, m_display, m_timeout, m_duplex, rssi); + dstar = new CDStarControl(m_callsign, module, selfOnly, ackReply, ackTime, errorReply, blackList, m_dstarNetwork, m_display, m_timeout, m_duplex, rssi); } CDMRControl* dmr = NULL;