mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 06:55:52 +08:00
Make AckTime adjustable
This commit is contained in:
8
Conf.cpp
8
Conf.cpp
@@ -101,6 +101,7 @@ m_dstarModule("C"),
|
|||||||
m_dstarSelfOnly(false),
|
m_dstarSelfOnly(false),
|
||||||
m_dstarBlackList(),
|
m_dstarBlackList(),
|
||||||
m_dstarAckReply(true),
|
m_dstarAckReply(true),
|
||||||
|
m_dstarAckTime(1000U),
|
||||||
m_dstarErrorReply(true),
|
m_dstarErrorReply(true),
|
||||||
m_dmrEnabled(false),
|
m_dmrEnabled(false),
|
||||||
m_dmrBeacons(false),
|
m_dmrBeacons(false),
|
||||||
@@ -376,6 +377,8 @@ bool CConf::read()
|
|||||||
}
|
}
|
||||||
} else if (::strcmp(key, "AckReply") == 0)
|
} else if (::strcmp(key, "AckReply") == 0)
|
||||||
m_dstarAckReply = ::atoi(value) == 1;
|
m_dstarAckReply = ::atoi(value) == 1;
|
||||||
|
else if (::strcmp(key, "AckTime") == 0)
|
||||||
|
m_dstarAckTime = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "ErrorReply") == 0)
|
else if (::strcmp(key, "ErrorReply") == 0)
|
||||||
m_dstarErrorReply = ::atoi(value) == 1;
|
m_dstarErrorReply = ::atoi(value) == 1;
|
||||||
} else if (section == SECTION_DMR) {
|
} else if (section == SECTION_DMR) {
|
||||||
@@ -813,6 +816,11 @@ bool CConf::getDStarAckReply() const
|
|||||||
return m_dstarAckReply;
|
return m_dstarAckReply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int CConf::getDStarAckTime() const
|
||||||
|
{
|
||||||
|
return m_dstarAckTime;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getDStarErrorReply() const
|
bool CConf::getDStarErrorReply() const
|
||||||
{
|
{
|
||||||
return m_dstarErrorReply;
|
return m_dstarErrorReply;
|
||||||
|
|||||||
2
Conf.h
2
Conf.h
@@ -92,6 +92,7 @@ public:
|
|||||||
bool getDStarSelfOnly() const;
|
bool getDStarSelfOnly() const;
|
||||||
std::vector<std::string> getDStarBlackList() const;
|
std::vector<std::string> getDStarBlackList() const;
|
||||||
bool getDStarAckReply() const;
|
bool getDStarAckReply() const;
|
||||||
|
unsigned int getDStarAckTime() const;
|
||||||
bool getDStarErrorReply() const;
|
bool getDStarErrorReply() const;
|
||||||
|
|
||||||
// The DMR section
|
// The DMR section
|
||||||
@@ -246,6 +247,7 @@ private:
|
|||||||
bool m_dstarSelfOnly;
|
bool m_dstarSelfOnly;
|
||||||
std::vector<std::string> m_dstarBlackList;
|
std::vector<std::string> m_dstarBlackList;
|
||||||
bool m_dstarAckReply;
|
bool m_dstarAckReply;
|
||||||
|
unsigned int m_dstarAckTime;
|
||||||
bool m_dstarErrorReply;
|
bool m_dstarErrorReply;
|
||||||
|
|
||||||
bool m_dmrEnabled;
|
bool m_dmrEnabled;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ bool CallsignCompare(const std::string& arg, const unsigned char* my)
|
|||||||
|
|
||||||
// #define DUMP_DSTAR
|
// #define DUMP_DSTAR
|
||||||
|
|
||||||
CDStarControl::CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, bool errorReply, const std::vector<std::string>& 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<std::string>& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper) :
|
||||||
m_callsign(NULL),
|
m_callsign(NULL),
|
||||||
m_gateway(NULL),
|
m_gateway(NULL),
|
||||||
m_selfOnly(selfOnly),
|
m_selfOnly(selfOnly),
|
||||||
@@ -59,7 +59,7 @@ m_networkWatchdog(1000U, 0U, 1500U),
|
|||||||
m_rfTimeoutTimer(1000U, timeout),
|
m_rfTimeoutTimer(1000U, timeout),
|
||||||
m_netTimeoutTimer(1000U, timeout),
|
m_netTimeoutTimer(1000U, timeout),
|
||||||
m_packetTimer(1000U, 0U, 300U),
|
m_packetTimer(1000U, 0U, 300U),
|
||||||
m_ackTimer(1000U, 0U, 750U),
|
m_ackTimer(ackTime, 0U, 750U),
|
||||||
m_errTimer(1000U, 0U, 750U),
|
m_errTimer(1000U, 0U, 750U),
|
||||||
m_interval(),
|
m_interval(),
|
||||||
m_elapsed(),
|
m_elapsed(),
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
class CDStarControl {
|
class CDStarControl {
|
||||||
public:
|
public:
|
||||||
CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, bool errorReply, const std::vector<std::string>& 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<std::string>& blackList, CDStarNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper);
|
||||||
~CDStarControl();
|
~CDStarControl();
|
||||||
|
|
||||||
bool writeModem(unsigned char* data, unsigned int len);
|
bool writeModem(unsigned char* data, unsigned int len);
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ Enable=1
|
|||||||
Module=C
|
Module=C
|
||||||
SelfOnly=0
|
SelfOnly=0
|
||||||
AckReply=1
|
AckReply=1
|
||||||
|
AckTime=1000
|
||||||
ErrorReply=1
|
ErrorReply=1
|
||||||
|
|
||||||
[DMR]
|
[DMR]
|
||||||
|
|||||||
@@ -335,22 +335,24 @@ int CMMDVMHost::run()
|
|||||||
|
|
||||||
CDStarControl* dstar = NULL;
|
CDStarControl* dstar = NULL;
|
||||||
if (m_dstarEnabled) {
|
if (m_dstarEnabled) {
|
||||||
std::string module = m_conf.getDStarModule();
|
std::string module = m_conf.getDStarModule();
|
||||||
bool selfOnly = m_conf.getDStarSelfOnly();
|
bool selfOnly = m_conf.getDStarSelfOnly();
|
||||||
std::vector<std::string> blackList = m_conf.getDStarBlackList();
|
std::vector<std::string> blackList = m_conf.getDStarBlackList();
|
||||||
bool ackReply = m_conf.getDStarAckReply();
|
bool ackReply = m_conf.getDStarAckReply();
|
||||||
bool errorReply = m_conf.getDStarErrorReply();
|
unsigned int ackTime = m_conf.getDStarAckTime();
|
||||||
|
bool errorReply = m_conf.getDStarErrorReply();
|
||||||
|
|
||||||
LogInfo("D-Star Parameters");
|
LogInfo("D-Star Parameters");
|
||||||
LogInfo(" Module: %s", module.c_str());
|
LogInfo(" Module: %s", module.c_str());
|
||||||
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
|
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
|
||||||
LogInfo(" Ack Reply: %s", ackReply ? "yes" : "no");
|
LogInfo(" Ack Reply: %s", ackReply ? "yes" : "no");
|
||||||
|
LogInfo(" Ack Time: %ums", ackTime);
|
||||||
LogInfo(" Error Reply: %s", errorReply ? "yes" : "no");
|
LogInfo(" Error Reply: %s", errorReply ? "yes" : "no");
|
||||||
|
|
||||||
if (blackList.size() > 0U)
|
if (blackList.size() > 0U)
|
||||||
LogInfo(" Black List: %u", blackList.size());
|
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;
|
CDMRControl* dmr = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user