mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 22:45:44 +08:00
Add the YSF TX hang parameter.
This commit is contained in:
8
Conf.cpp
8
Conf.cpp
@@ -141,6 +141,7 @@ m_fusionEnabled(false),
|
|||||||
m_fusionLowDeviation(false),
|
m_fusionLowDeviation(false),
|
||||||
m_fusionRemoteGateway(false),
|
m_fusionRemoteGateway(false),
|
||||||
m_fusionSelfOnly(false),
|
m_fusionSelfOnly(false),
|
||||||
|
m_fusionTXHang(4U),
|
||||||
m_fusionSQLEnabled(false),
|
m_fusionSQLEnabled(false),
|
||||||
m_fusionSQL(0U),
|
m_fusionSQL(0U),
|
||||||
m_fusionModeHang(10U),
|
m_fusionModeHang(10U),
|
||||||
@@ -553,6 +554,8 @@ bool CConf::read()
|
|||||||
m_fusionRemoteGateway = ::atoi(value) == 1;
|
m_fusionRemoteGateway = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "SelfOnly") == 0)
|
else if (::strcmp(key, "SelfOnly") == 0)
|
||||||
m_fusionSelfOnly = ::atoi(value) == 1;
|
m_fusionSelfOnly = ::atoi(value) == 1;
|
||||||
|
else if (::strcmp(key, "TXHang") == 0)
|
||||||
|
m_fusionTXHang = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "ModeHang") == 0)
|
else if (::strcmp(key, "ModeHang") == 0)
|
||||||
m_fusionModeHang = (unsigned int)::atoi(value);
|
m_fusionModeHang = (unsigned int)::atoi(value);
|
||||||
} else if (section == SECTION_P25) {
|
} else if (section == SECTION_P25) {
|
||||||
@@ -1147,6 +1150,11 @@ bool CConf::getFusionRemoteGateway() const
|
|||||||
return m_fusionRemoteGateway;
|
return m_fusionRemoteGateway;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int CConf::getFusionTXHang() const
|
||||||
|
{
|
||||||
|
return m_fusionTXHang;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getFusionSelfOnly() const
|
bool CConf::getFusionSelfOnly() const
|
||||||
{
|
{
|
||||||
return m_fusionSelfOnly;
|
return m_fusionSelfOnly;
|
||||||
|
|||||||
2
Conf.h
2
Conf.h
@@ -136,6 +136,7 @@ public:
|
|||||||
bool getFusionLowDeviation() const;
|
bool getFusionLowDeviation() const;
|
||||||
bool getFusionRemoteGateway() const;
|
bool getFusionRemoteGateway() const;
|
||||||
bool getFusionSelfOnly() const;
|
bool getFusionSelfOnly() const;
|
||||||
|
unsigned int getFusionTXHang() const;
|
||||||
bool getFusionSQLEnabled() const;
|
bool getFusionSQLEnabled() const;
|
||||||
unsigned char getFusionSQL() const;
|
unsigned char getFusionSQL() const;
|
||||||
unsigned int getFusionModeHang() const;
|
unsigned int getFusionModeHang() const;
|
||||||
@@ -338,6 +339,7 @@ private:
|
|||||||
bool m_fusionLowDeviation;
|
bool m_fusionLowDeviation;
|
||||||
bool m_fusionRemoteGateway;
|
bool m_fusionRemoteGateway;
|
||||||
bool m_fusionSelfOnly;
|
bool m_fusionSelfOnly;
|
||||||
|
unsigned int m_fusionTXHang;
|
||||||
bool m_fusionSQLEnabled;
|
bool m_fusionSQLEnabled;
|
||||||
unsigned char m_fusionSQL;
|
unsigned char m_fusionSQL;
|
||||||
unsigned int m_fusionModeHang;
|
unsigned int m_fusionModeHang;
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ TXHang=4
|
|||||||
Enable=1
|
Enable=1
|
||||||
LowDeviation=0
|
LowDeviation=0
|
||||||
SelfOnly=0
|
SelfOnly=0
|
||||||
|
TXHang=4
|
||||||
#DGID=1
|
#DGID=1
|
||||||
RemoteGateway=0
|
RemoteGateway=0
|
||||||
# ModeHang=10
|
# ModeHang=10
|
||||||
|
|||||||
@@ -476,6 +476,7 @@ int CMMDVMHost::run()
|
|||||||
if (m_ysfEnabled) {
|
if (m_ysfEnabled) {
|
||||||
bool lowDeviation = m_conf.getFusionLowDeviation();
|
bool lowDeviation = m_conf.getFusionLowDeviation();
|
||||||
bool remoteGateway = m_conf.getFusionRemoteGateway();
|
bool remoteGateway = m_conf.getFusionRemoteGateway();
|
||||||
|
unsigned int txHang = m_conf.getFusionTXHang();
|
||||||
bool selfOnly = m_conf.getFusionSelfOnly();
|
bool selfOnly = m_conf.getFusionSelfOnly();
|
||||||
bool sqlEnabled = m_conf.getFusionSQLEnabled();
|
bool sqlEnabled = m_conf.getFusionSQLEnabled();
|
||||||
unsigned char sql = m_conf.getFusionSQL();
|
unsigned char sql = m_conf.getFusionSQL();
|
||||||
@@ -484,6 +485,7 @@ int CMMDVMHost::run()
|
|||||||
LogInfo("YSF RF Parameters");
|
LogInfo("YSF RF Parameters");
|
||||||
LogInfo(" Low Deviation: %s", lowDeviation ? "yes" : "no");
|
LogInfo(" Low Deviation: %s", lowDeviation ? "yes" : "no");
|
||||||
LogInfo(" Remote Gateway: %s", remoteGateway ? "yes" : "no");
|
LogInfo(" Remote Gateway: %s", remoteGateway ? "yes" : "no");
|
||||||
|
LogInfo(" TX Hang: %us", txHang);
|
||||||
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
|
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
|
||||||
LogInfo(" DSQ: %s", sqlEnabled ? "yes" : "no");
|
LogInfo(" DSQ: %s", sqlEnabled ? "yes" : "no");
|
||||||
if (sqlEnabled)
|
if (sqlEnabled)
|
||||||
@@ -996,6 +998,7 @@ bool CMMDVMHost::createModem()
|
|||||||
bool debug = m_conf.getModemDebug();
|
bool debug = m_conf.getModemDebug();
|
||||||
unsigned int colorCode = m_conf.getDMRColorCode();
|
unsigned int colorCode = m_conf.getDMRColorCode();
|
||||||
bool lowDeviation = m_conf.getFusionLowDeviation();
|
bool lowDeviation = m_conf.getFusionLowDeviation();
|
||||||
|
unsigned int txHang = m_conf.getFusionTXHang();
|
||||||
unsigned int rxFrequency = m_conf.getRXFrequency();
|
unsigned int rxFrequency = m_conf.getRXFrequency();
|
||||||
unsigned int txFrequency = m_conf.getTXFrequency();
|
unsigned int txFrequency = m_conf.getTXFrequency();
|
||||||
int rxOffset = m_conf.getModemRXOffset();
|
int rxOffset = m_conf.getModemRXOffset();
|
||||||
@@ -1031,7 +1034,7 @@ bool CMMDVMHost::createModem()
|
|||||||
m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel);
|
m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel);
|
||||||
m_modem->setRFParams(rxFrequency, rxOffset, txFrequency, txOffset, txDCOffset, rxDCOffset, rfLevel);
|
m_modem->setRFParams(rxFrequency, rxOffset, txFrequency, txOffset, txDCOffset, rxDCOffset, rfLevel);
|
||||||
m_modem->setDMRParams(colorCode);
|
m_modem->setDMRParams(colorCode);
|
||||||
m_modem->setYSFParams(lowDeviation);
|
m_modem->setYSFParams(lowDeviation, txHang);
|
||||||
|
|
||||||
bool ret = m_modem->open();
|
bool ret = m_modem->open();
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
|
|||||||
14
Modem.cpp
14
Modem.cpp
@@ -93,6 +93,7 @@ CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInver
|
|||||||
m_port(port),
|
m_port(port),
|
||||||
m_dmrColorCode(0U),
|
m_dmrColorCode(0U),
|
||||||
m_ysfLoDev(false),
|
m_ysfLoDev(false),
|
||||||
|
m_ysfTXHang(4U),
|
||||||
m_duplex(duplex),
|
m_duplex(duplex),
|
||||||
m_rxInvert(rxInvert),
|
m_rxInvert(rxInvert),
|
||||||
m_txInvert(txInvert),
|
m_txInvert(txInvert),
|
||||||
@@ -196,9 +197,10 @@ void CModem::setDMRParams(unsigned int colorCode)
|
|||||||
m_dmrColorCode = colorCode;
|
m_dmrColorCode = colorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModem::setYSFParams(bool loDev)
|
void CModem::setYSFParams(bool loDev, unsigned int txHang)
|
||||||
{
|
{
|
||||||
m_ysfLoDev = loDev;
|
m_ysfLoDev = loDev;
|
||||||
|
m_ysfTXHang = txHang;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CModem::open()
|
bool CModem::open()
|
||||||
@@ -1125,7 +1127,7 @@ bool CModem::setConfig()
|
|||||||
|
|
||||||
buffer[0U] = MMDVM_FRAME_START;
|
buffer[0U] = MMDVM_FRAME_START;
|
||||||
|
|
||||||
buffer[1U] = 19U;
|
buffer[1U] = 20U;
|
||||||
|
|
||||||
buffer[2U] = MMDVM_SET_CONFIG;
|
buffer[2U] = MMDVM_SET_CONFIG;
|
||||||
|
|
||||||
@@ -1179,10 +1181,12 @@ bool CModem::setConfig()
|
|||||||
|
|
||||||
buffer[18U] = (unsigned char)(m_nxdnTXLevel * 2.55F + 0.5F);
|
buffer[18U] = (unsigned char)(m_nxdnTXLevel * 2.55F + 0.5F);
|
||||||
|
|
||||||
// CUtils::dump(1U, "Written", buffer, 19U);
|
buffer[19U] = (unsigned char)m_ysfTXHang;
|
||||||
|
|
||||||
int ret = m_serial.write(buffer, 19U);
|
// CUtils::dump(1U, "Written", buffer, 20U);
|
||||||
if (ret != 19)
|
|
||||||
|
int ret = m_serial.write(buffer, 20U);
|
||||||
|
if (ret != 20)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned int count = 0U;
|
unsigned int count = 0U;
|
||||||
|
|||||||
3
Modem.h
3
Modem.h
@@ -41,7 +41,7 @@ public:
|
|||||||
void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled);
|
void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled);
|
||||||
void setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel);
|
void setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel);
|
||||||
void setDMRParams(unsigned int colorCode);
|
void setDMRParams(unsigned int colorCode);
|
||||||
void setYSFParams(bool loDev);
|
void setYSFParams(bool loDev, unsigned int txHang);
|
||||||
|
|
||||||
bool open();
|
bool open();
|
||||||
|
|
||||||
@@ -96,6 +96,7 @@ private:
|
|||||||
std::string m_port;
|
std::string m_port;
|
||||||
unsigned int m_dmrColorCode;
|
unsigned int m_dmrColorCode;
|
||||||
bool m_ysfLoDev;
|
bool m_ysfLoDev;
|
||||||
|
unsigned int m_ysfTXHang;
|
||||||
bool m_duplex;
|
bool m_duplex;
|
||||||
bool m_rxInvert;
|
bool m_rxInvert;
|
||||||
bool m_txInvert;
|
bool m_txInvert;
|
||||||
|
|||||||
Reference in New Issue
Block a user