Convert the CTCSS threshold to a raw value.

This commit is contained in:
Jonathan Naylor 2020-04-20 13:21:56 +01:00
parent cb732c9a62
commit 93effcad3d
7 changed files with 14 additions and 14 deletions

View file

@ -192,7 +192,7 @@ m_fmAckLevel(80.0F),
m_fmTimeout(180U),
m_fmTimeoutLevel(80.0F),
m_fmCTCSSFrequency(88.6F),
m_fmCTCSSThreshold(10.0F),
m_fmCTCSSThreshold(25U),
m_fmCTCSSLevel(5.0F),
m_fmKerchunkTime(0U),
m_fmHangTime(7U),
@ -739,7 +739,7 @@ bool CConf::read()
else if (::strcmp(key, "CTCSSFrequency") == 0)
m_fmCTCSSFrequency = float(::atof(value));
else if (::strcmp(key, "CTCSSThreshold") == 0)
m_fmCTCSSThreshold = float(::atoi(value));
m_fmCTCSSThreshold = (unsigned int)::atoi(value);
else if (::strcmp(key, "CTCSSLevel") == 0)
m_fmCTCSSLevel = float(::atof(value));
else if (::strcmp(key, "KerchunkTime") == 0)
@ -1583,7 +1583,7 @@ float CConf::getFMCTCSSFrequency() const
return m_fmCTCSSFrequency;
}
float CConf::getFMCTCSSThreshold() const
unsigned int CConf::getFMCTCSSThreshold() const
{
return m_fmCTCSSThreshold;
}

4
Conf.h
View file

@ -190,7 +190,7 @@ public:
unsigned int getFMTimeout() const;
float getFMTimeoutLevel() const;
float getFMCTCSSFrequency() const;
float getFMCTCSSThreshold() const;
unsigned int getFMCTCSSThreshold() const;
float getFMCTCSSLevel() const;
unsigned int getFMKerchunkTime() const;
unsigned int getFMHangTime() const;
@ -451,7 +451,7 @@ private:
unsigned int m_fmTimeout;
float m_fmTimeoutLevel;
float m_fmCTCSSFrequency;
float m_fmCTCSSThreshold;
unsigned int m_fmCTCSSThreshold;
float m_fmCTCSSLevel;
unsigned int m_fmKerchunkTime;
unsigned int m_fmHangTime;

View file

@ -160,7 +160,7 @@ AckLevel=80
# Timeout=180
TimeoutLevel=80
CTCSSFrequency=88.8
CTCSSThreshold=10
CTCSSThreshold=25
CTCSSLevel=5
KerchunkTime=0
HangTime=7

View file

@ -1226,7 +1226,7 @@ bool CMMDVMHost::createModem()
unsigned int timeout = m_conf.getFMTimeout();
float timeoutLevel = m_conf.getFMTimeoutLevel();
float ctcssFrequency = m_conf.getFMCTCSSFrequency();
float ctcssThreshold = m_conf.getFMCTCSSThreshold();
unsigned int ctcssThreshold = m_conf.getFMCTCSSThreshold();
float ctcssLevel = m_conf.getFMCTCSSLevel();
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
unsigned int hangTime = m_conf.getFMHangTime();
@ -1250,7 +1250,7 @@ bool CMMDVMHost::createModem()
LogInfo(" Timeout: %us", timeout);
LogInfo(" Timeout Level: %.1f%%", timeoutLevel);
LogInfo(" CTCSS Frequency: %.1fHz", ctcssFrequency);
LogInfo(" CTCSS Threshold: %.1f%%", ctcssThreshold);
LogInfo(" CTCSS Threshold: %u", ctcssThreshold);
LogInfo(" CTCSS Level: %.1f%%", ctcssLevel);
LogInfo(" Kerchunk Time: %us", kerchunkTime);
LogInfo(" Hang Time: %us", hangTime);

View file

@ -187,7 +187,7 @@ m_fmAckLevel(80.0F),
m_fmTimeout(120U),
m_fmTimeoutLevel(80.0F),
m_fmCtcssFrequency(88.4F),
m_fmCtcssThreshold(10.0F),
m_fmCtcssThreshold(25U),
m_fmCtcssLevel(10.0F),
m_fmKerchunkTime(0U),
m_fmHangTime(5U)
@ -1903,7 +1903,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, float ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime)
void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime)
{
m_fmTimeout = timeout;
m_fmTimeoutLevel = timeoutLevel;
@ -2040,7 +2040,7 @@ bool CModem::setFMMiscParams()
buffer[4U] = (unsigned char)(m_fmTimeoutLevel * 2.55F + 0.5F);
buffer[5U] = (unsigned char)m_fmCtcssFrequency;
buffer[6U] = (unsigned char)(m_fmCtcssThreshold * 2.55F + 0.5F);
buffer[6U] = m_fmCtcssThreshold;
buffer[7U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F);
buffer[8U] = m_fmKerchunkTime;

View file

@ -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 callsignLevel, bool callsignAtStart, bool callsignAtEnd);
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, float ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime);
virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime);
virtual bool open();
@ -202,7 +202,7 @@ private:
unsigned int m_fmTimeout;
float m_fmTimeoutLevel;
float m_fmCtcssFrequency;
float m_fmCtcssThreshold;
unsigned int m_fmCtcssThreshold;
float m_fmCtcssLevel;
unsigned int m_fmKerchunkTime;
unsigned int m_fmHangTime;

View file

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