diff --git a/Conf.cpp b/Conf.cpp index 9050245..2e0b5c0 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -100,6 +100,7 @@ m_dstarEnabled(false), m_dstarModule("C"), m_dstarSelfOnly(false), m_dstarBlackList(), +m_dstarAckReply(true), m_dstarErrorReply(true), m_dmrEnabled(false), m_dmrBeacons(false), @@ -373,7 +374,9 @@ bool CConf::read() } p = ::strtok(NULL, ",\r\n"); } - } else if (::strcmp(key, "ErrorReply") == 0) + } else if (::strcmp(key, "AckReply") == 0) + m_dstarAckReply = ::atoi(value) == 1; + else if (::strcmp(key, "ErrorReply") == 0) m_dstarErrorReply = ::atoi(value) == 1; } else if (section == SECTION_DMR) { if (::strcmp(key, "Enable") == 0) @@ -805,6 +808,11 @@ std::vector CConf::getDStarBlackList() const return m_dstarBlackList; } +bool CConf::getDStarAckReply() const +{ + return m_dstarAckReply; +} + bool CConf::getDStarErrorReply() const { return m_dstarErrorReply; diff --git a/Conf.h b/Conf.h index a021573..53baaf5 100644 --- a/Conf.h +++ b/Conf.h @@ -91,6 +91,7 @@ public: std::string getDStarModule() const; bool getDStarSelfOnly() const; std::vector getDStarBlackList() const; + bool getDStarAckReply() const; bool getDStarErrorReply() const; // The DMR section @@ -244,6 +245,7 @@ private: std::string m_dstarModule; bool m_dstarSelfOnly; std::vector m_dstarBlackList; + bool m_dstarAckReply; bool m_dstarErrorReply; bool m_dmrEnabled; diff --git a/DStarControl.cpp b/DStarControl.cpp index 48713c1..fa73a7a 100644 --- a/DStarControl.cpp +++ b/DStarControl.cpp @@ -36,10 +36,11 @@ 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 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, 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), +m_ackReply(ackReply), m_errorReply(errorReply), m_blackList(blackList), m_network(network), @@ -523,7 +524,9 @@ void CDStarControl::writeEndRF() if (m_netState == RS_NET_IDLE) { m_display->clearDStar(); - m_ackTimer.start(); + + if (m_ackReply) + m_ackTimer.start(); if (m_network != NULL) m_network->reset(); diff --git a/DStarControl.h b/DStarControl.h index 84b4f3d..ddc67bd 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 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, 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); @@ -50,6 +50,7 @@ private: unsigned char* m_callsign; unsigned char* m_gateway; bool m_selfOnly; + bool m_ackReply; bool m_errorReply; std::vector m_blackList; CDStarNetwork* m_network; diff --git a/MMDVM.ini b/MMDVM.ini index 7003a3d..19dd30c 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -63,6 +63,7 @@ Port=/dev/ttyACM1 Enable=1 Module=C SelfOnly=0 +AckReply=1 ErrorReply=1 [DMR] diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 15aff8a..1046ffc 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -338,17 +338,19 @@ int CMMDVMHost::run() 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(); 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(" Error Reply: %s", errorReply ? "yes" : "no"); if (blackList.size() > 0U) LogInfo(" Black List: %u", blackList.size()); - dstar = new CDStarControl(m_callsign, module, selfOnly, errorReply, blackList, m_dstarNetwork, m_display, m_timeout, m_duplex, rssi); + dstar = new CDStarControl(m_callsign, module, selfOnly, ackReply, errorReply, blackList, m_dstarNetwork, m_display, m_timeout, m_duplex, rssi); } CDMRControl* dmr = NULL;