mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
Add the COSInvert parameter.
This commit is contained in:
8
Conf.cpp
8
Conf.cpp
@@ -198,6 +198,7 @@ m_fmCTCSSLevel(2.0F),
|
|||||||
m_fmKerchunkTime(0U),
|
m_fmKerchunkTime(0U),
|
||||||
m_fmHangTime(7U),
|
m_fmHangTime(7U),
|
||||||
m_fmUseCOS(true),
|
m_fmUseCOS(true),
|
||||||
|
m_fmCOSInvert(false),
|
||||||
m_fmRFAudioBoost(1U),
|
m_fmRFAudioBoost(1U),
|
||||||
m_fmMaxDevLevel(90.0F),
|
m_fmMaxDevLevel(90.0F),
|
||||||
m_fmExtAudioBoost(1U),
|
m_fmExtAudioBoost(1U),
|
||||||
@@ -755,6 +756,8 @@ bool CConf::read()
|
|||||||
m_fmHangTime = (unsigned int)::atoi(value);
|
m_fmHangTime = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "UseCOS") == 0)
|
else if (::strcmp(key, "UseCOS") == 0)
|
||||||
m_fmUseCOS = ::atoi(value) == 1;
|
m_fmUseCOS = ::atoi(value) == 1;
|
||||||
|
else if (::strcmp(key, "COSInvert") == 0)
|
||||||
|
m_fmCOSInvert = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "RFAudioBoost") == 0)
|
else if (::strcmp(key, "RFAudioBoost") == 0)
|
||||||
m_fmRFAudioBoost = (unsigned int)::atoi(value);
|
m_fmRFAudioBoost = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "MaxDevLevel") == 0)
|
else if (::strcmp(key, "MaxDevLevel") == 0)
|
||||||
@@ -1628,6 +1631,11 @@ bool CConf::getFMUseCOS() const
|
|||||||
return m_fmUseCOS;
|
return m_fmUseCOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConf::getFMCOSInvert() const
|
||||||
|
{
|
||||||
|
return m_fmCOSInvert;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int CConf::getFMRFAudioBoost() const
|
unsigned int CConf::getFMRFAudioBoost() const
|
||||||
{
|
{
|
||||||
return m_fmRFAudioBoost;
|
return m_fmRFAudioBoost;
|
||||||
|
|||||||
2
Conf.h
2
Conf.h
@@ -196,6 +196,7 @@ public:
|
|||||||
unsigned int getFMKerchunkTime() const;
|
unsigned int getFMKerchunkTime() const;
|
||||||
unsigned int getFMHangTime() const;
|
unsigned int getFMHangTime() const;
|
||||||
bool getFMUseCOS() const;
|
bool getFMUseCOS() const;
|
||||||
|
bool getFMCOSInvert() const;
|
||||||
unsigned int getFMRFAudioBoost() const;
|
unsigned int getFMRFAudioBoost() const;
|
||||||
float getFMMaxDevLevel() const;
|
float getFMMaxDevLevel() const;
|
||||||
unsigned int getFMExtAudioBoost() const;
|
unsigned int getFMExtAudioBoost() const;
|
||||||
@@ -462,6 +463,7 @@ private:
|
|||||||
unsigned int m_fmKerchunkTime;
|
unsigned int m_fmKerchunkTime;
|
||||||
unsigned int m_fmHangTime;
|
unsigned int m_fmHangTime;
|
||||||
bool m_fmUseCOS;
|
bool m_fmUseCOS;
|
||||||
|
bool m_fmCOSInvert;
|
||||||
unsigned int m_fmRFAudioBoost;
|
unsigned int m_fmRFAudioBoost;
|
||||||
float m_fmMaxDevLevel;
|
float m_fmMaxDevLevel;
|
||||||
unsigned int m_fmExtAudioBoost;
|
unsigned int m_fmExtAudioBoost;
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ CTCSSLevel=20
|
|||||||
KerchunkTime=0
|
KerchunkTime=0
|
||||||
HangTime=7
|
HangTime=7
|
||||||
UseCOS=1
|
UseCOS=1
|
||||||
|
COSInvert=0
|
||||||
RFAudioBoost=1
|
RFAudioBoost=1
|
||||||
MaxDevLevel=90
|
MaxDevLevel=90
|
||||||
ExtAudioBoost=1
|
ExtAudioBoost=1
|
||||||
|
|||||||
@@ -1231,6 +1231,7 @@ bool CMMDVMHost::createModem()
|
|||||||
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
|
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
|
||||||
unsigned int hangTime = m_conf.getFMHangTime();
|
unsigned int hangTime = m_conf.getFMHangTime();
|
||||||
bool useCOS = m_conf.getFMUseCOS();
|
bool useCOS = m_conf.getFMUseCOS();
|
||||||
|
bool cosInvert = m_conf.getFMCOSInvert();
|
||||||
unsigned int rfAudioBoost = m_conf.getFMRFAudioBoost();
|
unsigned int rfAudioBoost = m_conf.getFMRFAudioBoost();
|
||||||
float maxDevLevel = m_conf.getFMMaxDevLevel();
|
float maxDevLevel = m_conf.getFMMaxDevLevel();
|
||||||
unsigned int extAudioBoost = m_conf.getFMExtAudioBoost();
|
unsigned int extAudioBoost = m_conf.getFMExtAudioBoost();
|
||||||
@@ -1261,13 +1262,14 @@ bool CMMDVMHost::createModem()
|
|||||||
LogInfo(" Kerchunk Time: %us", kerchunkTime);
|
LogInfo(" Kerchunk Time: %us", kerchunkTime);
|
||||||
LogInfo(" Hang Time: %us", hangTime);
|
LogInfo(" Hang Time: %us", hangTime);
|
||||||
LogInfo(" Use COS: %s", useCOS ? "yes" : "no");
|
LogInfo(" Use COS: %s", useCOS ? "yes" : "no");
|
||||||
|
LogInfo(" COS Invert: %s", cosInvert ? "yes" : "no");
|
||||||
LogInfo(" RF Audio Boost: x%u", rfAudioBoost);
|
LogInfo(" RF Audio Boost: x%u", rfAudioBoost);
|
||||||
LogInfo(" Max. Deviation Level: %.1f%%", maxDevLevel);
|
LogInfo(" Max. Deviation Level: %.1f%%", maxDevLevel);
|
||||||
// LogInfo(" Ext. Audio Boost: x%u", extAudioBoost);
|
// LogInfo(" Ext. Audio Boost: x%u", extAudioBoost);
|
||||||
|
|
||||||
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd, callsignAtLatch);
|
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd, callsignAtLatch);
|
||||||
m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel);
|
m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel);
|
||||||
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, rfAudioBoost, maxDevLevel);
|
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = m_modem->open();
|
bool ret = m_modem->open();
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ m_fmCtcssLevel(10.0F),
|
|||||||
m_fmKerchunkTime(0U),
|
m_fmKerchunkTime(0U),
|
||||||
m_fmHangTime(5U),
|
m_fmHangTime(5U),
|
||||||
m_fmUseCOS(true),
|
m_fmUseCOS(true),
|
||||||
|
m_fmCOSInvert(false),
|
||||||
m_fmRFAudioBoost(1U),
|
m_fmRFAudioBoost(1U),
|
||||||
m_fmMaxDevLevel(90.0F)
|
m_fmMaxDevLevel(90.0F)
|
||||||
{
|
{
|
||||||
@@ -1912,7 +1913,7 @@ void CModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, uns
|
|||||||
m_fmAckLevel = ackLevel;
|
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, unsigned int rfAudioBoost, float maxDevLevel)
|
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)
|
||||||
{
|
{
|
||||||
m_fmTimeout = timeout;
|
m_fmTimeout = timeout;
|
||||||
m_fmTimeoutLevel = timeoutLevel;
|
m_fmTimeoutLevel = timeoutLevel;
|
||||||
@@ -1925,6 +1926,8 @@ void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctc
|
|||||||
m_fmHangTime = hangTime;
|
m_fmHangTime = hangTime;
|
||||||
|
|
||||||
m_fmUseCOS = useCOS;
|
m_fmUseCOS = useCOS;
|
||||||
|
m_fmCOSInvert = cosInvert;
|
||||||
|
|
||||||
m_fmRFAudioBoost = rfAudioBoost;
|
m_fmRFAudioBoost = rfAudioBoost;
|
||||||
m_fmMaxDevLevel = maxDevLevel;
|
m_fmMaxDevLevel = maxDevLevel;
|
||||||
}
|
}
|
||||||
@@ -2065,6 +2068,8 @@ bool CModem::setFMMiscParams()
|
|||||||
buffer[10U] = 0x00U;
|
buffer[10U] = 0x00U;
|
||||||
if (m_fmUseCOS)
|
if (m_fmUseCOS)
|
||||||
buffer[10U] |= 0x01U;
|
buffer[10U] |= 0x01U;
|
||||||
|
if (m_fmCOSInvert)
|
||||||
|
buffer[10U] |= 0x02U;
|
||||||
|
|
||||||
buffer[11U] = m_fmRFAudioBoost;
|
buffer[11U] = m_fmRFAudioBoost;
|
||||||
|
|
||||||
|
|||||||
3
Modem.h
3
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 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 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, unsigned int rfAudioBoost, float maxDevLevel);
|
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 bool open();
|
virtual bool open();
|
||||||
|
|
||||||
@@ -209,6 +209,7 @@ private:
|
|||||||
unsigned int m_fmKerchunkTime;
|
unsigned int m_fmKerchunkTime;
|
||||||
unsigned int m_fmHangTime;
|
unsigned int m_fmHangTime;
|
||||||
bool m_fmUseCOS;
|
bool m_fmUseCOS;
|
||||||
|
bool m_fmCOSInvert;
|
||||||
unsigned int m_fmRFAudioBoost;
|
unsigned int m_fmRFAudioBoost;
|
||||||
float m_fmMaxDevLevel;
|
float m_fmMaxDevLevel;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user