Add the Kerchunk TX parameter.

This commit is contained in:
Jonathan Naylor 2020-06-20 20:44:02 +01:00
parent 85751e0c51
commit f936a6c5b6
7 changed files with 23 additions and 4 deletions

View File

@ -201,6 +201,7 @@ m_fmCTCSSHighThreshold(30U),
m_fmCTCSSLowThreshold(20U),
m_fmCTCSSLevel(2.0F),
m_fmKerchunkTime(0U),
m_fmKerchunkTX(true),
m_fmHangTime(7U),
m_fmUseCOS(true),
m_fmCOSInvert(false),
@ -777,6 +778,8 @@ bool CConf::read()
m_fmCTCSSLevel = float(::atof(value));
else if (::strcmp(key, "KerchunkTime") == 0)
m_fmKerchunkTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "KerchunkTX") == 0)
m_fmKerchunkTX = ::atoi(value) == 1;
else if (::strcmp(key, "HangTime") == 0)
m_fmHangTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "UseCOS") == 0)
@ -1683,6 +1686,11 @@ unsigned int CConf::getFMKerchunkTime() const
return m_fmKerchunkTime;
}
bool CConf::getFMKerchunkTX() const
{
return m_fmKerchunkTX;
}
unsigned int CConf::getFMHangTime() const
{
return m_fmHangTime;

2
Conf.h
View File

@ -198,6 +198,7 @@ public:
unsigned int getFMCTCSSLowThreshold() const;
float getFMCTCSSLevel() const;
unsigned int getFMKerchunkTime() const;
bool getFMKerchunkTX() const;
unsigned int getFMHangTime() const;
bool getFMUseCOS() const;
bool getFMCOSInvert() const;
@ -479,6 +480,7 @@ private:
unsigned int m_fmCTCSSLowThreshold;
float m_fmCTCSSLevel;
unsigned int m_fmKerchunkTime;
bool m_fmKerchunkTX;
unsigned int m_fmHangTime;
bool m_fmUseCOS;
bool m_fmCOSInvert;

View File

@ -169,6 +169,7 @@ CTCSSThreshold=30
# CTCSSLowThreshold=20
CTCSSLevel=20
KerchunkTime=0
KerchunkTX=1
HangTime=7
UseCOS=1
COSInvert=0

View File

@ -1300,6 +1300,7 @@ bool CMMDVMHost::createModem()
unsigned int ctcssLowThreshold = m_conf.getFMCTCSSLowThreshold();
float ctcssLevel = m_conf.getFMCTCSSLevel();
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
bool kerchunkTX = m_conf.getFMKerchunkTX();
unsigned int hangTime = m_conf.getFMHangTime();
bool useCOS = m_conf.getFMUseCOS();
bool cosInvert = m_conf.getFMCOSInvert();
@ -1331,6 +1332,7 @@ bool CMMDVMHost::createModem()
LogInfo(" CTCSS Low Threshold: %u", ctcssLowThreshold);
LogInfo(" CTCSS Level: %.1f%%", ctcssLevel);
LogInfo(" Kerchunk Time: %us", kerchunkTime);
LogInfo(" Kerchunk TX: %s", kerchunkTX ? "yes" : "no");
LogInfo(" Hang Time: %us", hangTime);
LogInfo(" Use COS: %s", useCOS ? "yes" : "no");
LogInfo(" COS Invert: %s", cosInvert ? "yes" : "no");
@ -1340,7 +1342,7 @@ bool CMMDVMHost::createModem()
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd, callsignAtLatch);
m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel);
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssHighThreshold, ctcssLowThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssHighThreshold, ctcssLowThreshold, ctcssLevel, kerchunkTime, kerchunkTX, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
if (m_conf.getFMNetworkEnabled()) {
std::string extAck = m_conf.getFMExtAck();

View File

@ -205,6 +205,7 @@ m_fmCtcssHighThreshold(30U),
m_fmCtcssLowThreshold(20U),
m_fmCtcssLevel(10.0F),
m_fmKerchunkTime(0U),
m_fmKerchunkTX(true),
m_fmHangTime(5U),
m_fmUseCOS(true),
m_fmCOSInvert(false),
@ -2051,7 +2052,7 @@ void CModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, uns
m_fmAckLevel = ackLevel;
}
void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, bool kerchunkTX, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
{
m_fmTimeout = timeout;
m_fmTimeoutLevel = timeoutLevel;
@ -2062,6 +2063,8 @@ void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctc
m_fmCtcssLevel = ctcssLevel;
m_fmKerchunkTime = kerchunkTime;
m_fmKerchunkTX = kerchunkTX;
m_fmHangTime = hangTime;
m_fmUseCOS = useCOS;
@ -2217,6 +2220,8 @@ bool CModem::setFMMiscParams()
buffer[11U] |= 0x01U;
if (m_fmCOSInvert)
buffer[11U] |= 0x02U;
if (m_fmKerchunkTX)
buffer[11U] |= 0x04U;
buffer[12U] = m_fmRFAudioBoost;

View File

@ -49,7 +49,7 @@ public:
virtual void setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch);
virtual void setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel);
virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel);
virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, bool kerchunkTX, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel);
virtual void setFMExtParams(const std::string& ack, unsigned int audioBoost);
virtual bool open();
@ -220,6 +220,7 @@ private:
unsigned int m_fmCtcssLowThreshold;
float m_fmCtcssLevel;
unsigned int m_fmKerchunkTime;
bool m_fmKerchunkTX;
unsigned int m_fmHangTime;
bool m_fmUseCOS;
bool m_fmCOSInvert;

View File

@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20200523";
const char* VERSION = "20200620";
#endif