Host support for the CallsignAtLatch option.

This commit is contained in:
Jonathan Naylor
2020-05-04 22:30:16 +01:00
parent 6d6cee119d
commit 1a142e36cb
7 changed files with 22 additions and 4 deletions

View File

@@ -182,6 +182,7 @@ m_fmCallsignHighLevel(35.0F),
m_fmCallsignLowLevel(15.0F), m_fmCallsignLowLevel(15.0F),
m_fmCallsignAtStart(true), m_fmCallsignAtStart(true),
m_fmCallsignAtEnd(true), m_fmCallsignAtEnd(true),
m_fmCallsignAtLatch(true),
m_fmRFAck("K"), m_fmRFAck("K"),
m_fmExtAck("N"), m_fmExtAck("N"),
m_fmAckSpeed(20U), m_fmAckSpeed(20U),
@@ -716,6 +717,8 @@ bool CConf::read()
m_fmCallsignAtStart = ::atoi(value) == 1; m_fmCallsignAtStart = ::atoi(value) == 1;
else if (::strcmp(key, "CallsignAtEnd") == 0) else if (::strcmp(key, "CallsignAtEnd") == 0)
m_fmCallsignAtEnd = ::atoi(value) == 1; m_fmCallsignAtEnd = ::atoi(value) == 1;
else if (::strcmp(key, "CallsignAtLatch") == 0)
m_fmCallsignAtLatch = ::atoi(value) == 1;
else if (::strcmp(key, "RFAck") == 0) { else if (::strcmp(key, "RFAck") == 0) {
// Convert the ack to upper case // Convert the ack to upper case
for (unsigned int i = 0U; value[i] != 0; i++) for (unsigned int i = 0U; value[i] != 0; i++)
@@ -1545,6 +1548,11 @@ bool CConf::getFMCallsignAtEnd() const
return m_fmCallsignAtEnd; return m_fmCallsignAtEnd;
} }
bool CConf::getFMCallsignAtLatch() const
{
return m_fmCallsignAtLatch;
}
std::string CConf::getFMRFAck() const std::string CConf::getFMRFAck() const
{ {
return m_fmRFAck; return m_fmRFAck;

2
Conf.h
View File

@@ -180,6 +180,7 @@ public:
float getFMCallsignLowLevel() const; float getFMCallsignLowLevel() const;
bool getFMCallsignAtStart() const; bool getFMCallsignAtStart() const;
bool getFMCallsignAtEnd() const; bool getFMCallsignAtEnd() const;
bool getFMCallsignAtLatch() const;
std::string getFMRFAck() const; std::string getFMRFAck() const;
std::string getFMExtAck() const; std::string getFMExtAck() const;
unsigned int getFMAckSpeed() const; unsigned int getFMAckSpeed() const;
@@ -445,6 +446,7 @@ private:
float m_fmCallsignLowLevel; float m_fmCallsignLowLevel;
bool m_fmCallsignAtStart; bool m_fmCallsignAtStart;
bool m_fmCallsignAtEnd; bool m_fmCallsignAtEnd;
bool m_fmCallsignAtLatch;
std::string m_fmRFAck; std::string m_fmRFAck;
std::string m_fmExtAck; std::string m_fmExtAck;
unsigned int m_fmAckSpeed; unsigned int m_fmAckSpeed;

View File

@@ -150,6 +150,7 @@ CallsignHighLevel=50
CallsignLowLevel=20 CallsignLowLevel=20
CallsignAtStart=1 CallsignAtStart=1
CallsignAtEnd=1 CallsignAtEnd=1
CallsignAtLatch=0
RFAck=K RFAck=K
ExtAck=N ExtAck=N
AckSpeed=20 AckSpeed=20

View File

@@ -1215,6 +1215,7 @@ bool CMMDVMHost::createModem()
float callsignLowLevel = m_conf.getFMCallsignLowLevel(); float callsignLowLevel = m_conf.getFMCallsignLowLevel();
bool callsignAtStart = m_conf.getFMCallsignAtStart(); bool callsignAtStart = m_conf.getFMCallsignAtStart();
bool callsignAtEnd = m_conf.getFMCallsignAtEnd(); bool callsignAtEnd = m_conf.getFMCallsignAtEnd();
bool callsignAtLatch = m_conf.getFMCallsignAtLatch();
std::string rfAck = m_conf.getFMRFAck(); std::string rfAck = m_conf.getFMRFAck();
std::string extAck = m_conf.getFMExtAck(); std::string extAck = m_conf.getFMExtAck();
unsigned int ackSpeed = m_conf.getFMAckSpeed(); unsigned int ackSpeed = m_conf.getFMAckSpeed();
@@ -1244,6 +1245,7 @@ bool CMMDVMHost::createModem()
LogInfo(" Callsign Low Level: %.1f%%", callsignLowLevel); LogInfo(" Callsign Low Level: %.1f%%", callsignLowLevel);
LogInfo(" Callsign At Start: %s", callsignAtStart ? "yes" : "no"); LogInfo(" Callsign At Start: %s", callsignAtStart ? "yes" : "no");
LogInfo(" Callsign At End: %s", callsignAtEnd ? "yes" : "no"); LogInfo(" Callsign At End: %s", callsignAtEnd ? "yes" : "no");
LogInfo(" Callsign At Latch: %s", callsignAtLatch ? "yes" : "no");
LogInfo(" RF Ack: %s", rfAck.c_str()); LogInfo(" RF Ack: %s", rfAck.c_str());
// LogInfo(" Ext. Ack: %s", extAck.c_str()); // LogInfo(" Ext. Ack: %s", extAck.c_str());
LogInfo(" Ack Speed: %uWPM", ackSpeed); LogInfo(" Ack Speed: %uWPM", ackSpeed);
@@ -1263,7 +1265,7 @@ bool CMMDVMHost::createModem()
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); 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, rfAudioBoost, maxDevLevel);
} }

View File

@@ -178,6 +178,7 @@ m_fmCallsignHighLevel(35.0F),
m_fmCallsignLowLevel(15.0F), m_fmCallsignLowLevel(15.0F),
m_fmCallsignAtStart(true), m_fmCallsignAtStart(true),
m_fmCallsignAtEnd(true), m_fmCallsignAtEnd(true),
m_fmCallsignAtLatch(true),
m_fmRfAck("K"), m_fmRfAck("K"),
m_fmAckSpeed(20U), m_fmAckSpeed(20U),
m_fmAckFrequency(1750U), m_fmAckFrequency(1750U),
@@ -1887,7 +1888,7 @@ bool CModem::writeDMRShortLC(const unsigned char* lc)
return m_serial->write(buffer, 12U) == 12; 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 callsignHighLevel, float callsignLowLevel, 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, bool callsignAtLatch)
{ {
m_fmCallsign = callsign; m_fmCallsign = callsign;
m_fmCallsignSpeed = callsignSpeed; m_fmCallsignSpeed = callsignSpeed;
@@ -1898,6 +1899,7 @@ void CModem::setFMCallsignParams(const std::string& callsign, unsigned int calls
m_fmCallsignLowLevel = callsignLowLevel; m_fmCallsignLowLevel = callsignLowLevel;
m_fmCallsignAtStart = callsignAtStart; m_fmCallsignAtStart = callsignAtStart;
m_fmCallsignAtEnd = callsignAtEnd; m_fmCallsignAtEnd = callsignAtEnd;
m_fmCallsignAtLatch = callsignAtLatch;
} }
void CModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel) void CModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel)
@@ -1951,6 +1953,8 @@ bool CModem::setFMCallsignParams()
buffer[9U] |= 0x01U; buffer[9U] |= 0x01U;
if (m_fmCallsignAtEnd) if (m_fmCallsignAtEnd)
buffer[9U] |= 0x02U; buffer[9U] |= 0x02U;
if (m_fmCallsignAtLatch)
buffer[9U] |= 0x04U;
for (unsigned int i = 0U; i < m_fmCallsign.size(); i++) for (unsigned int i = 0U; i < m_fmCallsign.size(); i++)
buffer[10U + i] = m_fmCallsign.at(i); buffer[10U + i] = m_fmCallsign.at(i);

View File

@@ -45,7 +45,7 @@ public:
virtual void setYSFParams(bool loDev, unsigned int txHang); virtual void setYSFParams(bool loDev, unsigned int txHang);
virtual void setTransparentDataParams(unsigned int sendFrameType); 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 callsignHighLevel, float callsignLowLevel, 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, 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, unsigned int rfAudioBoost, float maxDevLevel);
@@ -194,6 +194,7 @@ private:
float m_fmCallsignLowLevel; float m_fmCallsignLowLevel;
bool m_fmCallsignAtStart; bool m_fmCallsignAtStart;
bool m_fmCallsignAtEnd; bool m_fmCallsignAtEnd;
bool m_fmCallsignAtLatch;
std::string m_fmRfAck; std::string m_fmRfAck;
unsigned int m_fmAckSpeed; unsigned int m_fmAckSpeed;
unsigned int m_fmAckFrequency; unsigned int m_fmAckFrequency;

View File

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