mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
Add a second callsign level setting.
This commit is contained in:
22
Conf.cpp
22
Conf.cpp
@@ -179,7 +179,8 @@ m_fmCallsignSpeed(20U),
|
||||
m_fmCallsignFrequency(1000U),
|
||||
m_fmCallsignTime(10U),
|
||||
m_fmCallsignHoldoff(1U),
|
||||
m_fmCallsignLevel(40.0F),
|
||||
m_fmCallsignHighLevel(35.0F),
|
||||
m_fmCallsignLowLevel(15.0F),
|
||||
m_fmCallsignAtStart(true),
|
||||
m_fmCallsignAtEnd(true),
|
||||
m_fmRFAck("K"),
|
||||
@@ -192,8 +193,8 @@ m_fmAckLevel(80.0F),
|
||||
m_fmTimeout(180U),
|
||||
m_fmTimeoutLevel(80.0F),
|
||||
m_fmCTCSSFrequency(88.6F),
|
||||
m_fmCTCSSThreshold(25U),
|
||||
m_fmCTCSSLevel(5.0F),
|
||||
m_fmCTCSSThreshold(40U),
|
||||
m_fmCTCSSLevel(2.0F),
|
||||
m_fmKerchunkTime(0U),
|
||||
m_fmHangTime(7U),
|
||||
m_dstarNetworkEnabled(false),
|
||||
@@ -706,8 +707,10 @@ bool CConf::read()
|
||||
m_fmCallsignTime = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "CallsignHoldoff") == 0)
|
||||
m_fmCallsignHoldoff = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "CallsignLevel") == 0)
|
||||
m_fmCallsignLevel = float(::atof(value));
|
||||
else if (::strcmp(key, "CallsignHighLevel") == 0)
|
||||
m_fmCallsignHighLevel = float(::atof(value));
|
||||
else if (::strcmp(key, "CallsignLowLevel") == 0)
|
||||
m_fmCallsignLowLevel = float(::atof(value));
|
||||
else if (::strcmp(key, "CallsignAtStart") == 0)
|
||||
m_fmCallsignAtStart = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "CallsignAtEnd") == 0)
|
||||
@@ -1518,9 +1521,14 @@ unsigned int CConf::getFMCallsignHoldoff() const
|
||||
return m_fmCallsignHoldoff;
|
||||
}
|
||||
|
||||
float CConf::getFMCallsignLevel() const
|
||||
float CConf::getFMCallsignHighLevel() const
|
||||
{
|
||||
return m_fmCallsignLevel;
|
||||
return m_fmCallsignHighLevel;
|
||||
}
|
||||
|
||||
float CConf::getFMCallsignLowLevel() const
|
||||
{
|
||||
return m_fmCallsignLowLevel;
|
||||
}
|
||||
|
||||
bool CConf::getFMCallsignAtStart() const
|
||||
|
||||
6
Conf.h
6
Conf.h
@@ -177,7 +177,8 @@ public:
|
||||
unsigned int getFMCallsignFrequency() const;
|
||||
unsigned int getFMCallsignTime() const;
|
||||
unsigned int getFMCallsignHoldoff() const;
|
||||
float getFMCallsignLevel() const;
|
||||
float getFMCallsignHighLevel() const;
|
||||
float getFMCallsignLowLevel() const;
|
||||
bool getFMCallsignAtStart() const;
|
||||
bool getFMCallsignAtEnd() const;
|
||||
std::string getFMRFAck() const;
|
||||
@@ -438,7 +439,8 @@ private:
|
||||
unsigned int m_fmCallsignFrequency;
|
||||
unsigned int m_fmCallsignTime;
|
||||
unsigned int m_fmCallsignHoldoff;
|
||||
float m_fmCallsignLevel;
|
||||
float m_fmCallsignHighLevel;
|
||||
float m_fmCallsignLowLevel;
|
||||
bool m_fmCallsignAtStart;
|
||||
bool m_fmCallsignAtEnd;
|
||||
std::string m_fmRFAck;
|
||||
|
||||
@@ -147,7 +147,8 @@ CallsignSpeed=20
|
||||
CallsignFrequency=1000
|
||||
CallsignTime=10
|
||||
CallsignHoldoff=1
|
||||
CallsignLevel=35
|
||||
CallsignHighLevel=35
|
||||
CallsignLowLevel=15
|
||||
CallsignAtStart=1
|
||||
CallsignAtEnd=1
|
||||
RFAck=K
|
||||
|
||||
@@ -1213,7 +1213,8 @@ bool CMMDVMHost::createModem()
|
||||
unsigned int callsignFrequency = m_conf.getFMCallsignFrequency();
|
||||
unsigned int callsignTime = m_conf.getFMCallsignTime();
|
||||
unsigned int callsignHoldoff = m_conf.getFMCallsignHoldoff();
|
||||
float callsignLevel = m_conf.getFMCallsignLevel();
|
||||
float callsignHighLevel = m_conf.getFMCallsignHighLevel();
|
||||
float callsignLowLevel = m_conf.getFMCallsignLowLevel();
|
||||
bool callsignAtStart = m_conf.getFMCallsignAtStart();
|
||||
bool callsignAtEnd = m_conf.getFMCallsignAtEnd();
|
||||
std::string rfAck = m_conf.getFMRFAck();
|
||||
@@ -1237,7 +1238,8 @@ bool CMMDVMHost::createModem()
|
||||
LogInfo(" Callsign Frequency: %uHz", callsignFrequency);
|
||||
LogInfo(" Callsign Time: %umins", callsignTime);
|
||||
LogInfo(" Callsign Holdoff: 1/%u", callsignHoldoff);
|
||||
LogInfo(" Callsign Level: %.1f%%", callsignLevel);
|
||||
LogInfo(" Callsign High Level: %.1f%%", callsignHighLevel);
|
||||
LogInfo(" Callsign Low Level: %.1f%%", callsignLowLevel);
|
||||
LogInfo(" Callsign At Start: %s", callsignAtStart ? "yes" : "no");
|
||||
LogInfo(" Callsign At End: %s", callsignAtEnd ? "yes" : "no");
|
||||
LogInfo(" RF Ack: %s", rfAck.c_str());
|
||||
@@ -1255,7 +1257,7 @@ bool CMMDVMHost::createModem()
|
||||
LogInfo(" Kerchunk Time: %us", kerchunkTime);
|
||||
LogInfo(" Hang Time: %us", hangTime);
|
||||
|
||||
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignLevel, callsignAtStart, callsignAtEnd);
|
||||
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd);
|
||||
m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel);
|
||||
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, kerchunkTime, hangTime);
|
||||
}
|
||||
|
||||
21
Modem.cpp
21
Modem.cpp
@@ -175,7 +175,8 @@ m_fmCallsignSpeed(20U),
|
||||
m_fmCallsignFrequency(1000U),
|
||||
m_fmCallsignTime(600U),
|
||||
m_fmCallsignHoldoff(0U),
|
||||
m_fmCallsignLevel(40.0F),
|
||||
m_fmCallsignHighLevel(35.0F),
|
||||
m_fmCallsignLowLevel(15.0F),
|
||||
m_fmCallsignAtStart(true),
|
||||
m_fmCallsignAtEnd(true),
|
||||
m_fmRfAck("K"),
|
||||
@@ -1881,14 +1882,15 @@ bool CModem::writeDMRShortLC(const unsigned char* lc)
|
||||
return m_serial->write(buffer, 12U) == 12;
|
||||
}
|
||||
|
||||
void CModem::setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignLevel, bool callsignAtStart, bool callsignAtEnd)
|
||||
void CModem::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)
|
||||
{
|
||||
m_fmCallsign = callsign;
|
||||
m_fmCallsignSpeed = callsignSpeed;
|
||||
m_fmCallsignFrequency = callsignFrequency;
|
||||
m_fmCallsignTime = callsignTime;
|
||||
m_fmCallsignHoldoff = callsignHoldoff;
|
||||
m_fmCallsignLevel = callsignLevel;
|
||||
m_fmCallsignHighLevel = callsignHighLevel;
|
||||
m_fmCallsignLowLevel = callsignLowLevel;
|
||||
m_fmCallsignAtStart = callsignAtStart;
|
||||
m_fmCallsignAtEnd = callsignAtEnd;
|
||||
}
|
||||
@@ -1921,7 +1923,7 @@ bool CModem::setFMCallsignParams()
|
||||
assert(m_serial != NULL);
|
||||
|
||||
unsigned char buffer[80U];
|
||||
unsigned char len = 9U + m_fmCallsign.size();
|
||||
unsigned char len = 10U + m_fmCallsign.size();
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
buffer[1U] = len;
|
||||
@@ -1932,16 +1934,17 @@ bool CModem::setFMCallsignParams()
|
||||
buffer[5U] = m_fmCallsignTime;
|
||||
buffer[6U] = m_fmCallsignHoldoff;
|
||||
|
||||
buffer[7U] = (unsigned char)(m_fmCallsignLevel * 2.55F + 0.5F);
|
||||
buffer[7U] = (unsigned char)(m_fmCallsignHighLevel * 2.55F + 0.5F);
|
||||
buffer[8U] = (unsigned char)(m_fmCallsignLowLevel * 2.55F + 0.5F);
|
||||
|
||||
buffer[8U] = 0x00U;
|
||||
buffer[9U] = 0x00U;
|
||||
if (m_fmCallsignAtStart)
|
||||
buffer[8U] |= 0x01U;
|
||||
buffer[9U] |= 0x01U;
|
||||
if (m_fmCallsignAtEnd)
|
||||
buffer[8U] |= 0x02U;
|
||||
buffer[9U] |= 0x02U;
|
||||
|
||||
for (unsigned int i = 0U; i < m_fmCallsign.size(); i++)
|
||||
buffer[9U + i] = m_fmCallsign.at(i);
|
||||
buffer[10U + i] = m_fmCallsign.at(i);
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, len);
|
||||
|
||||
|
||||
5
Modem.h
5
Modem.h
@@ -45,7 +45,7 @@ public:
|
||||
virtual void setYSFParams(bool loDev, unsigned int txHang);
|
||||
virtual void setTransparentDataParams(unsigned int sendFrameType);
|
||||
|
||||
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 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);
|
||||
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);
|
||||
|
||||
@@ -190,7 +190,8 @@ private:
|
||||
unsigned int m_fmCallsignFrequency;
|
||||
unsigned int m_fmCallsignTime;
|
||||
unsigned int m_fmCallsignHoldoff;
|
||||
float m_fmCallsignLevel;
|
||||
float m_fmCallsignHighLevel;
|
||||
float m_fmCallsignLowLevel;
|
||||
bool m_fmCallsignAtStart;
|
||||
bool m_fmCallsignAtEnd;
|
||||
std::string m_fmRfAck;
|
||||
|
||||
Reference in New Issue
Block a user