From f936a6c5b640514954ca06cd12ec93f3e80c78ca Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sat, 20 Jun 2020 20:44:02 +0100 Subject: [PATCH] Add the Kerchunk TX parameter. --- Conf.cpp | 8 ++++++++ Conf.h | 2 ++ MMDVM.ini | 1 + MMDVMHost.cpp | 4 +++- Modem.cpp | 7 ++++++- Modem.h | 3 ++- Version.h | 2 +- 7 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index eae0db6..5799323 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -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; diff --git a/Conf.h b/Conf.h index b455a55..01e1f0b 100644 --- a/Conf.h +++ b/Conf.h @@ -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; diff --git a/MMDVM.ini b/MMDVM.ini index c031c49..a323267 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -169,6 +169,7 @@ CTCSSThreshold=30 # CTCSSLowThreshold=20 CTCSSLevel=20 KerchunkTime=0 +KerchunkTX=1 HangTime=7 UseCOS=1 COSInvert=0 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index c28f17e..5c4a926 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -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(); diff --git a/Modem.cpp b/Modem.cpp index 3350a5c..8dfb235 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -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; diff --git a/Modem.h b/Modem.h index 4c77d9f..6cbf683 100644 --- a/Modem.h +++ b/Modem.h @@ -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; diff --git a/Version.h b/Version.h index 46f5c4f..7cfe66a 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20200523"; +const char* VERSION = "20200620"; #endif