Make AckTime adjustable
This commit is contained in:
parent
348e682610
commit
f0fc7c7ec9
8
Conf.cpp
8
Conf.cpp
|
@ -101,6 +101,7 @@ m_dstarModule("C"),
|
|||
m_dstarSelfOnly(false),
|
||||
m_dstarBlackList(),
|
||||
m_dstarAckReply(true),
|
||||
m_dstarAckTime(1000U),
|
||||
m_dstarErrorReply(true),
|
||||
m_dmrEnabled(false),
|
||||
m_dmrBeacons(false),
|
||||
|
@ -376,6 +377,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) {
|
||||
|
@ -813,6 +816,11 @@ bool CConf::getDStarAckReply() const
|
|||
return m_dstarAckReply;
|
||||
}
|
||||
|
||||
unsigned int CConf::getDStarAckTime() const
|
||||
{
|
||||
return m_dstarAckTime;
|
||||
}
|
||||
|
||||
bool CConf::getDStarErrorReply() const
|
||||
{
|
||||
return m_dstarErrorReply;
|
||||
|
|
2
Conf.h
2
Conf.h
|
@ -92,6 +92,7 @@ public:
|
|||
bool getDStarSelfOnly() const;
|
||||
std::vector<std::string> getDStarBlackList() const;
|
||||
bool getDStarAckReply() const;
|
||||
unsigned int getDStarAckTime() const;
|
||||
bool getDStarErrorReply() const;
|
||||
|
||||
// The DMR section
|
||||
|
@ -246,6 +247,7 @@ private:
|
|||
bool m_dstarSelfOnly;
|
||||
std::vector<std::string> m_dstarBlackList;
|
||||
bool m_dstarAckReply;
|
||||
unsigned int m_dstarAckTime;
|
||||
bool m_dstarErrorReply;
|
||||
|
||||
bool m_dmrEnabled;
|
||||
|
|
|
@ -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<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_gateway(NULL),
|
||||
m_selfOnly(selfOnly),
|
||||
|
@ -59,7 +59,7 @@ m_networkWatchdog(1000U, 0U, 1500U),
|
|||
m_rfTimeoutTimer(1000U, timeout),
|
||||
m_netTimeoutTimer(1000U, timeout),
|
||||
m_packetTimer(1000U, 0U, 300U),
|
||||
m_ackTimer(1000U, 0U, 750U),
|
||||
m_ackTimer(ackTime, 0U, 750U),
|
||||
m_errTimer(1000U, 0U, 750U),
|
||||
m_interval(),
|
||||
m_elapsed(),
|
||||
|
|
|
@ -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<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();
|
||||
|
||||
bool writeModem(unsigned char* data, unsigned int len);
|
||||
|
|
|
@ -64,6 +64,7 @@ Enable=1
|
|||
Module=C
|
||||
SelfOnly=0
|
||||
AckReply=1
|
||||
AckTime=1000
|
||||
ErrorReply=1
|
||||
|
||||
[DMR]
|
||||
|
|
|
@ -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<std::string> 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;
|
||||
|
|
Loading…
Reference in a new issue