Merge remote-tracking branch 'origin' into ipv6

This commit is contained in:
SASANO Takayoshi 2020-06-12 20:24:17 +09:00
commit 816f8ea0a1
39 changed files with 1301 additions and 100 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -76,6 +76,10 @@ void CCASTInfo::setQuitInt()
{
}
void CCASTInfo::setFMInt()
{
}
void CCASTInfo::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
if (m_modem != NULL)

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -40,6 +40,7 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStarInt();

303
Conf.cpp
View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -44,6 +44,7 @@ enum SECTION {
SECTION_P25,
SECTION_NXDN,
SECTION_POCSAG,
SECTION_FM,
SECTION_DSTAR_NETWORK,
SECTION_DMR_NETWORK,
SECTION_FUSION_NETWORK,
@ -109,6 +110,7 @@ m_modemYSFTXLevel(50.0F),
m_modemP25TXLevel(50.0F),
m_modemNXDNTXLevel(50.0F),
m_modemPOCSAGTXLevel(50.0F),
m_modemFMTXLevel(50.0F),
m_modemRSSIMappingFile(),
m_modemTrace(false),
m_modemDebug(false),
@ -161,15 +163,48 @@ m_p25NAC(0x293U),
m_p25SelfOnly(false),
m_p25OverrideUID(false),
m_p25RemoteGateway(false),
m_p25TXHang(5U),
m_p25ModeHang(10U),
m_nxdnEnabled(false),
m_nxdnId(0U),
m_nxdnRAN(1U),
m_nxdnSelfOnly(false),
m_nxdnRemoteGateway(false),
m_nxdnTXHang(5U),
m_nxdnModeHang(10U),
m_pocsagEnabled(false),
m_pocsagFrequency(0U),
m_fmEnabled(false),
m_fmCallsign(),
m_fmCallsignSpeed(20U),
m_fmCallsignFrequency(1000U),
m_fmCallsignTime(10U),
m_fmCallsignHoldoff(1U),
m_fmCallsignHighLevel(35.0F),
m_fmCallsignLowLevel(15.0F),
m_fmCallsignAtStart(true),
m_fmCallsignAtEnd(true),
m_fmCallsignAtLatch(true),
m_fmRFAck("K"),
m_fmExtAck("N"),
m_fmAckSpeed(20U),
m_fmAckFrequency(1750U),
m_fmAckMinTime(5U),
m_fmAckDelay(1000U),
m_fmAckLevel(80.0F),
m_fmTimeout(180U),
m_fmTimeoutLevel(80.0F),
m_fmCTCSSFrequency(88.6F),
m_fmCTCSSHighThreshold(30U),
m_fmCTCSSLowThreshold(20U),
m_fmCTCSSLevel(2.0F),
m_fmKerchunkTime(0U),
m_fmHangTime(7U),
m_fmUseCOS(true),
m_fmCOSInvert(false),
m_fmRFAudioBoost(1U),
m_fmMaxDevLevel(90.0F),
m_fmExtAudioBoost(1U),
m_dstarNetworkEnabled(false),
m_dstarGatewayAddress(),
m_dstarGatewayPort(0U),
@ -244,6 +279,7 @@ m_lcdprocPort(0U),
m_lcdprocLocalPort(0U),
m_lcdprocDisplayClock(false),
m_lcdprocUTC(false),
m_lcdprocDimOnIdle(false),
m_lockFileEnabled(false),
m_lockFileName(),
m_mobileGPSEnabled(false),
@ -305,6 +341,8 @@ bool CConf::read()
section = SECTION_NXDN;
else if (::strncmp(buffer, "[POCSAG]", 8U) == 0)
section = SECTION_POCSAG;
else if (::strncmp(buffer, "[FM]", 4U) == 0)
section = SECTION_FM;
else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0)
section = SECTION_DSTAR_NETWORK;
else if (::strncmp(buffer, "[DMR Network]", 13U) == 0)
@ -359,11 +397,11 @@ bool CConf::read()
// Convert the callsign to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]);
m_cwIdCallsign = m_callsign = value;
m_fmCallsign = m_cwIdCallsign = m_callsign = value;
} else if (::strcmp(key, "Id") == 0)
m_id = m_p25Id = m_dmrId = (unsigned int)::atoi(value);
else if (::strcmp(key, "Timeout") == 0)
m_timeout = (unsigned int)::atoi(value);
m_fmTimeout = m_timeout = (unsigned int)::atoi(value);
else if (::strcmp(key, "Duplex") == 0)
m_duplex = ::atoi(value) == 1;
else if (::strcmp(key, "ModeHang") == 0)
@ -456,7 +494,7 @@ bool CConf::read()
else if (::strcmp(key, "RXLevel") == 0)
m_modemRXLevel = float(::atof(value));
else if (::strcmp(key, "TXLevel") == 0)
m_modemCWIdTXLevel = m_modemDStarTXLevel = m_modemDMRTXLevel = m_modemYSFTXLevel = m_modemP25TXLevel = m_modemNXDNTXLevel = float(::atof(value));
m_modemFMTXLevel = m_modemCWIdTXLevel = m_modemDStarTXLevel = m_modemDMRTXLevel = m_modemYSFTXLevel = m_modemP25TXLevel = m_modemNXDNTXLevel = float(::atof(value));
else if (::strcmp(key, "CWIdTXLevel") == 0)
m_modemCWIdTXLevel = float(::atof(value));
else if (::strcmp(key, "D-StarTXLevel") == 0)
@ -471,6 +509,8 @@ bool CConf::read()
m_modemNXDNTXLevel = float(::atof(value));
else if (::strcmp(key, "POCSAGTXLevel") == 0)
m_modemPOCSAGTXLevel = float(::atof(value));
else if (::strcmp(key, "FMTXLevel") == 0)
m_modemFMTXLevel = float(::atof(value));
else if (::strcmp(key, "RSSIMappingFile") == 0)
m_modemRSSIMappingFile = value;
else if (::strcmp(key, "Trace") == 0)
@ -637,6 +677,8 @@ bool CConf::read()
m_p25SelfOnly = ::atoi(value) == 1;
else if (::strcmp(key, "RemoteGateway") == 0)
m_p25RemoteGateway = ::atoi(value) == 1;
else if (::strcmp(key, "TXHang") == 0)
m_p25TXHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "ModeHang") == 0)
m_p25ModeHang = (unsigned int)::atoi(value);
} else if (section == SECTION_NXDN) {
@ -650,13 +692,90 @@ bool CConf::read()
m_nxdnSelfOnly = ::atoi(value) == 1;
else if (::strcmp(key, "RemoteGateway") == 0)
m_nxdnRemoteGateway = ::atoi(value) == 1;
else if (::strcmp(key, "TXHang") == 0)
m_nxdnTXHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "ModeHang") == 0)
m_nxdnModeHang = (unsigned int)::atoi(value);
} else if (section == SECTION_POCSAG) {
if (::strcmp(key, "Enable") == 0)
m_pocsagEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Frequency") == 0)
m_pocsagFrequency = (unsigned int)::atoi(value);
}
else if (section == SECTION_FM) {
if (::strcmp(key, "Enable") == 0)
m_pocsagEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Frequency") == 0)
m_pocsagFrequency = (unsigned int)::atoi(value);
m_fmEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Callsign") == 0) {
// Convert the callsign to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]);
m_fmCallsign = value;
} else if (::strcmp(key, "CallsignSpeed") == 0)
m_fmCallsignSpeed = (unsigned int)::atoi(value);
else if (::strcmp(key, "CallsignFrequency") == 0)
m_fmCallsignFrequency = (unsigned int)::atoi(value);
else if (::strcmp(key, "CallsignTime") == 0)
m_fmCallsignTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "CallsignHoldoff") == 0)
m_fmCallsignHoldoff = (unsigned int)::atoi(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)
m_fmCallsignAtEnd = ::atoi(value) == 1;
else if (::strcmp(key, "CallsignAtLatch") == 0)
m_fmCallsignAtLatch = ::atoi(value) == 1;
else if (::strcmp(key, "RFAck") == 0) {
// Convert the ack to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]);
m_fmRFAck = value;
} else if (::strcmp(key, "ExtAck") == 0) {
// Convert the ack to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]);
m_fmExtAck = value;
} else if (::strcmp(key, "AckSpeed") == 0)
m_fmAckSpeed = (unsigned int)::atoi(value);
else if (::strcmp(key, "AckFrequency") == 0)
m_fmAckFrequency = (unsigned int)::atoi(value);
else if (::strcmp(key, "AckMinTime") == 0)
m_fmAckMinTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "AckDelay") == 0)
m_fmAckDelay = (unsigned int)::atoi(value);
else if (::strcmp(key, "AckLevel") == 0)
m_fmAckLevel = float(::atof(value));
else if (::strcmp(key, "Timeout") == 0)
m_fmTimeout = (unsigned int)::atoi(value);
else if (::strcmp(key, "TimeoutLevel") == 0)
m_fmTimeoutLevel = float(::atof(value));
else if (::strcmp(key, "CTCSSFrequency") == 0)
m_fmCTCSSFrequency = float(::atof(value));
else if (::strcmp(key, "CTCSSThreshold") == 0)
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)
m_fmKerchunkTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "HangTime") == 0)
m_fmHangTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "UseCOS") == 0)
m_fmUseCOS = ::atoi(value) == 1;
else if (::strcmp(key, "COSInvert") == 0)
m_fmCOSInvert = ::atoi(value) == 1;
else if (::strcmp(key, "RFAudioBoost") == 0)
m_fmRFAudioBoost = (unsigned int)::atoi(value);
else if (::strcmp(key, "MaxDevLevel") == 0)
m_fmMaxDevLevel = float(::atof(value));
else if (::strcmp(key, "ExtAudioBoost") == 0)
m_fmExtAudioBoost = (unsigned int)::atoi(value);
} else if (section == SECTION_DSTAR_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_dstarNetworkEnabled = ::atoi(value) == 1;
@ -1086,6 +1205,11 @@ float CConf::getModemPOCSAGTXLevel() const
return m_modemPOCSAGTXLevel;
}
float CConf::getModemFMTXLevel() const
{
return m_modemFMTXLevel;
}
std::string CConf::getModemRSSIMappingFile () const
{
return m_modemRSSIMappingFile;
@ -1346,6 +1470,11 @@ bool CConf::getP25RemoteGateway() const
return m_p25RemoteGateway;
}
unsigned int CConf::getP25TXHang() const
{
return m_p25TXHang;
}
unsigned int CConf::getP25ModeHang() const
{
return m_p25ModeHang;
@ -1376,6 +1505,11 @@ bool CConf::getNXDNRemoteGateway() const
return m_nxdnRemoteGateway;
}
unsigned int CConf::getNXDNTXHang() const
{
return m_nxdnTXHang;
}
unsigned int CConf::getNXDNModeHang() const
{
return m_nxdnModeHang;
@ -1391,6 +1525,161 @@ unsigned int CConf::getPOCSAGFrequency() const
return m_pocsagFrequency;
}
bool CConf::getFMEnabled() const
{
return m_fmEnabled;
}
std::string CConf::getFMCallsign() const
{
return m_fmCallsign;
}
unsigned int CConf::getFMCallsignSpeed() const
{
return m_fmCallsignSpeed;
}
unsigned int CConf::getFMCallsignFrequency() const
{
return m_fmCallsignFrequency;
}
unsigned int CConf::getFMCallsignTime() const
{
return m_fmCallsignTime;
}
unsigned int CConf::getFMCallsignHoldoff() const
{
return m_fmCallsignHoldoff;
}
float CConf::getFMCallsignHighLevel() const
{
return m_fmCallsignHighLevel;
}
float CConf::getFMCallsignLowLevel() const
{
return m_fmCallsignLowLevel;
}
bool CConf::getFMCallsignAtStart() const
{
return m_fmCallsignAtStart;
}
bool CConf::getFMCallsignAtEnd() const
{
return m_fmCallsignAtEnd;
}
bool CConf::getFMCallsignAtLatch() const
{
return m_fmCallsignAtLatch;
}
std::string CConf::getFMRFAck() const
{
return m_fmRFAck;
}
std::string CConf::getFMExtAck() const
{
return m_fmExtAck;
}
unsigned int CConf::getFMAckSpeed() const
{
return m_fmAckSpeed;
}
unsigned int CConf::getFMAckFrequency() const
{
return m_fmAckFrequency;
}
unsigned int CConf::getFMAckMinTime() const
{
return m_fmAckMinTime;
}
unsigned int CConf::getFMAckDelay() const
{
return m_fmAckDelay;
}
float CConf::getFMAckLevel() const
{
return m_fmAckLevel;
}
unsigned int CConf::getFMTimeout() const
{
return m_fmTimeout;
}
float CConf::getFMTimeoutLevel() const
{
return m_fmTimeoutLevel;
}
float CConf::getFMCTCSSFrequency() const
{
return m_fmCTCSSFrequency;
}
unsigned int CConf::getFMCTCSSHighThreshold() const
{
return m_fmCTCSSHighThreshold;
}
unsigned int CConf::getFMCTCSSLowThreshold() const
{
return m_fmCTCSSLowThreshold;
}
float CConf::getFMCTCSSLevel() const
{
return m_fmCTCSSLevel;
}
unsigned int CConf::getFMKerchunkTime() const
{
return m_fmKerchunkTime;
}
unsigned int CConf::getFMHangTime() const
{
return m_fmHangTime;
}
bool CConf::getFMUseCOS() const
{
return m_fmUseCOS;
}
bool CConf::getFMCOSInvert() const
{
return m_fmCOSInvert;
}
unsigned int CConf::getFMRFAudioBoost() const
{
return m_fmRFAudioBoost;
}
float CConf::getFMMaxDevLevel() const
{
return m_fmMaxDevLevel;
}
unsigned int CConf::getFMExtAudioBoost() const
{
return m_fmExtAudioBoost;
}
bool CConf::getDStarNetworkEnabled() const
{
return m_dstarNetworkEnabled;

73
Conf.h
View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -90,6 +90,7 @@ public:
float getModemP25TXLevel() const;
float getModemNXDNTXLevel() const;
float getModemPOCSAGTXLevel() const;
float getModemFMTXLevel() const;
std::string getModemRSSIMappingFile() const;
bool getModemTrace() const;
bool getModemDebug() const;
@ -154,6 +155,7 @@ public:
bool getP25SelfOnly() const;
bool getP25OverrideUID() const;
bool getP25RemoteGateway() const;
unsigned int getP25TXHang() const;
unsigned int getP25ModeHang() const;
// The NXDN section
@ -162,12 +164,46 @@ public:
unsigned int getNXDNRAN() const;
bool getNXDNSelfOnly() const;
bool getNXDNRemoteGateway() const;
unsigned int getNXDNTXHang() const;
unsigned int getNXDNModeHang() const;
// The POCSAG section
bool getPOCSAGEnabled() const;
unsigned int getPOCSAGFrequency() const;
// The FM Section
bool getFMEnabled() const;
std::string getFMCallsign() const;
unsigned int getFMCallsignSpeed() const;
unsigned int getFMCallsignFrequency() const;
unsigned int getFMCallsignTime() const;
unsigned int getFMCallsignHoldoff() const;
float getFMCallsignHighLevel() const;
float getFMCallsignLowLevel() const;
bool getFMCallsignAtStart() const;
bool getFMCallsignAtEnd() const;
bool getFMCallsignAtLatch() const;
std::string getFMRFAck() const;
std::string getFMExtAck() const;
unsigned int getFMAckSpeed() const;
unsigned int getFMAckFrequency() const;
unsigned int getFMAckMinTime() const;
unsigned int getFMAckDelay() const;
float getFMAckLevel() const;
unsigned int getFMTimeout() const;
float getFMTimeoutLevel() const;
float getFMCTCSSFrequency() const;
unsigned int getFMCTCSSHighThreshold() const;
unsigned int getFMCTCSSLowThreshold() const;
float getFMCTCSSLevel() const;
unsigned int getFMKerchunkTime() const;
unsigned int getFMHangTime() const;
bool getFMUseCOS() const;
bool getFMCOSInvert() const;
unsigned int getFMRFAudioBoost() const;
float getFMMaxDevLevel() const;
unsigned int getFMExtAudioBoost() const;
// The D-Star Network section
bool getDStarNetworkEnabled() const;
std::string getDStarGatewayAddress() const;
@ -334,6 +370,7 @@ private:
float m_modemP25TXLevel;
float m_modemNXDNTXLevel;
float m_modemPOCSAGTXLevel;
float m_modemFMTXLevel;
std::string m_modemRSSIMappingFile;
bool m_modemTrace;
bool m_modemDebug;
@ -392,6 +429,7 @@ private:
bool m_p25SelfOnly;
bool m_p25OverrideUID;
bool m_p25RemoteGateway;
unsigned int m_p25TXHang;
unsigned int m_p25ModeHang;
bool m_nxdnEnabled;
@ -399,11 +437,44 @@ private:
unsigned int m_nxdnRAN;
bool m_nxdnSelfOnly;
bool m_nxdnRemoteGateway;
unsigned int m_nxdnTXHang;
unsigned int m_nxdnModeHang;
bool m_pocsagEnabled;
unsigned int m_pocsagFrequency;
bool m_fmEnabled;
std::string m_fmCallsign;
unsigned int m_fmCallsignSpeed;
unsigned int m_fmCallsignFrequency;
unsigned int m_fmCallsignTime;
unsigned int m_fmCallsignHoldoff;
float m_fmCallsignHighLevel;
float m_fmCallsignLowLevel;
bool m_fmCallsignAtStart;
bool m_fmCallsignAtEnd;
bool m_fmCallsignAtLatch;
std::string m_fmRFAck;
std::string m_fmExtAck;
unsigned int m_fmAckSpeed;
unsigned int m_fmAckFrequency;
unsigned int m_fmAckMinTime;
unsigned int m_fmAckDelay;
float m_fmAckLevel;
unsigned int m_fmTimeout;
float m_fmTimeoutLevel;
float m_fmCTCSSFrequency;
unsigned int m_fmCTCSSHighThreshold;
unsigned int m_fmCTCSSLowThreshold;
float m_fmCTCSSLevel;
unsigned int m_fmKerchunkTime;
unsigned int m_fmHangTime;
bool m_fmUseCOS;
bool m_fmCOSInvert;
unsigned int m_fmRFAudioBoost;
float m_fmMaxDevLevel;
unsigned int m_fmExtAudioBoost;
bool m_dstarNetworkEnabled;
std::string m_dstarGatewayAddress;
unsigned int m_dstarGatewayPort;

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -72,7 +72,7 @@ bool CDMRTA::decodeTA()
unsigned int TAformat = (talkerAlias[0] >> 6U) & 0x03U;
unsigned int TAsize = (talkerAlias[0] >> 1U) & 0x1FU;
::memcpy(m_TA, "(could not decode)", sizeof(m_TA));
::strcpy(m_TA, "(could not decode)");
switch (TAformat) {
case 0U: // 7 bit

View file

@ -26,6 +26,9 @@ const unsigned char MODE_YSF = 3U;
const unsigned char MODE_P25 = 4U;
const unsigned char MODE_NXDN = 5U;
const unsigned char MODE_POCSAG = 6U;
const unsigned char MODE_FM = 10U;
const unsigned char MODE_CW = 98U;
const unsigned char MODE_LOCKOUT = 99U;
const unsigned char MODE_ERROR = 100U;

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -101,6 +101,17 @@ void CDisplay::setQuit()
setQuitInt();
}
void CDisplay::setFM()
{
m_timer1.stop();
m_timer2.stop();
m_mode1 = MODE_FM;
m_mode2 = MODE_FM;
setFMInt();
}
void CDisplay::writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
assert(my1 != NULL);
@ -190,6 +201,7 @@ void CDisplay::writeDMRBER(unsigned int slotNo, float ber)
{
writeDMRBERInt(slotNo, ber);
}
void CDisplay::clearDMR(unsigned int slotNo)
{
if (slotNo == 1U) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,7 @@ public:
void setLockout();
void setError(const char* text);
void setQuit();
void setFM();
void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
void writeDStarRSSI(unsigned char rssi);
@ -87,6 +88,7 @@ protected:
virtual void setLockoutInt() = 0;
virtual void setErrorInt(const char* text) = 0;
virtual void setQuitInt() = 0;
virtual void setFMInt() = 0;
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector) = 0;
virtual void writeDStarRSSIInt(unsigned char rssi);

View file

@ -399,6 +399,37 @@ void CHD44780::setQuitInt()
m_dmr = false;
}
void CHD44780::setFMInt()
{
m_clockDisplayTimer.stop();
::lcdClear(m_fd);
#ifdef ADAFRUIT_DISPLAY
adafruitLCDColour(AC_WHITE);
#endif
if (m_pwm) {
if (m_pwmPin != 1U)
::softPwmWrite(m_pwmPin, m_pwmDim);
else
::pwmWrite(m_pwmPin, (m_pwmDim / 100) * 1024);
}
// Print callsign and ID at on top row for all screen sizes
::lcdPosition(m_fd, 0, 0);
::lcdPrintf(m_fd, "%-6s", m_callsign.c_str());
::lcdPosition(m_fd, m_cols - 7, 0);
::lcdPrintf(m_fd, "%7u", m_dmrid);
// Print MMDVM and Idle on bottom row for all screen sizes
::lcdPosition(m_fd, 0, m_rows - 1);
::lcdPuts(m_fd, "MMDVM");
::lcdPosition(m_fd, m_cols - 4, m_rows - 1);
::lcdPuts(m_fd, "FM"); // Gets overwritten by clock on 2 line screen
m_dmr = false;
}
void CHD44780::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
assert(my1 != NULL);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX & Tony Corbett G0WFV
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX & Tony Corbett G0WFV
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -101,6 +101,7 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void writeDStarRSSIInt(unsigned char rssi);

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2016,2017,2018 by Tony Corbett G0WFV
* Copyright (C) 2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -250,6 +250,23 @@ void CLCDproc::setQuitInt()
m_dmr = false;
}
void CLCDproc::setFMInt()
{
m_clockDisplayTimer.stop(); // Stop the clock display
if (m_screensDefined) {
socketPrintf(m_socketfd, "screen_set DStar -priority hidden");
socketPrintf(m_socketfd, "screen_set DMR -priority hidden");
socketPrintf(m_socketfd, "screen_set YSF -priority hidden");
socketPrintf(m_socketfd, "screen_set P25 -priority hidden");
socketPrintf(m_socketfd, "screen_set NXDN -priority hidden");
socketPrintf(m_socketfd, "widget_set Status Status %u %u FM", m_cols - 6, m_rows);
socketPrintf(m_socketfd, "output 0"); // Clear all LEDs
}
m_dmr = false;
}
void CLCDproc::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
assert(my1 != NULL);
@ -303,7 +320,7 @@ void CLCDproc::clearDStarInt()
{
m_clockDisplayTimer.stop(); // Stop the clock display
socketPrintf(m_socketfd, "widget_set DStar Line2 1 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set DStar Line2 1 2 15 2 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set DStar Line3 1 3 15 3 h 3 \"\"");
socketPrintf(m_socketfd, "widget_set DStar Line4 1 4 15 4 h 3 \"\"");
socketPrintf(m_socketfd, "output 8"); // Set LED4 color green
@ -396,7 +413,7 @@ void CLCDproc::clearDMRInt(unsigned int slotNo)
socketPrintf(m_socketfd, "widget_set DMR Slot2RSSI %u %u %*.s", (m_cols / 2) + 1, 4, m_cols / 2, " ");
}
} else {
socketPrintf(m_socketfd, "widget_set DMR Slot1 1 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set DMR Slot1 1 2 15 2 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set DMR Slot2 1 3 15 3 h 3 \"\"");
socketPrintf(m_socketfd, "widget_set DMR Slot2RSSI %u %u %*.s", (m_cols / 2) + 1, 4, m_cols / 2, " ");
}
@ -444,7 +461,7 @@ void CLCDproc::clearFusionInt()
{
m_clockDisplayTimer.stop(); // Stop the clock display
socketPrintf(m_socketfd, "widget_set YSF Line2 1 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set YSF Line2 1 2 15 2 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set YSF Line3 1 3 15 3 h 3 \"\"");
socketPrintf(m_socketfd, "widget_set YSF Line4 1 4 15 4 h 3 \"\"");
socketPrintf(m_socketfd, "output 4"); // Set LED3 color green
@ -489,7 +506,7 @@ void CLCDproc::clearP25Int()
{
m_clockDisplayTimer.stop(); // Stop the clock display
socketPrintf(m_socketfd, "widget_set P25 Line2 1 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set P25 Line2 1 2 15 2 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set P25 Line3 1 3 15 3 h 3 \"\"");
socketPrintf(m_socketfd, "widget_set P25 Line4 1 4 15 4 h 3 \"\"");
socketPrintf(m_socketfd, "output 2"); // Set LED2 color green
@ -534,7 +551,7 @@ void CLCDproc::clearNXDNInt()
{
m_clockDisplayTimer.stop(); // Stop the clock display
socketPrintf(m_socketfd, "widget_set NXDN Line2 1 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set NXDN Line2 1 2 15 2 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set NXDN Line3 1 3 15 3 h 3 \"\"");
socketPrintf(m_socketfd, "widget_set NXDN Line4 1 4 15 4 h 3 \"\"");
socketPrintf(m_socketfd, "output 16"); // Set LED5 color green
@ -761,7 +778,7 @@ void CLCDproc::defineScreens()
socketPrintf(m_socketfd, "widget_add DStar Line4 scroller");
/* Do we need to pre-populate the values??
socketPrintf(m_socketfd, "widget_set DStar Line2 1 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set DStar Line2 1 2 15 2 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set DStar Line3 1 3 15 3 h 3 \"\"");
socketPrintf(m_socketfd, "widget_set DStar Line4 1 4 15 4 h 3 \"\"");
*/
@ -782,8 +799,8 @@ void CLCDproc::defineScreens()
/* Do we need to pre-populate the values??
socketPrintf(m_socketfd, "widget_set DMR Slot1_ 1 %u 1", m_rows / 2);
socketPrintf(m_socketfd, "widget_set DMR Slot2_ 1 %u 2", m_rows / 2 + 1);
socketPrintf(m_socketfd, "widget_set DMR Slot1 3 1 15 1 h 3 Listening");
socketPrintf(m_socketfd, "widget_set DMR Slot2 3 2 15 2 h 3 Listening");
socketPrintf(m_socketfd, "widget_set DMR Slot1 3 1 15 1 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set DMR Slot2 3 2 15 2 h 3 \"Listening\"");
*/
// The YSF Screen
@ -797,7 +814,7 @@ void CLCDproc::defineScreens()
socketPrintf(m_socketfd, "widget_add YSF Line4 scroller");
/* Do we need to pre-populate the values??
socketPrintf(m_socketfd, "widget_set YSF Line2 2 1 15 1 h 3 Listening");
socketPrintf(m_socketfd, "widget_set YSF Line2 2 1 15 1 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set YSF Line3 3 1 15 1 h 3 \" \"");
socketPrintf(m_socketfd, "widget_set YSF Line4 4 2 15 2 h 3 \" \"");
*/
@ -813,7 +830,7 @@ void CLCDproc::defineScreens()
socketPrintf(m_socketfd, "widget_add P25 Line4 scroller");
/* Do we need to pre-populate the values??
socketPrintf(m_socketfd, "widget_set P25 Line3 2 1 15 1 h 3 Listening");
socketPrintf(m_socketfd, "widget_set P25 Line3 2 1 15 1 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set P25 Line3 3 1 15 1 h 3 \" \"");
socketPrintf(m_socketfd, "widget_set P25 Line4 4 2 15 2 h 3 \" \"");
*/
@ -829,7 +846,7 @@ void CLCDproc::defineScreens()
socketPrintf(m_socketfd, "widget_add NXDN Line4 scroller");
/* Do we need to pre-populate the values??
socketPrintf(m_socketfd, "widget_set NXDN Line3 2 1 15 1 h 3 Listening");
socketPrintf(m_socketfd, "widget_set NXDN Line3 2 1 15 1 h 3 \"Listening\"");
socketPrintf(m_socketfd, "widget_set NXDN Line3 3 1 15 1 h 3 \" \"");
socketPrintf(m_socketfd, "widget_set NXDN Line4 4 2 15 2 h 3 \" \"");
*/

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2016,2017 by Tony Corbett G0WFV
* Copyright (C) 2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -40,8 +40,8 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void writeDStarRSSIInt(unsigned char rssi);
virtual void clearDStarInt();

20
Log.cpp
View file

@ -22,6 +22,7 @@
#include <Windows.h>
#else
#include <sys/time.h>
#include <unistd.h>
#endif
#include <cstdio>
@ -36,6 +37,7 @@ static std::string m_filePath;
static std::string m_fileRoot;
static FILE* m_fpLog = NULL;
static bool m_daemon = false;
static unsigned int m_displayLevel = 2U;
@ -45,6 +47,8 @@ static char LEVELS[] = " DMIWEF";
static bool LogOpen()
{
bool status = false;
if (m_fileLevel == 0U)
return true;
@ -68,18 +72,28 @@ static bool LogOpen()
::sprintf(filename, "%s/%s-%04d-%02d-%02d.log", m_filePath.c_str(), m_fileRoot.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday);
#endif
m_fpLog = ::fopen(filename, "a+t");
if ((m_fpLog = ::fopen(filename, "a+t")) != NULL)
{
status = true;
#if !defined(_WIN32) && !defined(_WIN64)
if (m_daemon)
dup2(fileno(m_fpLog), fileno(stderr));
#endif
}
m_tm = *tm;
return m_fpLog != NULL;
return status;
}
bool LogInitialise(const std::string& filePath, const std::string& fileRoot, unsigned int fileLevel, unsigned int displayLevel)
bool LogInitialise(bool daemon, const std::string& filePath, const std::string& fileRoot, unsigned int fileLevel, unsigned int displayLevel)
{
m_filePath = filePath;
m_fileRoot = fileRoot;
m_fileLevel = fileLevel;
m_displayLevel = displayLevel;
m_daemon = daemon;
return ::LogOpen();
}

2
Log.h
View file

@ -30,7 +30,7 @@
extern void Log(unsigned int level, const char* fmt, ...);
extern bool LogInitialise(const std::string& filePath, const std::string& fileRoot, unsigned int fileLevel, unsigned int displayLevel);
extern bool LogInitialise(bool daemon, const std::string& filePath, const std::string& fileRoot, unsigned int fileLevel, unsigned int displayLevel);
extern void LogFinalise();
#endif

View file

@ -43,7 +43,7 @@ Time=24
[Modem]
# Port=/dev/ttyACM0
# Port=/dev/ttyAMA0
Port=\\.\COM3
Port=\\.\COM4
Protocol=uart
# Address=0x22
TXInvert=1
@ -65,6 +65,7 @@ RFLevel=100
# P25TXLevel=50
# NXDNTXLevel=50
# POCSAGTXLevel=50
# FMTXLevel=50
RSSIMappingFile=RSSI.dat
Trace=0
Debug=0
@ -125,6 +126,7 @@ NAC=293
SelfOnly=0
OverrideUIDCheck=0
RemoteGateway=0
TXHang=5
# ModeHang=10
[NXDN]
@ -132,12 +134,47 @@ Enable=1
RAN=1
SelfOnly=0
RemoteGateway=0
TXHang=5
# ModeHang=10
[POCSAG]
Enable=1
Frequency=439987500
[FM]
Enable=1
# Callsign=G4KLX
CallsignSpeed=20
CallsignFrequency=1000
CallsignTime=10
CallsignHoldoff=0
CallsignHighLevel=50
CallsignLowLevel=20
CallsignAtStart=1
CallsignAtEnd=1
CallsignAtLatch=0
RFAck=K
ExtAck=N
AckSpeed=20
AckFrequency=1750
AckMinTime=4
AckDelay=1000
AckLevel=50
# Timeout=180
TimeoutLevel=80
CTCSSFrequency=88.4
CTCSSThreshold=30
# CTCSSHighThreshold=30
# CTCSSLowThreshold=20
CTCSSLevel=20
KerchunkTime=0
HangTime=7
UseCOS=1
COSInvert=0
RFAudioBoost=1
MaxDevLevel=90
ExtAudioBoost=1
[D-Star Network]
Enable=1
GatewayAddress=127.0.0.1

View file

@ -150,6 +150,7 @@ m_ysfEnabled(false),
m_p25Enabled(false),
m_nxdnEnabled(false),
m_pocsagEnabled(false),
m_fmEnabled(false),
m_cwIdTime(0U),
m_dmrLookup(NULL),
m_nxdnLookup(NULL),
@ -236,7 +237,11 @@ int CMMDVMHost::run()
#endif
#endif
ret = ::LogInitialise(m_conf.getLogFilePath(), m_conf.getLogFileRoot(), m_conf.getLogFileLevel(), m_conf.getLogDisplayLevel());
#if !defined(_WIN32) && !defined(_WIN64)
ret = ::LogInitialise(m_daemon, m_conf.getLogFilePath(), m_conf.getLogFileRoot(), m_conf.getLogFileLevel(), m_conf.getLogDisplayLevel());
#else
ret = ::LogInitialise(false, m_conf.getLogFilePath(), m_conf.getLogFileRoot(), m_conf.getLogFileLevel(), m_conf.getLogDisplayLevel());
#endif
if (!ret) {
::fprintf(stderr, "MMDVMHost: unable to open the log file\n");
return 1;
@ -246,7 +251,6 @@ int CMMDVMHost::run()
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif
@ -545,12 +549,13 @@ int CMMDVMHost::run()
}
if (m_p25Enabled) {
unsigned int id = m_conf.getP25Id();
unsigned int nac = m_conf.getP25NAC();
bool uidOverride = m_conf.getP25OverrideUID();
bool selfOnly = m_conf.getP25SelfOnly();
bool remoteGateway = m_conf.getP25RemoteGateway();
m_p25RFModeHang = m_conf.getP25ModeHang();
unsigned int id = m_conf.getP25Id();
unsigned int nac = m_conf.getP25NAC();
unsigned int txHang = m_conf.getP25TXHang();
bool uidOverride = m_conf.getP25OverrideUID();
bool selfOnly = m_conf.getP25SelfOnly();
bool remoteGateway = m_conf.getP25RemoteGateway();
m_p25RFModeHang = m_conf.getP25ModeHang();
LogInfo("P25 RF Parameters");
LogInfo(" Id: %u", id);
@ -558,6 +563,7 @@ int CMMDVMHost::run()
LogInfo(" UID Override: %s", uidOverride ? "yes" : "no");
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
LogInfo(" Remote Gateway: %s", remoteGateway ? "yes" : "no");
LogInfo(" TX Hang: %us", txHang);
LogInfo(" Mode Hang: %us", m_p25RFModeHang);
m_p25 = new CP25Control(nac, id, selfOnly, uidOverride, m_p25Network, m_display, m_timeout, m_duplex, m_dmrLookup, remoteGateway, rssi);
@ -575,17 +581,19 @@ int CMMDVMHost::run()
m_nxdnLookup = new CNXDNLookup(lookupFile, reloadTime);
m_nxdnLookup->read();
unsigned int id = m_conf.getNXDNId();
unsigned int ran = m_conf.getNXDNRAN();
bool selfOnly = m_conf.getNXDNSelfOnly();
bool remoteGateway = m_conf.getNXDNRemoteGateway();
m_nxdnRFModeHang = m_conf.getNXDNModeHang();
unsigned int id = m_conf.getNXDNId();
unsigned int ran = m_conf.getNXDNRAN();
bool selfOnly = m_conf.getNXDNSelfOnly();
bool remoteGateway = m_conf.getNXDNRemoteGateway();
unsigned int txHang = m_conf.getNXDNTXHang();
m_nxdnRFModeHang = m_conf.getNXDNModeHang();
LogInfo("NXDN RF Parameters");
LogInfo(" Id: %u", id);
LogInfo(" RAN: %u", ran);
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
LogInfo(" Remote Gateway: %s", remoteGateway ? "yes" : "no");
LogInfo(" TX Hang: %us", txHang);
LogInfo(" Mode Hang: %us", m_nxdnRFModeHang);
m_nxdn = new CNXDNControl(ran, id, selfOnly, m_nxdnNetwork, m_display, m_timeout, m_duplex, remoteGateway, m_nxdnLookup, rssi);
@ -601,7 +609,8 @@ int CMMDVMHost::run()
m_pocsag = new CPOCSAGControl(m_pocsagNetwork, m_display);
pocsagTimer.start();
if (m_pocsagNetwork != NULL)
pocsagTimer.start();
}
bool remoteControlEnabled = m_conf.getRemoteControlEnabled();
@ -643,6 +652,12 @@ int CMMDVMHost::run()
else if (!error && m_mode == MODE_ERROR)
setMode(MODE_IDLE);
unsigned char mode = m_modem->getMode();
if (mode == MODE_FM && m_mode != MODE_FM)
setMode(mode);
else if (mode != MODE_FM && m_mode == MODE_FM)
setMode(mode);
if (m_ump != NULL) {
bool tx = m_modem->hasTX();
m_ump->setTX(tx);
@ -1150,11 +1165,14 @@ bool CMMDVMHost::createModem()
float p25TXLevel = m_conf.getModemP25TXLevel();
float nxdnTXLevel = m_conf.getModemNXDNTXLevel();
float pocsagTXLevel = m_conf.getModemPOCSAGTXLevel();
float fmTXLevel = m_conf.getModemFMTXLevel();
bool trace = m_conf.getModemTrace();
bool debug = m_conf.getModemDebug();
unsigned int colorCode = m_conf.getDMRColorCode();
bool lowDeviation = m_conf.getFusionLowDeviation();
unsigned int txHang = m_conf.getFusionTXHang();
unsigned int ysfTXHang = m_conf.getFusionTXHang();
unsigned int p25TXHang = m_conf.getP25TXHang();
unsigned int nxdnTXHang = m_conf.getNXDNTXHang();
unsigned int rxFrequency = m_conf.getRXFrequency();
unsigned int txFrequency = m_conf.getTXFrequency();
unsigned int pocsagFrequency = m_conf.getPOCSAGFrequency();
@ -1187,16 +1205,87 @@ bool CMMDVMHost::createModem()
LogInfo(" P25 TX Level: %.1f%%", p25TXLevel);
LogInfo(" NXDN TX Level: %.1f%%", nxdnTXLevel);
LogInfo(" POCSAG TX Level: %.1f%%", pocsagTXLevel);
LogInfo(" RX Frequency: %uHz (%uHz)", rxFrequency, rxFrequency + rxOffset);
LogInfo(" FM TX Level: %.1f%%", fmTXLevel);
LogInfo(" TX Frequency: %uHz (%uHz)", txFrequency, txFrequency + txOffset);
m_modem = CModem::createModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, trace, debug);
m_modem->setSerialParams(protocol,address);
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled, m_nxdnEnabled, m_pocsagEnabled);
m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, pocsagTXLevel);
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled, m_nxdnEnabled, m_pocsagEnabled, m_fmEnabled);
m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, pocsagTXLevel, fmTXLevel);
m_modem->setRFParams(rxFrequency, rxOffset, txFrequency, txOffset, txDCOffset, rxDCOffset, rfLevel, pocsagFrequency);
m_modem->setDMRParams(colorCode);
m_modem->setYSFParams(lowDeviation, txHang);
m_modem->setYSFParams(lowDeviation, ysfTXHang);
m_modem->setP25Params(p25TXHang);
m_modem->setNXDNParams(nxdnTXHang);
if (m_fmEnabled) {
std::string callsign = m_conf.getFMCallsign();
unsigned int callsignSpeed = m_conf.getFMCallsignSpeed();
unsigned int callsignFrequency = m_conf.getFMCallsignFrequency();
unsigned int callsignTime = m_conf.getFMCallsignTime();
unsigned int callsignHoldoff = m_conf.getFMCallsignHoldoff();
float callsignHighLevel = m_conf.getFMCallsignHighLevel();
float callsignLowLevel = m_conf.getFMCallsignLowLevel();
bool callsignAtStart = m_conf.getFMCallsignAtStart();
bool callsignAtEnd = m_conf.getFMCallsignAtEnd();
bool callsignAtLatch = m_conf.getFMCallsignAtLatch();
std::string rfAck = m_conf.getFMRFAck();
std::string extAck = m_conf.getFMExtAck();
unsigned int ackSpeed = m_conf.getFMAckSpeed();
unsigned int ackFrequency = m_conf.getFMAckFrequency();
unsigned int ackMinTime = m_conf.getFMAckMinTime();
unsigned int ackDelay = m_conf.getFMAckDelay();
float ackLevel = m_conf.getFMAckLevel();
unsigned int timeout = m_conf.getFMTimeout();
float timeoutLevel = m_conf.getFMTimeoutLevel();
float ctcssFrequency = m_conf.getFMCTCSSFrequency();
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();
bool useCOS = m_conf.getFMUseCOS();
bool cosInvert = m_conf.getFMCOSInvert();
unsigned int rfAudioBoost = m_conf.getFMRFAudioBoost();
float maxDevLevel = m_conf.getFMMaxDevLevel();
unsigned int extAudioBoost = m_conf.getFMExtAudioBoost();
LogInfo("FM Parameters");
LogInfo(" Callsign: %s", callsign.c_str());
LogInfo(" Callsign Speed: %uWPM", callsignSpeed);
LogInfo(" Callsign Frequency: %uHz", callsignFrequency);
LogInfo(" Callsign Time: %umins", callsignTime);
LogInfo(" Callsign Holdoff: 1/%u", callsignHoldoff);
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(" Callsign At Latch: %s", callsignAtLatch ? "yes" : "no");
LogInfo(" RF Ack: %s", rfAck.c_str());
// LogInfo(" Ext. Ack: %s", extAck.c_str());
LogInfo(" Ack Speed: %uWPM", ackSpeed);
LogInfo(" Ack Frequency: %uHz", ackFrequency);
LogInfo(" Ack Min Time: %us", ackMinTime);
LogInfo(" Ack Delay: %ums", ackDelay);
LogInfo(" Ack Level: %.1f%%", ackLevel);
LogInfo(" Timeout: %us", timeout);
LogInfo(" Timeout Level: %.1f%%", timeoutLevel);
LogInfo(" CTCSS Frequency: %.1fHz", ctcssFrequency);
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);
LogInfo(" Use COS: %s", useCOS ? "yes" : "no");
LogInfo(" COS Invert: %s", cosInvert ? "yes" : "no");
LogInfo(" RF Audio Boost: x%u", rfAudioBoost);
LogInfo(" Max. Deviation Level: %.1f%%", maxDevLevel);
// LogInfo(" Ext. Audio Boost: x%u", extAudioBoost);
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, ctcssHighThreshold, ctcssLowThreshold, ctcssLevel, kerchunkTime, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
}
bool ret = m_modem->open();
if (!ret) {
@ -1451,6 +1540,7 @@ void CMMDVMHost::readParams()
m_p25Enabled = m_conf.getP25Enabled();
m_nxdnEnabled = m_conf.getNXDNEnabled();
m_pocsagEnabled = m_conf.getPOCSAGEnabled();
m_fmEnabled = m_conf.getFMEnabled();
m_duplex = m_conf.getDuplex();
m_callsign = m_conf.getCallsign();
m_id = m_conf.getId();
@ -1467,6 +1557,7 @@ void CMMDVMHost::readParams()
LogInfo(" P25: %s", m_p25Enabled ? "enabled" : "disabled");
LogInfo(" NXDN: %s", m_nxdnEnabled ? "enabled" : "disabled");
LogInfo(" POCSAG: %s", m_pocsagEnabled ? "enabled" : "disabled");
LogInfo(" FM: %s", m_fmEnabled ? "enabled" : "disabled");
}
void CMMDVMHost::setMode(unsigned char mode)
@ -1683,8 +1774,45 @@ void CMMDVMHost::setMode(unsigned char mode)
createLockFile("POCSAG");
break;
case MODE_FM:
if (m_dstarNetwork != NULL)
m_dstarNetwork->enable(false);
if (m_dmrNetwork != NULL)
m_dmrNetwork->enable(false);
if (m_ysfNetwork != NULL)
m_ysfNetwork->enable(false);
if (m_p25Network != NULL)
m_p25Network->enable(false);
if (m_nxdnNetwork != NULL)
m_nxdnNetwork->enable(false);
if (m_pocsagNetwork != NULL)
m_pocsagNetwork->enable(false);
if (m_dstar != NULL)
m_dstar->enable(false);
if (m_dmr != NULL)
m_dmr->enable(false);
if (m_ysf != NULL)
m_ysf->enable(false);
if (m_p25 != NULL)
m_p25->enable(false);
if (m_nxdn != NULL)
m_nxdn->enable(false);
if (m_pocsag != NULL)
m_pocsag->enable(false);
if (m_mode == MODE_DMR && m_duplex && m_modem->hasTX()) {
m_modem->writeDMRStart(false);
m_dmrTXTimer.stop();
}
if (m_ump != NULL)
m_ump->setMode(MODE_FM);
m_display->setFM();
m_mode = MODE_FM;
m_modeTimer.stop();
m_cwIdTimer.stop();
createLockFile("FM");
break;
case MODE_LOCKOUT:
LogMessage("Mode set to Lockout");
if (m_dstarNetwork != NULL)
m_dstarNetwork->enable(false);
if (m_dmrNetwork != NULL)
@ -1864,6 +1992,58 @@ void CMMDVMHost::remoteControl()
if (m_nxdn != NULL)
processModeCommand(MODE_NXDN, m_nxdnRFModeHang);
break;
case RCD_MODE_FM:
if (m_fmEnabled != false)
processModeCommand(MODE_FM, 0);
break;
case RCD_ENABLE_DSTAR:
if (m_dstar != NULL && m_dstarEnabled==false)
processEnableCommand(m_dstarEnabled, true);
break;
case RCD_ENABLE_DMR:
if (m_dmr != NULL && m_dmrEnabled==false)
processEnableCommand(m_dmrEnabled, true);
break;
case RCD_ENABLE_YSF:
if (m_ysf != NULL && m_ysfEnabled==false)
processEnableCommand(m_ysfEnabled, true);
break;
case RCD_ENABLE_P25:
if (m_p25 != NULL && m_p25Enabled==false)
processEnableCommand(m_p25Enabled, true);
break;
case RCD_ENABLE_NXDN:
if (m_nxdn != NULL && m_nxdnEnabled==false)
processEnableCommand(m_nxdnEnabled, true);
break;
case RCD_ENABLE_FM:
if (m_fmEnabled==false)
processEnableCommand(m_fmEnabled, true);
break;
case RCD_DISABLE_DSTAR:
if (m_dstar != NULL && m_dstarEnabled==true)
processEnableCommand(m_dstarEnabled, false);
break;
case RCD_DISABLE_DMR:
if (m_dmr != NULL && m_dmrEnabled==true)
processEnableCommand(m_dmrEnabled, false);
break;
case RCD_DISABLE_YSF:
if (m_ysf != NULL && m_ysfEnabled==true)
processEnableCommand(m_ysfEnabled, false);
break;
case RCD_DISABLE_P25:
if (m_p25 != NULL && m_p25Enabled==true)
processEnableCommand(m_p25Enabled, false);
break;
case RCD_DISABLE_NXDN:
if (m_nxdn != NULL && m_nxdnEnabled==true)
processEnableCommand(m_nxdnEnabled, false);
break;
case RCD_DISABLE_FM:
if (m_fmEnabled == true)
processEnableCommand(m_fmEnabled, false);
break;
case RCD_PAGE:
if (m_pocsag != NULL) {
unsigned int ric = m_remoteControl->getArgUInt(0U);
@ -1875,6 +2055,18 @@ void CMMDVMHost::remoteControl()
}
m_pocsag->sendPage(ric, text);
}
case RCD_CW:
setMode(MODE_IDLE); // Force the modem to go idle so that we can send the CW text.
if (!m_modem->hasTX()){
std::string cwtext;
for (unsigned int i = 0U; i < m_remoteControl->getArgCount(); i++) {
if (i > 0U)
cwtext += " ";
cwtext += m_remoteControl->getArgString(i);
}
m_display->writeCW();
m_modem->sendCWId(cwtext);
}
default:
break;
}
@ -1897,3 +2089,12 @@ void CMMDVMHost::processModeCommand(unsigned char mode, unsigned int timeout)
setMode(mode);
}
void CMMDVMHost::processEnableCommand(bool& mode, bool enabled)
{
LogDebug("Setting mode current=%s new=%s",mode ? "true" : "false",enabled ? "true" : "false");
mode=enabled;
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled, m_nxdnEnabled, m_pocsagEnabled, m_fmEnabled);
if (!m_modem->writeConfig())
LogError("Cannot write Config to MMDVM");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -93,6 +93,7 @@ private:
bool m_p25Enabled;
bool m_nxdnEnabled;
bool m_pocsagEnabled;
bool m_fmEnabled;
unsigned int m_cwIdTime;
CDMRLookup* m_dmrLookup;
CNXDNLookup* m_nxdnLookup;
@ -116,6 +117,7 @@ private:
void remoteControl();
void processModeCommand(unsigned char mode, unsigned int timeout);
void processEnableCommand(bool& mode, bool enabled);
void setMode(unsigned char mode);

View file

@ -238,6 +238,8 @@
<ClInclude Include="Timer.h" />
<ClInclude Include="UDPSocket.h" />
<ClInclude Include="UMP.h" />
<ClInclude Include="UserDB.h" />
<ClInclude Include="UserDBentry.h" />
<ClInclude Include="Utils.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="YSFControl.h" />
@ -327,6 +329,8 @@
<ClCompile Include="Timer.cpp" />
<ClCompile Include="UDPSocket.cpp" />
<ClCompile Include="UMP.cpp" />
<ClCompile Include="UserDB.cpp" />
<ClCompile Include="UserDBentry.cpp" />
<ClCompile Include="Utils.cpp" />
<ClCompile Include="YSFNetwork.cpp" />
<ClCompile Include="YSFPayload.cpp" />

View file

@ -293,6 +293,12 @@
<ClInclude Include="TFTSurenoo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="UserDB.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="UserDBentry.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BPTC19696.cpp">
@ -550,5 +556,11 @@
<ClCompile Include="TFTSurenoo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UserDB.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UserDBentry.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

336
Modem.cpp
View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2018 by Jonathan Naylor G4KLX
* Copyright (C) 2011-2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -76,6 +76,10 @@ const unsigned char MMDVM_NXDN_LOST = 0x41U;
const unsigned char MMDVM_POCSAG_DATA = 0x50U;
const unsigned char MMDVM_FM_PARAMS1 = 0x60U;
const unsigned char MMDVM_FM_PARAMS2 = 0x61U;
const unsigned char MMDVM_FM_PARAMS3 = 0x62U;
const unsigned char MMDVM_ACK = 0x70U;
const unsigned char MMDVM_NAK = 0x7FU;
@ -100,6 +104,8 @@ m_port(port),
m_dmrColorCode(0U),
m_ysfLoDev(false),
m_ysfTXHang(4U),
m_p25TXHang(5U),
m_nxdnTXHang(5U),
m_duplex(duplex),
m_rxInvert(rxInvert),
m_txInvert(txInvert),
@ -114,6 +120,7 @@ m_ysfTXLevel(0U),
m_p25TXLevel(0U),
m_nxdnTXLevel(0U),
m_pocsagTXLevel(0U),
m_fmTXLevel(0U),
m_trace(trace),
m_debug(debug),
m_rxFrequency(0U),
@ -125,6 +132,7 @@ m_ysfEnabled(false),
m_p25Enabled(false),
m_nxdnEnabled(false),
m_pocsagEnabled(false),
m_fmEnabled(false),
m_rxDCOffset(0),
m_txDCOffset(0),
m_serial(NULL),
@ -161,11 +169,40 @@ m_tx(false),
m_cd(false),
m_lockout(false),
m_error(false),
m_hwType(HWT_UNKNOWN)
m_mode(MODE_IDLE),
m_hwType(HWT_UNKNOWN),
m_fmCallsign(),
m_fmCallsignSpeed(20U),
m_fmCallsignFrequency(1000U),
m_fmCallsignTime(600U),
m_fmCallsignHoldoff(0U),
m_fmCallsignHighLevel(35.0F),
m_fmCallsignLowLevel(15.0F),
m_fmCallsignAtStart(true),
m_fmCallsignAtEnd(true),
m_fmCallsignAtLatch(true),
m_fmRfAck("K"),
m_fmAckSpeed(20U),
m_fmAckFrequency(1750U),
m_fmAckMinTime(4U),
m_fmAckDelay(1000U),
m_fmAckLevel(80.0F),
m_fmTimeout(120U),
m_fmTimeoutLevel(80.0F),
m_fmCtcssFrequency(88.4F),
m_fmCtcssHighThreshold(30U),
m_fmCtcssLowThreshold(20U),
m_fmCtcssLevel(10.0F),
m_fmKerchunkTime(0U),
m_fmHangTime(5U),
m_fmUseCOS(true),
m_fmCOSInvert(false),
m_fmRFAudioBoost(1U),
m_fmMaxDevLevel(90.0F)
{
assert(!port.empty());
m_buffer = new unsigned char[BUFFER_LENGTH];
assert(!port.empty());
}
CModem::~CModem()
@ -193,7 +230,7 @@ void CModem::setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int tx
m_pocsagFrequency = pocsagFrequency + txOffset;
}
void CModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool pocsagEnabled)
void CModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool pocsagEnabled, bool fmEnabled)
{
m_dstarEnabled = dstarEnabled;
m_dmrEnabled = dmrEnabled;
@ -201,9 +238,10 @@ void CModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled,
m_p25Enabled = p25Enabled;
m_nxdnEnabled = nxdnEnabled;
m_pocsagEnabled = pocsagEnabled;
m_fmEnabled = fmEnabled;
}
void CModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float pocsagTXLevel)
void CModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float pocsagTXLevel, float fmTXLevel)
{
m_rxLevel = rxLevel;
m_cwIdTXLevel = cwIdTXLevel;
@ -213,6 +251,7 @@ void CModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, flo
m_p25TXLevel = p25TXLevel;
m_nxdnTXLevel = nxdnTXLevel;
m_pocsagTXLevel = pocsagTXLevel;
m_fmTXLevel = fmTXLevel;
}
void CModem::setDMRParams(unsigned int colorCode)
@ -228,6 +267,16 @@ void CModem::setYSFParams(bool loDev, unsigned int txHang)
m_ysfTXHang = txHang;
}
void CModem::setP25Params(unsigned int txHang)
{
m_p25TXHang = txHang;
}
void CModem::setNXDNParams(unsigned int txHang)
{
m_nxdnTXHang = txHang;
}
void CModem::setTransparentDataParams(unsigned int sendFrameType)
{
m_sendTransparentDataFrameType = sendFrameType;
@ -269,6 +318,32 @@ bool CModem::open()
return false;
}
if (m_fmEnabled && m_duplex) {
ret = setFMCallsignParams();
if (!ret) {
m_serial->close();
delete m_serial;
m_serial = NULL;
return false;
}
ret = setFMAckParams();
if (!ret) {
m_serial->close();
delete m_serial;
m_serial = NULL;
return false;
}
ret = setFMMiscParams();
if (!ret) {
m_serial->close();
delete m_serial;
m_serial = NULL;
return false;
}
}
m_statusTimer.start();
m_error = false;
@ -518,6 +593,8 @@ void CModem::clock(unsigned int ms)
m_nxdnSpace = 0U;
m_pocsagSpace = 0U;
m_mode = m_buffer[4U];
m_tx = (m_buffer[5U] & 0x01U) == 0x01U;
bool adcOverflow = (m_buffer[5U] & 0x02U) == 0x02U;
@ -1429,6 +1506,11 @@ bool CModem::readStatus()
return m_serial->write(buffer, 3U) == 3;
}
bool CModem::writeConfig()
{
return setConfig();
}
bool CModem::setConfig()
{
assert(m_serial != NULL);
@ -1437,7 +1519,7 @@ bool CModem::setConfig()
buffer[0U] = MMDVM_FRAME_START;
buffer[1U] = 21U;
buffer[1U] = 24U;
buffer[2U] = MMDVM_SET_CONFIG;
@ -1468,6 +1550,8 @@ bool CModem::setConfig()
buffer[4U] |= 0x10U;
if (m_pocsagEnabled)
buffer[4U] |= 0x20U;
if (m_fmEnabled && m_duplex)
buffer[4U] |= 0x40U;
buffer[5U] = m_txDelay / 10U; // In 10ms units
@ -1497,10 +1581,16 @@ bool CModem::setConfig()
buffer[20U] = (unsigned char)(m_pocsagTXLevel * 2.55F + 0.5F);
// CUtils::dump(1U, "Written", buffer, 21U);
buffer[21U] = (unsigned char)(m_fmTXLevel * 2.55F + 0.5F);
int ret = m_serial->write(buffer, 21U);
if (ret != 21)
buffer[22U] = (unsigned char)m_p25TXHang;
buffer[23U] = (unsigned char)m_nxdnTXHang;
// CUtils::dump(1U, "Written", buffer, 24U);
int ret = m_serial->write(buffer, 24U);
if (ret != 24)
return false;
unsigned int count = 0U;
@ -1706,6 +1796,11 @@ HW_TYPE CModem::getHWType() const
return m_hwType;
}
unsigned char CModem::getMode() const
{
return m_mode;
}
bool CModem::setMode(unsigned char mode)
{
assert(m_serial != NULL);
@ -1811,6 +1906,227 @@ 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 callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch)
{
m_fmCallsign = callsign;
m_fmCallsignSpeed = callsignSpeed;
m_fmCallsignFrequency = callsignFrequency;
m_fmCallsignTime = callsignTime;
m_fmCallsignHoldoff = callsignHoldoff;
m_fmCallsignHighLevel = callsignHighLevel;
m_fmCallsignLowLevel = callsignLowLevel;
m_fmCallsignAtStart = callsignAtStart;
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)
{
m_fmRfAck = rfAck;
m_fmAckSpeed = ackSpeed;
m_fmAckFrequency = ackFrequency;
m_fmAckMinTime = ackMinTime;
m_fmAckDelay = ackDelay;
m_fmAckLevel = ackLevel;
}
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_fmCtcssHighThreshold = ctcssHighThreshold;
m_fmCtcssLowThreshold = ctcssLowThreshold;
m_fmCtcssLevel = ctcssLevel;
m_fmKerchunkTime = kerchunkTime;
m_fmHangTime = hangTime;
m_fmUseCOS = useCOS;
m_fmCOSInvert = cosInvert;
m_fmRFAudioBoost = rfAudioBoost;
m_fmMaxDevLevel = maxDevLevel;
}
bool CModem::setFMCallsignParams()
{
assert(m_serial != NULL);
unsigned char buffer[80U];
unsigned char len = 10U + m_fmCallsign.size();
buffer[0U] = MMDVM_FRAME_START;
buffer[1U] = len;
buffer[2U] = MMDVM_FM_PARAMS1;
buffer[3U] = m_fmCallsignSpeed;
buffer[4U] = m_fmCallsignFrequency / 10U;
buffer[5U] = m_fmCallsignTime;
buffer[6U] = m_fmCallsignHoldoff;
buffer[7U] = (unsigned char)(m_fmCallsignHighLevel * 2.55F + 0.5F);
buffer[8U] = (unsigned char)(m_fmCallsignLowLevel * 2.55F + 0.5F);
buffer[9U] = 0x00U;
if (m_fmCallsignAtStart)
buffer[9U] |= 0x01U;
if (m_fmCallsignAtEnd)
buffer[9U] |= 0x02U;
if (m_fmCallsignAtLatch)
buffer[9U] |= 0x04U;
for (unsigned int i = 0U; i < m_fmCallsign.size(); i++)
buffer[10U + i] = m_fmCallsign.at(i);
// CUtils::dump(1U, "Written", buffer, len);
int ret = m_serial->write(buffer, len);
if (ret != len)
return false;
unsigned int count = 0U;
RESP_TYPE_MMDVM resp;
do {
CThread::sleep(10U);
resp = getResponse();
if (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK) {
count++;
if (count >= MAX_RESPONSES) {
LogError("The MMDVM is not responding to the SET_FM_PARAMS1 command");
return false;
}
}
} while (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK);
// CUtils::dump(1U, "Response", m_buffer, m_length);
if (resp == RTM_OK && m_buffer[2U] == MMDVM_NAK) {
LogError("Received a NAK to the SET_FM_PARAMS1 command from the modem");
return false;
}
return true;
}
bool CModem::setFMAckParams()
{
assert(m_serial != NULL);
unsigned char buffer[80U];
unsigned char len = 8U + m_fmRfAck.size();
buffer[0U] = MMDVM_FRAME_START;
buffer[1U] = len;
buffer[2U] = MMDVM_FM_PARAMS2;
buffer[3U] = m_fmAckSpeed;
buffer[4U] = m_fmAckFrequency / 10U;
buffer[5U] = m_fmAckMinTime;
buffer[6U] = m_fmAckDelay / 10U;
buffer[7U] = (unsigned char)(m_fmAckLevel * 2.55F + 0.5F);
for (unsigned int i = 0U; i < m_fmRfAck.size(); i++)
buffer[8U + i] = m_fmRfAck.at(i);
// CUtils::dump(1U, "Written", buffer, len);
int ret = m_serial->write(buffer, len);
if (ret != len)
return false;
unsigned int count = 0U;
RESP_TYPE_MMDVM resp;
do {
CThread::sleep(10U);
resp = getResponse();
if (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK) {
count++;
if (count >= MAX_RESPONSES) {
LogError("The MMDVM is not responding to the SET_FM_PARAMS2 command");
return false;
}
}
} while (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK);
// CUtils::dump(1U, "Response", m_buffer, m_length);
if (resp == RTM_OK && m_buffer[2U] == MMDVM_NAK) {
LogError("Received a NAK to the SET_FM_PARAMS2 command from the modem");
return false;
}
return true;
}
bool CModem::setFMMiscParams()
{
assert(m_serial != NULL);
unsigned char buffer[20U];
buffer[0U] = MMDVM_FRAME_START;
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_fmCtcssHighThreshold;
buffer[7U] = m_fmCtcssLowThreshold;
buffer[8U] = (unsigned char)(m_fmCtcssLevel * 2.55F + 0.5F);
buffer[9U] = m_fmKerchunkTime;
buffer[10U] = m_fmHangTime;
buffer[11U] = 0x00U;
if (m_fmUseCOS)
buffer[11U] |= 0x01U;
if (m_fmCOSInvert)
buffer[11U] |= 0x02U;
buffer[12U] = m_fmRFAudioBoost;
buffer[13U] = (unsigned char)(m_fmMaxDevLevel * 2.55F + 0.5F);
buffer[14U] = (unsigned char)(m_rxLevel * 2.55F + 0.5F);
// CUtils::dump(1U, "Written", buffer, 15U);
int ret = m_serial->write(buffer, 15U);
if (ret != 15)
return false;
unsigned int count = 0U;
RESP_TYPE_MMDVM resp;
do {
CThread::sleep(10U);
resp = getResponse();
if (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK) {
count++;
if (count >= MAX_RESPONSES) {
LogError("The MMDVM is not responding to the SET_FM_PARAMS3 command");
return false;
}
}
} while (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK);
// CUtils::dump(1U, "Response", m_buffer, m_length);
if (resp == RTM_OK && m_buffer[2U] == MMDVM_NAK) {
LogError("Received a NAK to the SET_FM_PARAMS3 command from the modem");
return false;
}
return true;
}
void CModem::printDebug()
{
if (m_buffer[2U] == MMDVM_DEBUG1) {

51
Modem.h
View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2018 by Jonathan Naylor G4KLX
* Copyright (C) 2011-2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -39,12 +39,18 @@ public:
virtual void setSerialParams(const std::string& protocol, unsigned int address);
virtual void setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int txFrequency, int txOffset, int txDCOffset, int rxDCOffset, float rfLevel, unsigned int pocsagFrequency);
virtual void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool pocsagEnabled);
virtual void setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float pocsagLevel);
virtual void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool pocsagEnabled, bool fmEnabled);
virtual void setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float pocsagLevel, float fmTXLevel);
virtual void setDMRParams(unsigned int colorCode);
virtual void setYSFParams(bool loDev, unsigned int txHang);
virtual void setP25Params(unsigned int txHang);
virtual void setNXDNParams(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 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 ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel);
virtual bool open();
virtual unsigned int readDStarData(unsigned char* data);
@ -71,6 +77,7 @@ public:
virtual bool hasLockout() const;
virtual bool hasError() const;
virtual bool writeConfig();
virtual bool writeDStarData(const unsigned char* data, unsigned int length);
virtual bool writeDMRData1(const unsigned char* data, unsigned int length);
virtual bool writeDMRData2(const unsigned char* data, unsigned int length);
@ -95,6 +102,7 @@ public:
virtual bool writeSerial(const unsigned char* data, unsigned int length);
virtual unsigned char getMode() const;
virtual bool setMode(unsigned char mode);
virtual bool sendCWId(const std::string& callsign);
@ -112,6 +120,8 @@ private:
unsigned int m_dmrColorCode;
bool m_ysfLoDev;
unsigned int m_ysfTXHang;
unsigned int m_p25TXHang;
unsigned int m_nxdnTXHang;
bool m_duplex;
bool m_rxInvert;
bool m_txInvert;
@ -126,6 +136,7 @@ private:
float m_p25TXLevel;
float m_nxdnTXLevel;
float m_pocsagTXLevel;
float m_fmTXLevel;
float m_rfLevel;
bool m_trace;
bool m_debug;
@ -138,6 +149,7 @@ private:
bool m_p25Enabled;
bool m_nxdnEnabled;
bool m_pocsagEnabled;
bool m_fmEnabled;
int m_rxDCOffset;
int m_txDCOffset;
CSerialController* m_serial;
@ -174,12 +186,45 @@ private:
bool m_cd;
bool m_lockout;
bool m_error;
unsigned char m_mode;
HW_TYPE m_hwType;
std::string m_fmCallsign;
unsigned int m_fmCallsignSpeed;
unsigned int m_fmCallsignFrequency;
unsigned int m_fmCallsignTime;
unsigned int m_fmCallsignHoldoff;
float m_fmCallsignHighLevel;
float m_fmCallsignLowLevel;
bool m_fmCallsignAtStart;
bool m_fmCallsignAtEnd;
bool m_fmCallsignAtLatch;
std::string m_fmRfAck;
unsigned int m_fmAckSpeed;
unsigned int m_fmAckFrequency;
unsigned int m_fmAckMinTime;
unsigned int m_fmAckDelay;
float m_fmAckLevel;
unsigned int m_fmTimeout;
float m_fmTimeoutLevel;
float m_fmCtcssFrequency;
unsigned int m_fmCtcssHighThreshold;
unsigned int m_fmCtcssLowThreshold;
float m_fmCtcssLevel;
unsigned int m_fmKerchunkTime;
unsigned int m_fmHangTime;
bool m_fmUseCOS;
bool m_fmCOSInvert;
unsigned int m_fmRFAudioBoost;
float m_fmMaxDevLevel;
bool readVersion();
bool readStatus();
bool setConfig();
bool setFrequency();
bool setFMCallsignParams();
bool setFMAckParams();
bool setFMMiscParams();
void printDebug();

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -102,7 +102,6 @@ bool CNextion::open()
return true;
}
void CNextion::setIdleInt()
{
// a few bits borrowed from Lieven De Samblanx ON7LDS, NextionDriver
@ -240,6 +239,25 @@ void CNextion::setQuitInt()
m_mode = MODE_QUIT;
}
void CNextion::setFMInt()
{
sendCommand("page MMDVM");
sendCommandAction(1U);
char command[20];
if (m_brightness > 0) {
::sprintf(command, "dim=%u", m_brightness);
sendCommand(command);
}
sendCommand("t0.txt=\"FM\"");
sendCommandAction(15U);
m_clockDisplayTimer.stop();
m_mode = MODE_FM;
}
void CNextion::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
assert(my1 != NULL);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -41,6 +41,7 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void writeDStarRSSIInt(unsigned char rssi);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -60,6 +60,10 @@ void CNullDisplay::setQuitInt()
{
}
void CNullDisplay::setFMInt()
{
}
void CNullDisplay::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
#if defined(RASPBERRY_PI)

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,6 +38,7 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStarInt();

View file

@ -32,8 +32,8 @@ public:
virtual void setSerialParams(const std::string& protocol, unsigned int address){};
virtual void setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int txFrequency, int txOffset, int txDCOffset, int rxDCOffset, float rfLevel, unsigned int pocsagFrequency){};
virtual void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool pocsagEnabled){};
virtual void setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float pocsagLevel){};
virtual void setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool pocsagEnabled, bool fmEnabled){};
virtual void setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, float dmrTXLevel, float ysfTXLevel, float p25TXLevel, float nxdnTXLevel, float pocsagLevel, float fmTXLevel){};
virtual void setDMRParams(unsigned int colorCode){};
virtual void setYSFParams(bool loDev, unsigned int txHang){};
virtual void setTransparentDataParams(unsigned int sendFrameType){};

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -306,6 +306,21 @@ void COLED::setQuitInt()
m_display.display();
}
void COLED::setFMInt()
{
m_mode = MODE_FM;
m_display.clearDisplay();
OLED_statusbar();
m_display.setCursor(0,30);
m_display.setTextSize(3);
m_display.print("FM");
m_display.setTextSize(1);
m_display.display();
}
void COLED::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
m_mode = MODE_DSTAR;

3
OLED.h
View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -50,6 +50,7 @@ public:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStarInt();

View file

@ -1,8 +1,21 @@
These are the source files for building the MMDVMHost, the program that interfaces to the MMDVM or DVMega on the one side, and a suitable network on the other. It supports D-Star, DMR, P25 Phase 1, NXDN, System Fusion, and POCSAG paging on the MMDVM, and D-Star, DMR, and System Fusion on the DVMega.
These are the source files for building the MMDVMHost, the program that
interfaces to the MMDVM or DVMega on the one side, and a suitable network on
the other. It supports D-Star, DMR, P25 Phase 1, NXDN, System Fusion,
POCSAG, and FM on the MMDVM, and D-Star, DMR, and System Fusion on the DVMega.
On the D-Star side the MMDVMHost interfaces with the ircDDB Gateway, on DMR it can connect to BrandMeister, DMR+, HB Link, XLX or [DMRGateway](https://github.com/g4klx/DMRGateway) (to connect to multiple DMR networks at once) on System Fusion it connects to the YSF Gateway to allow access to the FCS and YSF networks. On P25 it connects to the P25 Gateway. On NXDN it connects to the NXDN Gateway which provides access to the NXDN and NXCore talk groups. Finally it uses the DAPNET Gateway to access DAPNET to receive paging messages.
On the D-Star side the MMDVMHost interfaces with the ircDDB Gateway, on DMR it
can connect to BrandMeister, DMR+, TGIF, HB Link, XLX or
[DMRGateway](https://github.com/g4klx/DMRGateway) (to connect to multiple DMR
networks at once) on System Fusion it connects to the YSF Gateway to allow
access to the FCS and YSF networks. On P25 it connects to the P25 Gateway. On
NXDN it connects to the NXDN Gateway which provides access to the NXDN and
NXCore talk groups. It uses the DAPNET Gateway to access DAPNET to receive
paging messages. Finally it uses the FM Gateway to interface to existing FM
networks.
It builds on 32-bit and 64-bit Linux as well as on Windows using Visual Studio 2017 on x86 and x64. It can optionally control various Displays. Currently these are:
It builds on 32-bit and 64-bit Linux as well as on Windows using Visual Studio
2019 on x86 and x64. It can optionally control various Displays. Currently
these are:
- HD44780 (sizes 2x16, 2x40, 4x16, 4x20)
- Support for HD44780 via 4 bit GPIO connection (user selectable pins)
@ -13,14 +26,23 @@ It builds on 32-bit and 64-bit Linux as well as on Windows using Visual Studio 2
- OLED 128x64 (SSD1306)
- LCDproc
The Nextion displays can connect to the UART on the Raspberry Pi, or via a USB to TTL serial converter like the FT-232RL. It may also be connected to the UART output of the MMDVM modem (Arduino Due, STM32, Teensy), or to the UART output on the UMP.
The Nextion displays can connect to the UART on the Raspberry Pi, or via a USB
to TTL serial converter like the FT-232RL. It may also be connected to the UART
output of the MMDVM modem (Arduino Due, STM32, Teensy), or to the UART output
on the UMP.
The HD44780 displays are integrated with wiringPi for Raspberry Pi based platforms.
The HD44780 displays are integrated with wiringPi for Raspberry Pi based
platforms.
The Hobbytronics TFT Display, which is a Pi-Hat, connects to the UART on the Raspbery Pi.
The Hobbytronics TFT Display, which is a Pi-Hat, connects to the UART on the
Raspbery Pi.
The OLED display needs a extra library see OLED.md
The OLED display needs an extra library see OLED.md
The LCDproc support enables the use of a multitude of other LCD screens. See the [supported devices](http://lcdproc.omnipotent.net/hardware.php3) page on the LCDproc website for more info.
The LCDproc support enables the use of a multitude of other LCD screens. See
the [supported devices](http://lcdproc.omnipotent.net/hardware.php3) page on
the LCDproc website for more info.
This software is licenced under the GPL v2 and is intended for amateur and educational use only. Use of this software for commercial purposes is strictly forbidden.
This software is licenced under the GPL v2 and is intended for amateur and
educational use only. Use of this software for commercial purposes is strictly
forbidden.

View file

@ -51,7 +51,7 @@ int main(int argc, char** argv)
CRemoteCommand::CRemoteCommand(unsigned int port) :
m_port(port)
{
::LogInitialise(".", "RemoteCommand", 2U, 2U);
::LogInitialise(false, ".", "RemoteCommand", 2U, 2U);
}
CRemoteCommand::~CRemoteCommand()

View file

@ -25,7 +25,10 @@
#include <cstring>
const unsigned int SET_MODE_ARGS = 2U;
const unsigned int ENABLE_ARGS = 2U;
const unsigned int DISABLE_ARGS = 2U;
const unsigned int PAGE_ARGS = 3U;
const unsigned int CW_ARGS = 2U;
const unsigned int BUFFER_LENGTH = 100U;
@ -86,10 +89,39 @@ REMOTE_COMMAND CRemoteControl::getCommand()
m_command = RCD_MODE_P25;
else if (m_args.at(1U) == "nxdn")
m_command = RCD_MODE_NXDN;
} else if (m_args.at(0U) == "enable" && m_args.size() >= ENABLE_ARGS) {
if (m_args.at(1U) == "dstar")
m_command = RCD_ENABLE_DSTAR;
else if (m_args.at(1U) == "dmr")
m_command = RCD_ENABLE_DMR;
else if (m_args.at(1U) == "ysf")
m_command = RCD_ENABLE_YSF;
else if (m_args.at(1U) == "p25")
m_command = RCD_ENABLE_P25;
else if (m_args.at(1U) == "nxdn")
m_command = RCD_ENABLE_NXDN;
else if (m_args.at(1U) == "fm")
m_command = RCD_ENABLE_FM;
} else if (m_args.at(0U) == "disable" && m_args.size() >= DISABLE_ARGS) {
if (m_args.at(1U) == "dstar")
m_command = RCD_DISABLE_DSTAR;
else if (m_args.at(1U) == "dmr")
m_command = RCD_DISABLE_DMR;
else if (m_args.at(1U) == "ysf")
m_command = RCD_DISABLE_YSF;
else if (m_args.at(1U) == "p25")
m_command = RCD_DISABLE_P25;
else if (m_args.at(1U) == "nxdn")
m_command = RCD_DISABLE_NXDN;
else if (m_args.at(1U) == "fm")
m_command = RCD_DISABLE_FM;
} else if (m_args.at(0U) == "page" && m_args.size() >= PAGE_ARGS) {
// Page command is in the form of "page <ric> <message>"
m_command = RCD_PAGE;
}
} else if (m_args.at(0U) == "cw" && m_args.size() >= CW_ARGS) {
// CW command is in the form of "cw <message>"
m_command = RCD_CW;
}
if (m_command == RCD_NONE) {
m_args.clear();
@ -115,6 +147,8 @@ unsigned int CRemoteControl::getArgCount() const
return m_args.size() - SET_MODE_ARGS;
case RCD_PAGE:
return m_args.size() - 1U;
case RCD_CW:
return m_args.size() - 1U;
default:
return 0U;
}
@ -135,6 +169,9 @@ std::string CRemoteControl::getArgString(unsigned int n) const
case RCD_PAGE:
n += 1U;
break;
case RCD_CW:
n += 1U;
break;
default:
return "";
}

View file

@ -33,7 +33,21 @@ enum REMOTE_COMMAND {
RCD_MODE_YSF,
RCD_MODE_P25,
RCD_MODE_NXDN,
RCD_PAGE
RCD_MODE_FM,
RCD_ENABLE_DSTAR,
RCD_ENABLE_DMR,
RCD_ENABLE_YSF,
RCD_ENABLE_P25,
RCD_ENABLE_NXDN,
RCD_ENABLE_FM,
RCD_DISABLE_DSTAR,
RCD_DISABLE_DMR,
RCD_DISABLE_YSF,
RCD_DISABLE_P25,
RCD_DISABLE_NXDN,
RCD_DISABLE_FM,
RCD_PAGE,
RCD_CW
};
class CRemoteControl {

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -161,6 +161,22 @@ void CTFTSerial::setQuitInt()
m_mode = MODE_QUIT;
}
void CTFTSerial::setFMInt()
{
// Clear the screen
clearScreen();
setFontSize(FONT_LARGE);
// Draw MMDVM logo
displayBitmap(0U, 0U, "MMDVM_sm.bmp");
gotoPosPixel(20U, 60U);
displayText("FM");
m_mode = MODE_FM;
}
void CTFTSerial::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
assert(my1 != NULL);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -40,6 +40,7 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStarInt();

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2019 by SASANO Takayoshi JG1UAA
* Copyright (C) 2015,2016,2018,2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2018,2019,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -174,6 +174,14 @@ void CTFTSurenoo::setQuitInt()
m_mode = MODE_QUIT;
}
void CTFTSurenoo::setFMInt()
{
setModeLine(STR_MMDVM);
setStatusLine(statusLineNo(1), "FM");
m_mode = MODE_FM;
}
void CTFTSurenoo::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
{
assert(my1 != NULL);

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2019 by SASANO Takayoshi JG1UAA
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2018,2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,7 @@ protected:
virtual void setErrorInt(const char* text);
virtual void setLockoutInt();
virtual void setQuitInt();
virtual void setFMInt();
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
virtual void clearDStarInt();

View file

@ -42,7 +42,7 @@ bool CUserDB::lookup(unsigned int id, class CUserDBentry *entry)
if (entry != NULL)
*entry = m_table.at(id);
else
m_table.at(id);
(void)m_table.at(id);
rv = true;
} catch (...) {
@ -116,8 +116,8 @@ bool CUserDB::makeindex(char* buf, std::unordered_map<std::string, int>& index)
}
try {
index.at(keyRADIO_ID);
index.at(keyCALLSIGN);
(void)index.at(keyRADIO_ID);
(void)index.at(keyCALLSIGN);
return true;
} catch (...) {
return false;
@ -144,8 +144,8 @@ void CUserDB::parse(char* buf, std::unordered_map<std::string, int>& index)
}
try {
ptr.at(keyRADIO_ID);
ptr.at(keyCALLSIGN);
(void)ptr.at(keyRADIO_ID);
(void)ptr.at(keyCALLSIGN);
} catch (...) {
return;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015-2020 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20190131";
const char* VERSION = "20200608";
#endif