mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2025-12-06 05:32:00 +01:00
Add the low CTCSS threshold value.
This commit is contained in:
parent
2ae966b7fb
commit
ce121c59da
18
Conf.cpp
18
Conf.cpp
|
|
@ -193,7 +193,8 @@ m_fmAckLevel(80.0F),
|
|||
m_fmTimeout(180U),
|
||||
m_fmTimeoutLevel(80.0F),
|
||||
m_fmCTCSSFrequency(88.6F),
|
||||
m_fmCTCSSThreshold(40U),
|
||||
m_fmCTCSSHighThreshold(30U),
|
||||
m_fmCTCSSLowThreshold(20U),
|
||||
m_fmCTCSSLevel(2.0F),
|
||||
m_fmKerchunkTime(0U),
|
||||
m_fmHangTime(7U),
|
||||
|
|
@ -747,7 +748,11 @@ bool CConf::read()
|
|||
else if (::strcmp(key, "CTCSSFrequency") == 0)
|
||||
m_fmCTCSSFrequency = float(::atof(value));
|
||||
else if (::strcmp(key, "CTCSSThreshold") == 0)
|
||||
m_fmCTCSSThreshold = (unsigned int)::atoi(value);
|
||||
m_fmCTCSSHighThreshold = m_fmCTCSSLowThreshold = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "CTCSSHighThreshold") == 0)
|
||||
m_fmCTCSSHighThreshold = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "CTCSSLowThreshold") == 0)
|
||||
m_fmCTCSSLowThreshold = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "CTCSSLevel") == 0)
|
||||
m_fmCTCSSLevel = float(::atof(value));
|
||||
else if (::strcmp(key, "KerchunkTime") == 0)
|
||||
|
|
@ -1606,9 +1611,14 @@ float CConf::getFMCTCSSFrequency() const
|
|||
return m_fmCTCSSFrequency;
|
||||
}
|
||||
|
||||
unsigned int CConf::getFMCTCSSThreshold() const
|
||||
unsigned int CConf::getFMCTCSSHighThreshold() const
|
||||
{
|
||||
return m_fmCTCSSThreshold;
|
||||
return m_fmCTCSSHighThreshold;
|
||||
}
|
||||
|
||||
unsigned int CConf::getFMCTCSSLowThreshold() const
|
||||
{
|
||||
return m_fmCTCSSLowThreshold;
|
||||
}
|
||||
|
||||
float CConf::getFMCTCSSLevel() const
|
||||
|
|
|
|||
6
Conf.h
6
Conf.h
|
|
@ -191,7 +191,8 @@ public:
|
|||
unsigned int getFMTimeout() const;
|
||||
float getFMTimeoutLevel() const;
|
||||
float getFMCTCSSFrequency() const;
|
||||
unsigned int getFMCTCSSThreshold() const;
|
||||
unsigned int getFMCTCSSHighThreshold() const;
|
||||
unsigned int getFMCTCSSLowThreshold() const;
|
||||
float getFMCTCSSLevel() const;
|
||||
unsigned int getFMKerchunkTime() const;
|
||||
unsigned int getFMHangTime() const;
|
||||
|
|
@ -458,7 +459,8 @@ private:
|
|||
unsigned int m_fmTimeout;
|
||||
float m_fmTimeoutLevel;
|
||||
float m_fmCTCSSFrequency;
|
||||
unsigned int m_fmCTCSSThreshold;
|
||||
unsigned int m_fmCTCSSHighThreshold;
|
||||
unsigned int m_fmCTCSSLowThreshold;
|
||||
float m_fmCTCSSLevel;
|
||||
unsigned int m_fmKerchunkTime;
|
||||
unsigned int m_fmHangTime;
|
||||
|
|
|
|||
|
|
@ -162,6 +162,8 @@ AckLevel=50
|
|||
TimeoutLevel=80
|
||||
CTCSSFrequency=88.4
|
||||
CTCSSThreshold=30
|
||||
# CTCSSHighThreshold=30
|
||||
# CTCSSLowThreshold=20
|
||||
CTCSSLevel=20
|
||||
KerchunkTime=0
|
||||
HangTime=7
|
||||
|
|
|
|||
|
|
@ -1229,7 +1229,8 @@ bool CMMDVMHost::createModem()
|
|||
unsigned int timeout = m_conf.getFMTimeout();
|
||||
float timeoutLevel = m_conf.getFMTimeoutLevel();
|
||||
float ctcssFrequency = m_conf.getFMCTCSSFrequency();
|
||||
unsigned int ctcssThreshold = m_conf.getFMCTCSSThreshold();
|
||||
unsigned int ctcssHighThreshold = m_conf.getFMCTCSSHighThreshold();
|
||||
unsigned int ctcssLowThreshold = m_conf.getFMCTCSSLowThreshold();
|
||||
float ctcssLevel = m_conf.getFMCTCSSLevel();
|
||||
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
|
||||
unsigned int hangTime = m_conf.getFMHangTime();
|
||||
|
|
@ -1260,7 +1261,8 @@ bool CMMDVMHost::createModem()
|
|||
LogInfo(" Timeout: %us", timeout);
|
||||
LogInfo(" Timeout Level: %.1f%%", timeoutLevel);
|
||||
LogInfo(" CTCSS Frequency: %.1fHz", ctcssFrequency);
|
||||
LogInfo(" CTCSS Threshold: %u", ctcssThreshold);
|
||||
LogInfo(" CTCSS High Threshold: %u", ctcssHighThreshold);
|
||||
LogInfo(" CTCSS Low Threshold: %u", ctcssLowThreshold);
|
||||
LogInfo(" CTCSS Level: %.1f%%", ctcssLevel);
|
||||
LogInfo(" Kerchunk Time: %us", kerchunkTime);
|
||||
LogInfo(" Hang Time: %us", hangTime);
|
||||
|
|
@ -1272,7 +1274,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, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
|
||||
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssHighThreshold, ctcssLowThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
|
||||
}
|
||||
|
||||
bool ret = m_modem->open();
|
||||
|
|
|
|||
37
Modem.cpp
37
Modem.cpp
|
|
@ -188,7 +188,8 @@ m_fmAckLevel(80.0F),
|
|||
m_fmTimeout(120U),
|
||||
m_fmTimeoutLevel(80.0F),
|
||||
m_fmCtcssFrequency(88.4F),
|
||||
m_fmCtcssThreshold(25U),
|
||||
m_fmCtcssHighThreshold(30U),
|
||||
m_fmCtcssLowThreshold(20U),
|
||||
m_fmCtcssLevel(10.0F),
|
||||
m_fmKerchunkTime(0U),
|
||||
m_fmHangTime(5U),
|
||||
|
|
@ -1913,13 +1914,14 @@ 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 ctcssThreshold, 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, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
|
||||
{
|
||||
m_fmTimeout = timeout;
|
||||
m_fmTimeoutLevel = timeoutLevel;
|
||||
|
||||
m_fmCtcssFrequency = ctcssFrequency;
|
||||
m_fmCtcssThreshold = ctcssThreshold;
|
||||
m_fmCtcssHighThreshold = ctcssHighThreshold;
|
||||
m_fmCtcssLowThreshold = ctcssLowThreshold;
|
||||
m_fmCtcssLevel = ctcssLevel;
|
||||
|
||||
m_fmKerchunkTime = kerchunkTime;
|
||||
|
|
@ -2052,35 +2054,36 @@ bool CModem::setFMMiscParams()
|
|||
unsigned char buffer[20U];
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
buffer[1U] = 14U;
|
||||
buffer[1U] = 15U;
|
||||
buffer[2U] = MMDVM_FM_PARAMS3;
|
||||
|
||||
buffer[3U] = m_fmTimeout / 5U;
|
||||
buffer[4U] = (unsigned char)(m_fmTimeoutLevel * 2.55F + 0.5F);
|
||||
|
||||
buffer[5U] = (unsigned char)m_fmCtcssFrequency;
|
||||
buffer[6U] = m_fmCtcssThreshold;
|
||||
buffer[7U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F);
|
||||
buffer[6U] = m_fmCtcssHighThreshold;
|
||||
buffer[7U] = m_fmCtcssLowThreshold;
|
||||
buffer[8U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F);
|
||||
|
||||
buffer[8U] = m_fmKerchunkTime;
|
||||
buffer[9U] = m_fmHangTime;
|
||||
buffer[9U] = m_fmKerchunkTime;
|
||||
buffer[10U] = m_fmHangTime;
|
||||
|
||||
buffer[10U] = 0x00U;
|
||||
buffer[11U] = 0x00U;
|
||||
if (m_fmUseCOS)
|
||||
buffer[10U] |= 0x01U;
|
||||
buffer[11U] |= 0x01U;
|
||||
if (m_fmCOSInvert)
|
||||
buffer[10U] |= 0x02U;
|
||||
buffer[11U] |= 0x02U;
|
||||
|
||||
buffer[11U] = m_fmRFAudioBoost;
|
||||
buffer[12U] = m_fmRFAudioBoost;
|
||||
|
||||
buffer[12U] = (unsigned char)(m_fmMaxDevLevel * 2.55F + 0.5F);
|
||||
buffer[13U] = (unsigned char)(m_fmMaxDevLevel * 2.55F + 0.5F);
|
||||
|
||||
buffer[13U] = (unsigned char)(m_rxLevel * 2.55F + 0.5F);
|
||||
buffer[14U] = (unsigned char)(m_rxLevel * 2.55F + 0.5F);
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, 14U);
|
||||
// CUtils::dump(1U, "Written", buffer, 15U);
|
||||
|
||||
int ret = m_serial->write(buffer, 14U);
|
||||
if (ret != 14)
|
||||
int ret = m_serial->write(buffer, 15U);
|
||||
if (ret != 15)
|
||||
return false;
|
||||
|
||||
unsigned int count = 0U;
|
||||
|
|
|
|||
5
Modem.h
5
Modem.h
|
|
@ -47,7 +47,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 ctcssThreshold, 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, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel);
|
||||
|
||||
virtual bool open();
|
||||
|
||||
|
|
@ -204,7 +204,8 @@ private:
|
|||
unsigned int m_fmTimeout;
|
||||
float m_fmTimeoutLevel;
|
||||
float m_fmCtcssFrequency;
|
||||
unsigned int m_fmCtcssThreshold;
|
||||
unsigned int m_fmCtcssHighThreshold;
|
||||
unsigned int m_fmCtcssLowThreshold;
|
||||
float m_fmCtcssLevel;
|
||||
unsigned int m_fmKerchunkTime;
|
||||
unsigned int m_fmHangTime;
|
||||
|
|
|
|||
Loading…
Reference in a new issue