mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
Make the D-Star ack optional.
This commit is contained in:
10
Conf.cpp
10
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<std::string> CConf::getDStarBlackList() const
|
||||
return m_dstarBlackList;
|
||||
}
|
||||
|
||||
bool CConf::getDStarAckReply() const
|
||||
{
|
||||
return m_dstarAckReply;
|
||||
}
|
||||
|
||||
bool CConf::getDStarErrorReply() const
|
||||
{
|
||||
return m_dstarErrorReply;
|
||||
|
||||
2
Conf.h
2
Conf.h
@@ -91,6 +91,7 @@ public:
|
||||
std::string getDStarModule() const;
|
||||
bool getDStarSelfOnly() const;
|
||||
std::vector<std::string> 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<std::string> m_dstarBlackList;
|
||||
bool m_dstarAckReply;
|
||||
bool m_dstarErrorReply;
|
||||
|
||||
bool m_dmrEnabled;
|
||||
|
||||
@@ -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<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, 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),
|
||||
m_ackReply(ackReply),
|
||||
m_errorReply(errorReply),
|
||||
m_blackList(blackList),
|
||||
m_network(network),
|
||||
@@ -523,6 +524,8 @@ void CDStarControl::writeEndRF()
|
||||
|
||||
if (m_netState == RS_NET_IDLE) {
|
||||
m_display->clearDStar();
|
||||
|
||||
if (m_ackReply)
|
||||
m_ackTimer.start();
|
||||
|
||||
if (m_network != NULL)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class CDStarControl {
|
||||
public:
|
||||
CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, 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, 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);
|
||||
@@ -50,6 +50,7 @@ private:
|
||||
unsigned char* m_callsign;
|
||||
unsigned char* m_gateway;
|
||||
bool m_selfOnly;
|
||||
bool m_ackReply;
|
||||
bool m_errorReply;
|
||||
std::vector<std::string> m_blackList;
|
||||
CDStarNetwork* m_network;
|
||||
|
||||
@@ -63,6 +63,7 @@ Port=/dev/ttyACM1
|
||||
Enable=1
|
||||
Module=C
|
||||
SelfOnly=0
|
||||
AckReply=1
|
||||
ErrorReply=1
|
||||
|
||||
[DMR]
|
||||
|
||||
@@ -338,17 +338,19 @@ int CMMDVMHost::run()
|
||||
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();
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user