Merge branch 'master' into FM
This commit is contained in:
commit
549abfbeef
71
Conf.cpp
71
Conf.cpp
|
@ -57,7 +57,7 @@ enum SECTION {
|
||||||
SECTION_OLED,
|
SECTION_OLED,
|
||||||
SECTION_LCDPROC,
|
SECTION_LCDPROC,
|
||||||
SECTION_LOCK_FILE,
|
SECTION_LOCK_FILE,
|
||||||
SECTION_MOBILE_GPS,
|
SECTION_GPSD,
|
||||||
SECTION_REMOTE_CONTROL
|
SECTION_REMOTE_CONTROL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ m_modemNXDNTXLevel(50.0F),
|
||||||
m_modemPOCSAGTXLevel(50.0F),
|
m_modemPOCSAGTXLevel(50.0F),
|
||||||
m_modemFMTXLevel(50.0F),
|
m_modemFMTXLevel(50.0F),
|
||||||
m_modemRSSIMappingFile(),
|
m_modemRSSIMappingFile(),
|
||||||
|
m_modemUseCOSAsLockout(false),
|
||||||
m_modemTrace(false),
|
m_modemTrace(false),
|
||||||
m_modemDebug(false),
|
m_modemDebug(false),
|
||||||
m_transparentEnabled(false),
|
m_transparentEnabled(false),
|
||||||
|
@ -199,9 +200,8 @@ m_fmCTCSSHighThreshold(30U),
|
||||||
m_fmCTCSSLowThreshold(20U),
|
m_fmCTCSSLowThreshold(20U),
|
||||||
m_fmCTCSSLevel(2.0F),
|
m_fmCTCSSLevel(2.0F),
|
||||||
m_fmKerchunkTime(0U),
|
m_fmKerchunkTime(0U),
|
||||||
m_fmKerchunkTX(true),
|
|
||||||
m_fmHangTime(7U),
|
m_fmHangTime(7U),
|
||||||
m_fmUseCOS(true),
|
m_fmAccessMode(1U),
|
||||||
m_fmCOSInvert(false),
|
m_fmCOSInvert(false),
|
||||||
m_fmRFAudioBoost(1U),
|
m_fmRFAudioBoost(1U),
|
||||||
m_fmMaxDevLevel(90.0F),
|
m_fmMaxDevLevel(90.0F),
|
||||||
|
@ -284,9 +284,9 @@ m_lcdprocUTC(false),
|
||||||
m_lcdprocDimOnIdle(false),
|
m_lcdprocDimOnIdle(false),
|
||||||
m_lockFileEnabled(false),
|
m_lockFileEnabled(false),
|
||||||
m_lockFileName(),
|
m_lockFileName(),
|
||||||
m_mobileGPSEnabled(false),
|
m_gpsdEnabled(false),
|
||||||
m_mobileGPSAddress(),
|
m_gpsdAddress(),
|
||||||
m_mobileGPSPort(0U),
|
m_gpsdPort(),
|
||||||
m_remoteControlEnabled(false),
|
m_remoteControlEnabled(false),
|
||||||
m_remoteControlPort(0U)
|
m_remoteControlPort(0U)
|
||||||
{
|
{
|
||||||
|
@ -368,8 +368,8 @@ bool CConf::read()
|
||||||
section = SECTION_LCDPROC;
|
section = SECTION_LCDPROC;
|
||||||
else if (::strncmp(buffer, "[Lock File]", 11U) == 0)
|
else if (::strncmp(buffer, "[Lock File]", 11U) == 0)
|
||||||
section = SECTION_LOCK_FILE;
|
section = SECTION_LOCK_FILE;
|
||||||
else if (::strncmp(buffer, "[Mobile GPS]", 12U) == 0)
|
else if (::strncmp(buffer, "[GPSD]", 6U) == 0)
|
||||||
section = SECTION_MOBILE_GPS;
|
section = SECTION_GPSD;
|
||||||
else if (::strncmp(buffer, "[Remote Control]", 16U) == 0)
|
else if (::strncmp(buffer, "[Remote Control]", 16U) == 0)
|
||||||
section = SECTION_REMOTE_CONTROL;
|
section = SECTION_REMOTE_CONTROL;
|
||||||
else
|
else
|
||||||
|
@ -391,6 +391,17 @@ bool CConf::read()
|
||||||
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
||||||
value[len - 1U] = '\0';
|
value[len - 1U] = '\0';
|
||||||
value++;
|
value++;
|
||||||
|
} else {
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
// if value is not quoted, remove after # (to make comment)
|
||||||
|
if ((p = strchr(value, '#')) != NULL)
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
// remove trailing tab/space
|
||||||
|
for (p = value + strlen(value) - 1;
|
||||||
|
p >= value && (*p == '\t' || *p == ' '); p--)
|
||||||
|
*p = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (section == SECTION_GENERAL) {
|
if (section == SECTION_GENERAL) {
|
||||||
|
@ -514,6 +525,8 @@ bool CConf::read()
|
||||||
m_modemFMTXLevel = float(::atof(value));
|
m_modemFMTXLevel = float(::atof(value));
|
||||||
else if (::strcmp(key, "RSSIMappingFile") == 0)
|
else if (::strcmp(key, "RSSIMappingFile") == 0)
|
||||||
m_modemRSSIMappingFile = value;
|
m_modemRSSIMappingFile = value;
|
||||||
|
else if (::strcmp(key, "UseCOSAsLockout") == 0)
|
||||||
|
m_modemUseCOSAsLockout = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Trace") == 0)
|
else if (::strcmp(key, "Trace") == 0)
|
||||||
m_modemTrace = ::atoi(value) == 1;
|
m_modemTrace = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Debug") == 0)
|
else if (::strcmp(key, "Debug") == 0)
|
||||||
|
@ -765,12 +778,10 @@ bool CConf::read()
|
||||||
m_fmCTCSSLevel = float(::atof(value));
|
m_fmCTCSSLevel = float(::atof(value));
|
||||||
else if (::strcmp(key, "KerchunkTime") == 0)
|
else if (::strcmp(key, "KerchunkTime") == 0)
|
||||||
m_fmKerchunkTime = (unsigned int)::atoi(value);
|
m_fmKerchunkTime = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "KerchunkTX") == 0)
|
|
||||||
m_fmKerchunkTX = ::atoi(value) == 1;
|
|
||||||
else if (::strcmp(key, "HangTime") == 0)
|
else if (::strcmp(key, "HangTime") == 0)
|
||||||
m_fmHangTime = (unsigned int)::atoi(value);
|
m_fmHangTime = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "UseCOS") == 0)
|
else if (::strcmp(key, "AccessMode") == 0)
|
||||||
m_fmUseCOS = ::atoi(value) == 1;
|
m_fmAccessMode = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "COSInvert") == 0)
|
else if (::strcmp(key, "COSInvert") == 0)
|
||||||
m_fmCOSInvert = ::atoi(value) == 1;
|
m_fmCOSInvert = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "RFAudioBoost") == 0)
|
else if (::strcmp(key, "RFAudioBoost") == 0)
|
||||||
|
@ -919,7 +930,7 @@ bool CConf::read()
|
||||||
else if (::strcmp(key, "IdleBrightness") == 0)
|
else if (::strcmp(key, "IdleBrightness") == 0)
|
||||||
m_nextionIdleBrightness = (unsigned int)::atoi(value);
|
m_nextionIdleBrightness = (unsigned int)::atoi(value);
|
||||||
else if (::strcmp(key, "ScreenLayout") == 0)
|
else if (::strcmp(key, "ScreenLayout") == 0)
|
||||||
m_nextionScreenLayout = (unsigned int)::atoi(value);
|
m_nextionScreenLayout = (unsigned int)::strtoul(value, NULL, 0);
|
||||||
else if (::strcmp(key, "DisplayTempInFahrenheit") == 0)
|
else if (::strcmp(key, "DisplayTempInFahrenheit") == 0)
|
||||||
m_nextionTempInFahrenheit = ::atoi(value) == 1;
|
m_nextionTempInFahrenheit = ::atoi(value) == 1;
|
||||||
} else if (section == SECTION_OLED) {
|
} else if (section == SECTION_OLED) {
|
||||||
|
@ -953,13 +964,13 @@ bool CConf::read()
|
||||||
m_lockFileEnabled = ::atoi(value) == 1;
|
m_lockFileEnabled = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "File") == 0)
|
else if (::strcmp(key, "File") == 0)
|
||||||
m_lockFileName = value;
|
m_lockFileName = value;
|
||||||
} else if (section == SECTION_MOBILE_GPS) {
|
} else if (section == SECTION_GPSD) {
|
||||||
if (::strcmp(key, "Enable") == 0)
|
if (::strcmp(key, "Enable") == 0)
|
||||||
m_mobileGPSEnabled = ::atoi(value) == 1;
|
m_gpsdEnabled = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Address") == 0)
|
else if (::strcmp(key, "Address") == 0)
|
||||||
m_mobileGPSAddress = value;
|
m_gpsdAddress = value;
|
||||||
else if (::strcmp(key, "Port") == 0)
|
else if (::strcmp(key, "Port") == 0)
|
||||||
m_mobileGPSPort = (unsigned int)::atoi(value);
|
m_gpsdPort = value;
|
||||||
} else if (section == SECTION_REMOTE_CONTROL) {
|
} else if (section == SECTION_REMOTE_CONTROL) {
|
||||||
if (::strcmp(key, "Enable") == 0)
|
if (::strcmp(key, "Enable") == 0)
|
||||||
m_remoteControlEnabled = ::atoi(value) == 1;
|
m_remoteControlEnabled = ::atoi(value) == 1;
|
||||||
|
@ -1218,6 +1229,11 @@ std::string CConf::getModemRSSIMappingFile () const
|
||||||
return m_modemRSSIMappingFile;
|
return m_modemRSSIMappingFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CConf::getModemUseCOSAsLockout() const
|
||||||
|
{
|
||||||
|
return m_modemUseCOSAsLockout;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getModemTrace() const
|
bool CConf::getModemTrace() const
|
||||||
{
|
{
|
||||||
return m_modemTrace;
|
return m_modemTrace;
|
||||||
|
@ -1653,19 +1669,14 @@ unsigned int CConf::getFMKerchunkTime() const
|
||||||
return m_fmKerchunkTime;
|
return m_fmKerchunkTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getFMKerchunkTX() const
|
|
||||||
{
|
|
||||||
return m_fmKerchunkTX;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int CConf::getFMHangTime() const
|
unsigned int CConf::getFMHangTime() const
|
||||||
{
|
{
|
||||||
return m_fmHangTime;
|
return m_fmHangTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getFMUseCOS() const
|
unsigned int CConf::getFMAccessMode() const
|
||||||
{
|
{
|
||||||
return m_fmUseCOS;
|
return m_fmAccessMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getFMCOSInvert() const
|
bool CConf::getFMCOSInvert() const
|
||||||
|
@ -2079,19 +2090,19 @@ std::string CConf::getLockFileName() const
|
||||||
return m_lockFileName;
|
return m_lockFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getMobileGPSEnabled() const
|
bool CConf::getGPSDEnabled() const
|
||||||
{
|
{
|
||||||
return m_mobileGPSEnabled;
|
return m_gpsdEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CConf::getMobileGPSAddress() const
|
std::string CConf::getGPSDAddress() const
|
||||||
{
|
{
|
||||||
return m_mobileGPSAddress;
|
return m_gpsdAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int CConf::getMobileGPSPort() const
|
std::string CConf::getGPSDPort() const
|
||||||
{
|
{
|
||||||
return m_mobileGPSPort;
|
return m_gpsdPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getRemoteControlEnabled() const
|
bool CConf::getRemoteControlEnabled() const
|
||||||
|
|
22
Conf.h
22
Conf.h
|
@ -92,6 +92,7 @@ public:
|
||||||
float getModemPOCSAGTXLevel() const;
|
float getModemPOCSAGTXLevel() const;
|
||||||
float getModemFMTXLevel() const;
|
float getModemFMTXLevel() const;
|
||||||
std::string getModemRSSIMappingFile() const;
|
std::string getModemRSSIMappingFile() const;
|
||||||
|
bool getModemUseCOSAsLockout() const;
|
||||||
bool getModemTrace() const;
|
bool getModemTrace() const;
|
||||||
bool getModemDebug() const;
|
bool getModemDebug() const;
|
||||||
|
|
||||||
|
@ -197,9 +198,8 @@ public:
|
||||||
unsigned int getFMCTCSSLowThreshold() const;
|
unsigned int getFMCTCSSLowThreshold() const;
|
||||||
float getFMCTCSSLevel() const;
|
float getFMCTCSSLevel() const;
|
||||||
unsigned int getFMKerchunkTime() const;
|
unsigned int getFMKerchunkTime() const;
|
||||||
bool getFMKerchunkTX() const;
|
|
||||||
unsigned int getFMHangTime() const;
|
unsigned int getFMHangTime() const;
|
||||||
bool getFMUseCOS() const;
|
unsigned int getFMAccessMode() const;
|
||||||
bool getFMCOSInvert() const;
|
bool getFMCOSInvert() const;
|
||||||
unsigned int getFMRFAudioBoost() const;
|
unsigned int getFMRFAudioBoost() const;
|
||||||
float getFMMaxDevLevel() const;
|
float getFMMaxDevLevel() const;
|
||||||
|
@ -307,10 +307,10 @@ public:
|
||||||
bool getLockFileEnabled() const;
|
bool getLockFileEnabled() const;
|
||||||
std::string getLockFileName() const;
|
std::string getLockFileName() const;
|
||||||
|
|
||||||
// The Mobile GPS section
|
// The GPSD section
|
||||||
bool getMobileGPSEnabled() const;
|
bool getGPSDEnabled() const;
|
||||||
std::string getMobileGPSAddress() const;
|
std::string getGPSDAddress() const;
|
||||||
unsigned int getMobileGPSPort() const;
|
std::string getGPSDPort() const;
|
||||||
|
|
||||||
// The Remote Control section
|
// The Remote Control section
|
||||||
bool getRemoteControlEnabled() const;
|
bool getRemoteControlEnabled() const;
|
||||||
|
@ -373,6 +373,7 @@ private:
|
||||||
float m_modemPOCSAGTXLevel;
|
float m_modemPOCSAGTXLevel;
|
||||||
float m_modemFMTXLevel;
|
float m_modemFMTXLevel;
|
||||||
std::string m_modemRSSIMappingFile;
|
std::string m_modemRSSIMappingFile;
|
||||||
|
bool m_modemUseCOSAsLockout;
|
||||||
bool m_modemTrace;
|
bool m_modemTrace;
|
||||||
bool m_modemDebug;
|
bool m_modemDebug;
|
||||||
|
|
||||||
|
@ -469,9 +470,8 @@ private:
|
||||||
unsigned int m_fmCTCSSLowThreshold;
|
unsigned int m_fmCTCSSLowThreshold;
|
||||||
float m_fmCTCSSLevel;
|
float m_fmCTCSSLevel;
|
||||||
unsigned int m_fmKerchunkTime;
|
unsigned int m_fmKerchunkTime;
|
||||||
bool m_fmKerchunkTX;
|
|
||||||
unsigned int m_fmHangTime;
|
unsigned int m_fmHangTime;
|
||||||
bool m_fmUseCOS;
|
unsigned int m_fmAccessMode;
|
||||||
bool m_fmCOSInvert;
|
bool m_fmCOSInvert;
|
||||||
unsigned int m_fmRFAudioBoost;
|
unsigned int m_fmRFAudioBoost;
|
||||||
float m_fmMaxDevLevel;
|
float m_fmMaxDevLevel;
|
||||||
|
@ -567,9 +567,9 @@ private:
|
||||||
bool m_lockFileEnabled;
|
bool m_lockFileEnabled;
|
||||||
std::string m_lockFileName;
|
std::string m_lockFileName;
|
||||||
|
|
||||||
bool m_mobileGPSEnabled;
|
bool m_gpsdEnabled;
|
||||||
std::string m_mobileGPSAddress;
|
std::string m_gpsdAddress;
|
||||||
unsigned int m_mobileGPSPort;
|
std::string m_gpsdPort;
|
||||||
|
|
||||||
bool m_remoteControlEnabled;
|
bool m_remoteControlEnabled;
|
||||||
unsigned int m_remoteControlPort;
|
unsigned int m_remoteControlPort;
|
||||||
|
|
|
@ -66,7 +66,8 @@ m_height(0),
|
||||||
m_location(),
|
m_location(),
|
||||||
m_description(),
|
m_description(),
|
||||||
m_url(),
|
m_url(),
|
||||||
m_beacon(false)
|
m_beacon(false),
|
||||||
|
m_random()
|
||||||
{
|
{
|
||||||
assert(!address.empty());
|
assert(!address.empty());
|
||||||
assert(port > 0U);
|
assert(port > 0U);
|
||||||
|
@ -85,11 +86,13 @@ m_beacon(false)
|
||||||
m_id[2U] = id >> 8;
|
m_id[2U] = id >> 8;
|
||||||
m_id[3U] = id >> 0;
|
m_id[3U] = id >> 0;
|
||||||
|
|
||||||
CStopWatch stopWatch;
|
std::random_device rd;
|
||||||
::srand(stopWatch.start());
|
std::mt19937 mt(rd());
|
||||||
|
m_random = mt;
|
||||||
|
|
||||||
m_streamId[0U] = ::rand() + 1U;
|
std::uniform_int_distribution<uint32_t> dist(0x00000001, 0xfffffffe);
|
||||||
m_streamId[1U] = ::rand() + 1U;
|
m_streamId[0U] = dist(m_random);
|
||||||
|
m_streamId[1U] = dist(m_random);
|
||||||
}
|
}
|
||||||
|
|
||||||
CDMRNetwork::~CDMRNetwork()
|
CDMRNetwork::~CDMRNetwork()
|
||||||
|
@ -246,6 +249,7 @@ bool CDMRNetwork::write(const CDMRData& data)
|
||||||
|
|
||||||
unsigned int slotIndex = slotNo - 1U;
|
unsigned int slotIndex = slotNo - 1U;
|
||||||
|
|
||||||
|
std::uniform_int_distribution<uint32_t> dist(0x00000001, 0xfffffffe);
|
||||||
unsigned char dataType = data.getDataType();
|
unsigned char dataType = data.getDataType();
|
||||||
if (dataType == DT_VOICE_SYNC) {
|
if (dataType == DT_VOICE_SYNC) {
|
||||||
buffer[15U] |= 0x10U;
|
buffer[15U] |= 0x10U;
|
||||||
|
@ -253,10 +257,10 @@ bool CDMRNetwork::write(const CDMRData& data)
|
||||||
buffer[15U] |= data.getN();
|
buffer[15U] |= data.getN();
|
||||||
} else {
|
} else {
|
||||||
if (dataType == DT_VOICE_LC_HEADER)
|
if (dataType == DT_VOICE_LC_HEADER)
|
||||||
m_streamId[slotIndex] = ::rand() + 1U;
|
m_streamId[slotIndex] = dist(m_random);
|
||||||
|
|
||||||
if (dataType == DT_CSBK || dataType == DT_DATA_HEADER)
|
if (dataType == DT_CSBK || dataType == DT_DATA_HEADER)
|
||||||
m_streamId[slotIndex] = ::rand() + 1U;
|
m_streamId[slotIndex] = dist(m_random);
|
||||||
|
|
||||||
buffer[15U] |= (0x20U | dataType);
|
buffer[15U] |= (0x20U | dataType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
class CDMRNetwork
|
class CDMRNetwork
|
||||||
{
|
{
|
||||||
|
@ -106,6 +107,7 @@ private:
|
||||||
std::string m_url;
|
std::string m_url;
|
||||||
|
|
||||||
bool m_beacon;
|
bool m_beacon;
|
||||||
|
std::mt19937 m_random;
|
||||||
|
|
||||||
bool writeLogin();
|
bool writeLogin();
|
||||||
bool writeAuthorisation();
|
bool writeAuthorisation();
|
||||||
|
|
|
@ -44,14 +44,16 @@ m_inId(0U),
|
||||||
m_buffer(1000U, "D-Star Network"),
|
m_buffer(1000U, "D-Star Network"),
|
||||||
m_pollTimer(1000U, 60U),
|
m_pollTimer(1000U, 60U),
|
||||||
m_linkStatus(LS_NONE),
|
m_linkStatus(LS_NONE),
|
||||||
m_linkReflector(NULL)
|
m_linkReflector(NULL),
|
||||||
|
m_random()
|
||||||
{
|
{
|
||||||
m_address = CUDPSocket::lookup(gatewayAddress);
|
m_address = CUDPSocket::lookup(gatewayAddress);
|
||||||
|
|
||||||
m_linkReflector = new unsigned char[DSTAR_LONG_CALLSIGN_LENGTH];
|
m_linkReflector = new unsigned char[DSTAR_LONG_CALLSIGN_LENGTH];
|
||||||
|
|
||||||
CStopWatch stopWatch;
|
std::random_device rd;
|
||||||
::srand(stopWatch.start());
|
std::mt19937 mt(rd());
|
||||||
|
m_random = mt;
|
||||||
}
|
}
|
||||||
|
|
||||||
CDStarNetwork::~CDStarNetwork()
|
CDStarNetwork::~CDStarNetwork()
|
||||||
|
@ -85,7 +87,8 @@ bool CDStarNetwork::writeHeader(const unsigned char* header, unsigned int length
|
||||||
buffer[4] = busy ? 0x22U : 0x20U;
|
buffer[4] = busy ? 0x22U : 0x20U;
|
||||||
|
|
||||||
// Create a random id for this transmission
|
// Create a random id for this transmission
|
||||||
m_outId = (::rand() % 65535U) + 1U;
|
std::uniform_int_distribution<uint16_t> dist(0x0001, 0xfffe);
|
||||||
|
m_outId = dist(m_random);
|
||||||
|
|
||||||
buffer[5] = m_outId / 256U; // Unique session id
|
buffer[5] = m_outId / 256U; // Unique session id
|
||||||
buffer[6] = m_outId % 256U;
|
buffer[6] = m_outId % 256U;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
class CDStarNetwork {
|
class CDStarNetwork {
|
||||||
public:
|
public:
|
||||||
|
@ -64,6 +65,7 @@ private:
|
||||||
CTimer m_pollTimer;
|
CTimer m_pollTimer;
|
||||||
LINK_STATUS m_linkStatus;
|
LINK_STATUS m_linkStatus;
|
||||||
unsigned char* m_linkReflector;
|
unsigned char* m_linkReflector;
|
||||||
|
std::mt19937 m_random;
|
||||||
|
|
||||||
bool writePoll(const char* text);
|
bool writePoll(const char* text);
|
||||||
};
|
};
|
||||||
|
|
103
GPSD.cpp
Normal file
103
GPSD.cpp
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "GPSD.h"
|
||||||
|
|
||||||
|
#if defined(USE_GPSD)
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
CGPSD::CGPSD(const std::string& address, const std::string& port, CDMRNetwork* network) :
|
||||||
|
m_gpsdAddress(address),
|
||||||
|
m_gpsdPort(port),
|
||||||
|
m_network(network),
|
||||||
|
m_gpsdData(),
|
||||||
|
m_idTimer(1000U, 60U)
|
||||||
|
{
|
||||||
|
assert(!address.empty());
|
||||||
|
assert(!port.empty());
|
||||||
|
assert(network != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGPSD::~CGPSD()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CGPSD::open()
|
||||||
|
{
|
||||||
|
int ret = ::gps_open(m_gpsdAddress.c_str(), m_gpsdPort.c_str(), &m_gpsdData);
|
||||||
|
if (ret != 0) {
|
||||||
|
LogError("Error when opening access to gpsd - %d - %s", errno, ::gps_errstr(errno));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
::gps_stream(&m_gpsdData, WATCH_ENABLE | WATCH_JSON, NULL);
|
||||||
|
|
||||||
|
LogMessage("Connected to GPSD");
|
||||||
|
|
||||||
|
m_idTimer.start();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPSD::clock(unsigned int ms)
|
||||||
|
{
|
||||||
|
m_idTimer.clock(ms);
|
||||||
|
|
||||||
|
if (m_idTimer.hasExpired()) {
|
||||||
|
sendReport();
|
||||||
|
m_idTimer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPSD::close()
|
||||||
|
{
|
||||||
|
::gps_stream(&m_gpsdData, WATCH_DISABLE, NULL);
|
||||||
|
::gps_close(&m_gpsdData);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPSD::sendReport()
|
||||||
|
{
|
||||||
|
if (!::gps_waiting(&m_gpsdData, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
#if GPSD_API_MAJOR_VERSION >= 7
|
||||||
|
if (::gps_read(&m_gpsdData, NULL, 0) <= 0)
|
||||||
|
return;
|
||||||
|
#else
|
||||||
|
if (::gps_read(&m_gpsdData) <= 0)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (m_gpsdData.status != STATUS_FIX)
|
||||||
|
return;
|
||||||
|
|
||||||
|
bool latlonSet = (m_gpsdData.set & LATLON_SET) == LATLON_SET;
|
||||||
|
if (!latlonSet)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float latitude = float(m_gpsdData.fix.latitude);
|
||||||
|
float longitude = float(m_gpsdData.fix.longitude);
|
||||||
|
|
||||||
|
m_network->writeHomePosition(latitude, longitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,32 +16,22 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MobileGPS_H
|
#ifndef GPSD_H
|
||||||
#define MobileGPS_H
|
#define GPSD_H
|
||||||
|
|
||||||
|
#if defined(USE_GPSD)
|
||||||
|
|
||||||
#include "DMRNetwork.h"
|
#include "DMRNetwork.h"
|
||||||
#include "UDPSocket.h"
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(_WIN64)
|
#include <gps.h>
|
||||||
#include <netdb.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#else
|
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class CMobileGPS {
|
class CGPSD {
|
||||||
public:
|
public:
|
||||||
CMobileGPS(const std::string& address, unsigned int port, CDMRNetwork* network);
|
CGPSD(const std::string& address, const std::string& port, CDMRNetwork* network);
|
||||||
~CMobileGPS();
|
~CGPSD();
|
||||||
|
|
||||||
bool open();
|
bool open();
|
||||||
|
|
||||||
|
@ -50,14 +40,15 @@ public:
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CTimer m_idTimer;
|
std::string m_gpsdAddress;
|
||||||
in_addr m_address;
|
std::string m_gpsdPort;
|
||||||
unsigned int m_port;
|
CDMRNetwork* m_network;
|
||||||
CUDPSocket m_socket;
|
struct gps_data_t m_gpsdData;
|
||||||
CDMRNetwork* m_network;
|
CTimer m_idTimer;
|
||||||
|
|
||||||
bool pollGPS();
|
|
||||||
void sendReport();
|
void sendReport();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -67,6 +67,7 @@ RFLevel=100
|
||||||
# POCSAGTXLevel=50
|
# POCSAGTXLevel=50
|
||||||
# FMTXLevel=50
|
# FMTXLevel=50
|
||||||
RSSIMappingFile=RSSI.dat
|
RSSIMappingFile=RSSI.dat
|
||||||
|
UseCOSAsLockout=0
|
||||||
Trace=0
|
Trace=0
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
|
@ -168,9 +169,8 @@ CTCSSThreshold=30
|
||||||
# CTCSSLowThreshold=20
|
# CTCSSLowThreshold=20
|
||||||
CTCSSLevel=20
|
CTCSSLevel=20
|
||||||
KerchunkTime=0
|
KerchunkTime=0
|
||||||
KerchunkTX=1
|
|
||||||
HangTime=7
|
HangTime=7
|
||||||
UseCOS=1
|
AccessMode=1
|
||||||
COSInvert=0
|
COSInvert=0
|
||||||
RFAudioBoost=1
|
RFAudioBoost=1
|
||||||
MaxDevLevel=90
|
MaxDevLevel=90
|
||||||
|
@ -289,10 +289,10 @@ UTC=0
|
||||||
Enable=0
|
Enable=0
|
||||||
File=/tmp/MMDVM_Active.lck
|
File=/tmp/MMDVM_Active.lck
|
||||||
|
|
||||||
[Mobile GPS]
|
[GPSD]
|
||||||
Enable=0
|
Enable=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=7834
|
Port=2947
|
||||||
|
|
||||||
[Remote Control]
|
[Remote Control]
|
||||||
Enable=0
|
Enable=0
|
||||||
|
|
|
@ -161,7 +161,9 @@ m_id(0U),
|
||||||
m_cwCallsign(),
|
m_cwCallsign(),
|
||||||
m_lockFileEnabled(false),
|
m_lockFileEnabled(false),
|
||||||
m_lockFileName(),
|
m_lockFileName(),
|
||||||
m_mobileGPS(NULL),
|
#if defined(USE_GPSD)
|
||||||
|
m_gpsd(NULL),
|
||||||
|
#endif
|
||||||
m_remoteControl(NULL),
|
m_remoteControl(NULL),
|
||||||
m_fixedMode(false)
|
m_fixedMode(false)
|
||||||
{
|
{
|
||||||
|
@ -1004,8 +1006,10 @@ int CMMDVMHost::run()
|
||||||
if (m_pocsagNetwork != NULL)
|
if (m_pocsagNetwork != NULL)
|
||||||
m_pocsagNetwork->clock(ms);
|
m_pocsagNetwork->clock(ms);
|
||||||
|
|
||||||
if (m_mobileGPS != NULL)
|
#if defined(USE_GPSD)
|
||||||
m_mobileGPS->clock(ms);
|
if (m_gpsd != NULL)
|
||||||
|
m_gpsd->clock(ms);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_cwIdTimer.clock(ms);
|
m_cwIdTimer.clock(ms);
|
||||||
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
|
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
|
||||||
|
@ -1082,10 +1086,12 @@ int CMMDVMHost::run()
|
||||||
m_display->close();
|
m_display->close();
|
||||||
delete m_display;
|
delete m_display;
|
||||||
|
|
||||||
if (m_mobileGPS != NULL) {
|
#if defined(USE_GPSD)
|
||||||
m_mobileGPS->close();
|
if (m_gpsd != NULL) {
|
||||||
delete m_mobileGPS;
|
m_gpsd->close();
|
||||||
|
delete m_gpsd;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_ump != NULL) {
|
if (m_ump != NULL) {
|
||||||
m_ump->close();
|
m_ump->close();
|
||||||
|
@ -1182,6 +1188,7 @@ bool CMMDVMHost::createModem()
|
||||||
int rxDCOffset = m_conf.getModemRXDCOffset();
|
int rxDCOffset = m_conf.getModemRXDCOffset();
|
||||||
int txDCOffset = m_conf.getModemTXDCOffset();
|
int txDCOffset = m_conf.getModemTXDCOffset();
|
||||||
float rfLevel = m_conf.getModemRFLevel();
|
float rfLevel = m_conf.getModemRFLevel();
|
||||||
|
bool useCOSAsLockout = m_conf.getModemUseCOSAsLockout();
|
||||||
|
|
||||||
LogInfo("Modem Parameters");
|
LogInfo("Modem Parameters");
|
||||||
LogInfo(" Port: %s", port.c_str());
|
LogInfo(" Port: %s", port.c_str());
|
||||||
|
@ -1208,9 +1215,10 @@ bool CMMDVMHost::createModem()
|
||||||
LogInfo(" POCSAG TX Level: %.1f%%", pocsagTXLevel);
|
LogInfo(" POCSAG TX Level: %.1f%%", pocsagTXLevel);
|
||||||
LogInfo(" FM TX Level: %.1f%%", fmTXLevel);
|
LogInfo(" FM TX Level: %.1f%%", fmTXLevel);
|
||||||
LogInfo(" TX Frequency: %uHz (%uHz)", txFrequency, txFrequency + txOffset);
|
LogInfo(" TX Frequency: %uHz (%uHz)", txFrequency, txFrequency + txOffset);
|
||||||
|
LogInfo(" Use COS as Lockout: %s", useCOSAsLockout ? "yes" : "no");
|
||||||
|
|
||||||
m_modem = CModem::createModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, trace, debug);
|
m_modem = CModem::createModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, useCOSAsLockout, trace, debug);
|
||||||
m_modem->setSerialParams(protocol,address);
|
m_modem->setSerialParams(protocol, address);
|
||||||
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled, m_nxdnEnabled, m_pocsagEnabled, m_fmEnabled);
|
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->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, pocsagTXLevel, fmTXLevel);
|
||||||
m_modem->setRFParams(rxFrequency, rxOffset, txFrequency, txOffset, txDCOffset, rxDCOffset, rfLevel, pocsagFrequency);
|
m_modem->setRFParams(rxFrequency, rxOffset, txFrequency, txOffset, txDCOffset, rxDCOffset, rfLevel, pocsagFrequency);
|
||||||
|
@ -1244,9 +1252,8 @@ bool CMMDVMHost::createModem()
|
||||||
unsigned int ctcssLowThreshold = m_conf.getFMCTCSSLowThreshold();
|
unsigned int ctcssLowThreshold = m_conf.getFMCTCSSLowThreshold();
|
||||||
float ctcssLevel = m_conf.getFMCTCSSLevel();
|
float ctcssLevel = m_conf.getFMCTCSSLevel();
|
||||||
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
|
unsigned int kerchunkTime = m_conf.getFMKerchunkTime();
|
||||||
bool kerchunkTX = m_conf.getFMKerchunkTX();
|
|
||||||
unsigned int hangTime = m_conf.getFMHangTime();
|
unsigned int hangTime = m_conf.getFMHangTime();
|
||||||
bool useCOS = m_conf.getFMUseCOS();
|
unsigned int accessMode = m_conf.getFMAccessMode();
|
||||||
bool cosInvert = m_conf.getFMCOSInvert();
|
bool cosInvert = m_conf.getFMCOSInvert();
|
||||||
unsigned int rfAudioBoost = m_conf.getFMRFAudioBoost();
|
unsigned int rfAudioBoost = m_conf.getFMRFAudioBoost();
|
||||||
float maxDevLevel = m_conf.getFMMaxDevLevel();
|
float maxDevLevel = m_conf.getFMMaxDevLevel();
|
||||||
|
@ -1277,9 +1284,8 @@ bool CMMDVMHost::createModem()
|
||||||
LogInfo(" CTCSS Low Threshold: %u", ctcssLowThreshold);
|
LogInfo(" CTCSS Low Threshold: %u", ctcssLowThreshold);
|
||||||
LogInfo(" CTCSS Level: %.1f%%", ctcssLevel);
|
LogInfo(" CTCSS Level: %.1f%%", ctcssLevel);
|
||||||
LogInfo(" Kerchunk Time: %us", kerchunkTime);
|
LogInfo(" Kerchunk Time: %us", kerchunkTime);
|
||||||
LogInfo(" Kerchunk TX: %s", kerchunkTX ? "yes" : "no");
|
|
||||||
LogInfo(" Hang Time: %us", hangTime);
|
LogInfo(" Hang Time: %us", hangTime);
|
||||||
LogInfo(" Use COS: %s", useCOS ? "yes" : "no");
|
LogInfo(" Access Mode: %u", accessMode);
|
||||||
LogInfo(" COS Invert: %s", cosInvert ? "yes" : "no");
|
LogInfo(" COS Invert: %s", cosInvert ? "yes" : "no");
|
||||||
LogInfo(" RF Audio Boost: x%u", rfAudioBoost);
|
LogInfo(" RF Audio Boost: x%u", rfAudioBoost);
|
||||||
LogInfo(" Max. Deviation Level: %.1f%%", maxDevLevel);
|
LogInfo(" Max. Deviation Level: %.1f%%", maxDevLevel);
|
||||||
|
@ -1287,7 +1293,7 @@ bool CMMDVMHost::createModem()
|
||||||
|
|
||||||
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd, callsignAtLatch);
|
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd, callsignAtLatch);
|
||||||
m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel);
|
m_modem->setFMAckParams(rfAck, ackSpeed, ackFrequency, ackMinTime, ackDelay, ackLevel);
|
||||||
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssHighThreshold, ctcssLowThreshold, ctcssLevel, kerchunkTime, kerchunkTX, hangTime, useCOS, cosInvert, rfAudioBoost, maxDevLevel);
|
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssHighThreshold, ctcssLowThreshold, ctcssLevel, kerchunkTime, hangTime, accessMode, cosInvert, rfAudioBoost, maxDevLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = m_modem->open();
|
bool ret = m_modem->open();
|
||||||
|
@ -1394,23 +1400,25 @@ bool CMMDVMHost::createDMRNetwork()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mobileGPSEnabled = m_conf.getMobileGPSEnabled();
|
#if defined(USE_GPSD)
|
||||||
if (mobileGPSEnabled) {
|
bool gpsdEnabled = m_conf.getGPSDEnabled();
|
||||||
std::string mobileGPSAddress = m_conf.getMobileGPSAddress();
|
if (gpsdEnabled) {
|
||||||
unsigned int mobileGPSPort = m_conf.getMobileGPSPort();
|
std::string gpsdAddress = m_conf.getGPSDAddress();
|
||||||
|
std::string gpsdPort = m_conf.getGPSDPort();
|
||||||
|
|
||||||
LogInfo("Mobile GPS Parameters");
|
LogInfo("GPSD Parameters");
|
||||||
LogInfo(" Address: %s", mobileGPSAddress.c_str());
|
LogInfo(" Address: %s", gpsdAddress.c_str());
|
||||||
LogInfo(" Port: %u", mobileGPSPort);
|
LogInfo(" Port: %s", gpsdPort.c_str());
|
||||||
|
|
||||||
m_mobileGPS = new CMobileGPS(address, port, m_dmrNetwork);
|
m_gpsd = new CGPSD(gpsdAddress, gpsdPort, m_dmrNetwork);
|
||||||
|
|
||||||
ret = m_mobileGPS->open();
|
ret = m_gpsd->open();
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
delete m_mobileGPS;
|
delete m_gpsd;
|
||||||
m_mobileGPS = NULL;
|
m_gpsd = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_dmrNetwork->enable(true);
|
m_dmrNetwork->enable(true);
|
||||||
|
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
#include "P25Network.h"
|
#include "P25Network.h"
|
||||||
#include "DMRNetwork.h"
|
#include "DMRNetwork.h"
|
||||||
#include "DMRLookup.h"
|
#include "DMRLookup.h"
|
||||||
#include "MobileGPS.h"
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Modem.h"
|
#include "Modem.h"
|
||||||
#include "Conf.h"
|
#include "Conf.h"
|
||||||
|
#include "GPSD.h"
|
||||||
#include "UMP.h"
|
#include "UMP.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -102,7 +102,9 @@ private:
|
||||||
std::string m_cwCallsign;
|
std::string m_cwCallsign;
|
||||||
bool m_lockFileEnabled;
|
bool m_lockFileEnabled;
|
||||||
std::string m_lockFileName;
|
std::string m_lockFileName;
|
||||||
CMobileGPS* m_mobileGPS;
|
#if defined(USE_GPSD)
|
||||||
|
CGPSD* m_gpsd;
|
||||||
|
#endif
|
||||||
CRemoteControl* m_remoteControl;
|
CRemoteControl* m_remoteControl;
|
||||||
bool m_fixedMode;
|
bool m_fixedMode;
|
||||||
|
|
||||||
|
|
|
@ -183,13 +183,13 @@
|
||||||
<ClInclude Include="DStarSlowData.h" />
|
<ClInclude Include="DStarSlowData.h" />
|
||||||
<ClInclude Include="Golay2087.h" />
|
<ClInclude Include="Golay2087.h" />
|
||||||
<ClInclude Include="Golay24128.h" />
|
<ClInclude Include="Golay24128.h" />
|
||||||
|
<ClInclude Include="GPSD.h" />
|
||||||
<ClInclude Include="Hamming.h" />
|
<ClInclude Include="Hamming.h" />
|
||||||
<ClInclude Include="DMRLookup.h" />
|
<ClInclude Include="DMRLookup.h" />
|
||||||
<ClInclude Include="I2CController.h" />
|
<ClInclude Include="I2CController.h" />
|
||||||
<ClInclude Include="LCDproc.h" />
|
<ClInclude Include="LCDproc.h" />
|
||||||
<ClInclude Include="Log.h" />
|
<ClInclude Include="Log.h" />
|
||||||
<ClInclude Include="MMDVMHost.h" />
|
<ClInclude Include="MMDVMHost.h" />
|
||||||
<ClInclude Include="MobileGPS.h" />
|
|
||||||
<ClInclude Include="Modem.h" />
|
<ClInclude Include="Modem.h" />
|
||||||
<ClInclude Include="ModemSerialPort.h" />
|
<ClInclude Include="ModemSerialPort.h" />
|
||||||
<ClInclude Include="Mutex.h" />
|
<ClInclude Include="Mutex.h" />
|
||||||
|
@ -281,12 +281,12 @@
|
||||||
<ClCompile Include="DStarSlowData.cpp" />
|
<ClCompile Include="DStarSlowData.cpp" />
|
||||||
<ClCompile Include="Golay2087.cpp" />
|
<ClCompile Include="Golay2087.cpp" />
|
||||||
<ClCompile Include="Golay24128.cpp" />
|
<ClCompile Include="Golay24128.cpp" />
|
||||||
|
<ClCompile Include="GPSD.cpp" />
|
||||||
<ClCompile Include="Hamming.cpp" />
|
<ClCompile Include="Hamming.cpp" />
|
||||||
<ClCompile Include="I2CController.cpp" />
|
<ClCompile Include="I2CController.cpp" />
|
||||||
<ClCompile Include="LCDproc.cpp" />
|
<ClCompile Include="LCDproc.cpp" />
|
||||||
<ClCompile Include="Log.cpp" />
|
<ClCompile Include="Log.cpp" />
|
||||||
<ClCompile Include="MMDVMHost.cpp" />
|
<ClCompile Include="MMDVMHost.cpp" />
|
||||||
<ClCompile Include="MobileGPS.cpp" />
|
|
||||||
<ClCompile Include="Modem.cpp" />
|
<ClCompile Include="Modem.cpp" />
|
||||||
<ClCompile Include="ModemSerialPort.cpp" />
|
<ClCompile Include="ModemSerialPort.cpp" />
|
||||||
<ClCompile Include="Mutex.cpp" />
|
<ClCompile Include="Mutex.cpp" />
|
||||||
|
|
|
@ -278,9 +278,6 @@
|
||||||
<ClInclude Include="I2CController.h">
|
<ClInclude Include="I2CController.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="MobileGPS.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="NullModem.h">
|
<ClInclude Include="NullModem.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -305,6 +302,9 @@
|
||||||
<ClInclude Include="NXDNKenwoodNetwork.h">
|
<ClInclude Include="NXDNKenwoodNetwork.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="GPSD.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="BPTC19696.cpp">
|
<ClCompile Include="BPTC19696.cpp">
|
||||||
|
@ -547,9 +547,6 @@
|
||||||
<ClCompile Include="I2CController.cpp">
|
<ClCompile Include="I2CController.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="MobileGPS.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="NullModem.cpp">
|
<ClCompile Include="NullModem.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -574,5 +571,8 @@
|
||||||
<ClCompile Include="NXDNKenwoodNetwork.cpp">
|
<ClCompile Include="NXDNKenwoodNetwork.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="GPSD.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
13
Makefile
13
Makefile
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
CC = cc
|
CC = cc
|
||||||
CXX = c++
|
CXX = c++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
||||||
LIBS = -lpthread
|
LIBS = -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread
|
||||||
|
#LIBS = -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g
|
LDFLAGS = -g
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o \
|
||||||
NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o \
|
NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o \
|
||||||
P25Network.o P25NID.o P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o \
|
P25Network.o P25NID.o P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o \
|
||||||
|
@ -27,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
12
Makefile.Pi
12
Makefile.Pi
|
@ -2,14 +2,20 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -27,6 +33,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,20 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -28,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DHD44780 -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -27,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DOLED -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DOLED -I/usr/local/include
|
||||||
LIBS = -lArduiPi_OLED -lwiringPi -lpthread
|
LIBS = -lArduiPi_OLED -lwiringPi -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DOLED -I/usr/local/include
|
||||||
|
#LIBS = -lArduiPi_OLED -lwiringPi -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o I2CController.o OLED.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o I2CController.o OLED.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -27,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,21 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DPCF8574_DISPLAY -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DPCF8574_DISPLAY -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DHD44780 -DPCF8574_DISPLAY -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -28,6 +35,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
# This makefile is for Solaris using gcc
|
|
||||||
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
|
||||||
LIBS = -lpthread -lsocket
|
|
||||||
LDFLAGS = -g
|
|
||||||
|
|
||||||
OBJECTS = \
|
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o \
|
|
||||||
NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o \
|
|
||||||
NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o \
|
|
||||||
P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o SHA256.o \
|
|
||||||
StopWatch.o Sync.o TFTSerial.o TFTSurenoo.o Thread.o Timer.o UDPSocket.o UMP.o UserDB.o UserDBebtry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o \
|
|
||||||
YSFNetwork.o YSFPayload.o
|
|
||||||
|
|
||||||
all: MMDVMHost RemoteCommand
|
|
||||||
|
|
||||||
MMDVMHost: GitVersion.h $(OBJECTS)
|
|
||||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
|
||||||
|
|
||||||
RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
|
||||||
$(CXX) Log.o RemoteCommand.o UDPSocket.o $(CFLAGS) $(LIBS) -o RemoteCommand
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
|
||||||
|
|
||||||
# Export the current git version if the index file exists, else 000...
|
|
||||||
GitVersion.h:
|
|
||||||
ifneq ("$(wildcard .git/index)","")
|
|
||||||
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
|
|
||||||
else
|
|
||||||
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
|
|
||||||
endif
|
|
101
MobileGPS.cpp
101
MobileGPS.cpp
|
@ -1,101 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2018 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "MobileGPS.h"
|
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cassert>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
CMobileGPS::CMobileGPS(const std::string& address, unsigned int port, CDMRNetwork* network) :
|
|
||||||
m_idTimer(1000U, 60U),
|
|
||||||
m_address(),
|
|
||||||
m_port(port),
|
|
||||||
m_socket(),
|
|
||||||
m_network(network)
|
|
||||||
{
|
|
||||||
assert(!address.empty());
|
|
||||||
assert(port > 0U);
|
|
||||||
assert(network != NULL);
|
|
||||||
|
|
||||||
m_address = CUDPSocket::lookup(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
CMobileGPS::~CMobileGPS()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMobileGPS::open()
|
|
||||||
{
|
|
||||||
bool ret = m_socket.open();
|
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_idTimer.start();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMobileGPS::clock(unsigned int ms)
|
|
||||||
{
|
|
||||||
m_idTimer.clock(ms);
|
|
||||||
|
|
||||||
if (m_idTimer.hasExpired()) {
|
|
||||||
pollGPS();
|
|
||||||
m_idTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
sendReport();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMobileGPS::close()
|
|
||||||
{
|
|
||||||
m_socket.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMobileGPS::pollGPS()
|
|
||||||
{
|
|
||||||
return m_socket.write((unsigned char*)"MMDVMHost", 9U, m_address, m_port);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMobileGPS::sendReport()
|
|
||||||
{
|
|
||||||
// Grab GPS data if it's available
|
|
||||||
unsigned char buffer[200U];
|
|
||||||
in_addr address;
|
|
||||||
unsigned int port;
|
|
||||||
int ret = m_socket.read(buffer, 200U, address, port);
|
|
||||||
if (ret <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
buffer[ret] = '\0';
|
|
||||||
|
|
||||||
// Parse the GPS data
|
|
||||||
char* pLatitude = ::strtok((char*)buffer, ",\n"); // Latitude
|
|
||||||
char* pLongitude = ::strtok(NULL, ",\n"); // Longitude
|
|
||||||
|
|
||||||
if (pLatitude == NULL || pLongitude == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float latitude = float(::atof(pLatitude));
|
|
||||||
float longitude = float(::atof(pLongitude));
|
|
||||||
|
|
||||||
m_network->writeHomePosition(latitude, longitude);
|
|
||||||
}
|
|
||||||
|
|
46
Modem.cpp
46
Modem.cpp
|
@ -99,7 +99,7 @@ const unsigned int MAX_RESPONSES = 30U;
|
||||||
const unsigned int BUFFER_LENGTH = 2000U;
|
const unsigned int BUFFER_LENGTH = 2000U;
|
||||||
|
|
||||||
|
|
||||||
CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug) :
|
CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug) :
|
||||||
m_port(port),
|
m_port(port),
|
||||||
m_dmrColorCode(0U),
|
m_dmrColorCode(0U),
|
||||||
m_ysfLoDev(false),
|
m_ysfLoDev(false),
|
||||||
|
@ -112,15 +112,17 @@ m_txInvert(txInvert),
|
||||||
m_pttInvert(pttInvert),
|
m_pttInvert(pttInvert),
|
||||||
m_txDelay(txDelay),
|
m_txDelay(txDelay),
|
||||||
m_dmrDelay(dmrDelay),
|
m_dmrDelay(dmrDelay),
|
||||||
m_rxLevel(0U),
|
m_rxLevel(0.0F),
|
||||||
m_cwIdTXLevel(0U),
|
m_cwIdTXLevel(0.0F),
|
||||||
m_dstarTXLevel(0U),
|
m_dstarTXLevel(0.0F),
|
||||||
m_dmrTXLevel(0U),
|
m_dmrTXLevel(0.0F),
|
||||||
m_ysfTXLevel(0U),
|
m_ysfTXLevel(0.0F),
|
||||||
m_p25TXLevel(0U),
|
m_p25TXLevel(0.0F),
|
||||||
m_nxdnTXLevel(0U),
|
m_nxdnTXLevel(0.0F),
|
||||||
m_pocsagTXLevel(0U),
|
m_pocsagTXLevel(0.0F),
|
||||||
m_fmTXLevel(0U),
|
m_fmTXLevel(0.0F),
|
||||||
|
m_rfLevel(0.0F),
|
||||||
|
m_useCOSAsLockout(useCOSAsLockout),
|
||||||
m_trace(trace),
|
m_trace(trace),
|
||||||
m_debug(debug),
|
m_debug(debug),
|
||||||
m_rxFrequency(0U),
|
m_rxFrequency(0U),
|
||||||
|
@ -194,9 +196,8 @@ m_fmCtcssHighThreshold(30U),
|
||||||
m_fmCtcssLowThreshold(20U),
|
m_fmCtcssLowThreshold(20U),
|
||||||
m_fmCtcssLevel(10.0F),
|
m_fmCtcssLevel(10.0F),
|
||||||
m_fmKerchunkTime(0U),
|
m_fmKerchunkTime(0U),
|
||||||
m_fmKerchunkTX(true),
|
|
||||||
m_fmHangTime(5U),
|
m_fmHangTime(5U),
|
||||||
m_fmUseCOS(true),
|
m_fmAccessMode(1U),
|
||||||
m_fmCOSInvert(false),
|
m_fmCOSInvert(false),
|
||||||
m_fmRFAudioBoost(1U),
|
m_fmRFAudioBoost(1U),
|
||||||
m_fmMaxDevLevel(90.0F)
|
m_fmMaxDevLevel(90.0F)
|
||||||
|
@ -1535,6 +1536,8 @@ bool CModem::setConfig()
|
||||||
buffer[3U] |= 0x08U;
|
buffer[3U] |= 0x08U;
|
||||||
if (m_debug)
|
if (m_debug)
|
||||||
buffer[3U] |= 0x10U;
|
buffer[3U] |= 0x10U;
|
||||||
|
if (m_useCOSAsLockout)
|
||||||
|
buffer[3U] |= 0x20U;
|
||||||
if (!m_duplex)
|
if (!m_duplex)
|
||||||
buffer[3U] |= 0x80U;
|
buffer[3U] |= 0x80U;
|
||||||
|
|
||||||
|
@ -1931,7 +1934,7 @@ void CModem::setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, uns
|
||||||
m_fmAckLevel = ackLevel;
|
m_fmAckLevel = ackLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, bool kerchunkTX, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
|
void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, unsigned int accessMode, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel)
|
||||||
{
|
{
|
||||||
m_fmTimeout = timeout;
|
m_fmTimeout = timeout;
|
||||||
m_fmTimeoutLevel = timeoutLevel;
|
m_fmTimeoutLevel = timeoutLevel;
|
||||||
|
@ -1942,11 +1945,10 @@ void CModem::setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctc
|
||||||
m_fmCtcssLevel = ctcssLevel;
|
m_fmCtcssLevel = ctcssLevel;
|
||||||
|
|
||||||
m_fmKerchunkTime = kerchunkTime;
|
m_fmKerchunkTime = kerchunkTime;
|
||||||
m_fmKerchunkTX = kerchunkTX;
|
|
||||||
|
|
||||||
m_fmHangTime = hangTime;
|
m_fmHangTime = hangTime;
|
||||||
|
|
||||||
m_fmUseCOS = useCOS;
|
m_fmAccessMode = accessMode;
|
||||||
m_fmCOSInvert = cosInvert;
|
m_fmCOSInvert = cosInvert;
|
||||||
|
|
||||||
m_fmRFAudioBoost = rfAudioBoost;
|
m_fmRFAudioBoost = rfAudioBoost;
|
||||||
|
@ -2087,13 +2089,9 @@ bool CModem::setFMMiscParams()
|
||||||
buffer[9U] = m_fmKerchunkTime;
|
buffer[9U] = m_fmKerchunkTime;
|
||||||
buffer[10U] = m_fmHangTime;
|
buffer[10U] = m_fmHangTime;
|
||||||
|
|
||||||
buffer[11U] = 0x00U;
|
buffer[11U] = m_fmAccessMode;
|
||||||
if (m_fmUseCOS)
|
|
||||||
buffer[11U] |= 0x01U;
|
|
||||||
if (m_fmCOSInvert)
|
if (m_fmCOSInvert)
|
||||||
buffer[11U] |= 0x02U;
|
buffer[11U] |= 0x80U;
|
||||||
if (m_fmKerchunkTX)
|
|
||||||
buffer[11U] |= 0x04U;
|
|
||||||
|
|
||||||
buffer[12U] = m_fmRFAudioBoost;
|
buffer[12U] = m_fmRFAudioBoost;
|
||||||
|
|
||||||
|
@ -2157,9 +2155,9 @@ void CModem::printDebug()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CModem* CModem::createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug){
|
CModem* CModem::createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug){
|
||||||
if (port == "NullModem")
|
if (port == "NullModem")
|
||||||
return new CNullModem(port, duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, trace, debug);
|
return new CNullModem(port, duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, useCOSAsLockout, trace, debug);
|
||||||
else
|
else
|
||||||
return new CModem(port, duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, trace, debug);
|
return new CModem(port, duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, useCOSAsLockout, trace, debug);
|
||||||
}
|
}
|
||||||
|
|
10
Modem.h
10
Modem.h
|
@ -34,7 +34,7 @@ enum RESP_TYPE_MMDVM {
|
||||||
|
|
||||||
class CModem {
|
class CModem {
|
||||||
public:
|
public:
|
||||||
CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug);
|
CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug);
|
||||||
virtual ~CModem();
|
virtual ~CModem();
|
||||||
|
|
||||||
virtual void setSerialParams(const std::string& protocol, unsigned int address);
|
virtual void setSerialParams(const std::string& protocol, unsigned int address);
|
||||||
|
@ -49,7 +49,7 @@ public:
|
||||||
|
|
||||||
virtual void setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch);
|
virtual void setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, float callsignHighLevel, float callsignLowLevel, bool callsignAtStart, bool callsignAtEnd, bool callsignAtLatch);
|
||||||
virtual void setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel);
|
virtual void setFMAckParams(const std::string& rfAck, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackMinTime, unsigned int ackDelay, float ackLevel);
|
||||||
virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, bool kerchunkTX, unsigned int hangTime, bool useCOS, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel);
|
virtual void setFMMiscParams(unsigned int timeout, float timeoutLevel, float ctcssFrequency, unsigned int ctcssHighThreshold, unsigned int ctcssLowThreshold, float ctcssLevel, unsigned int kerchunkTime, unsigned int hangTime, unsigned int accessMode, bool cosInvert, unsigned int rfAudioBoost, float maxDevLevel);
|
||||||
|
|
||||||
virtual bool open();
|
virtual bool open();
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public:
|
||||||
|
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
||||||
static CModem* createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug);
|
static CModem* createModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_port;
|
std::string m_port;
|
||||||
|
@ -138,6 +138,7 @@ private:
|
||||||
float m_pocsagTXLevel;
|
float m_pocsagTXLevel;
|
||||||
float m_fmTXLevel;
|
float m_fmTXLevel;
|
||||||
float m_rfLevel;
|
float m_rfLevel;
|
||||||
|
bool m_useCOSAsLockout;
|
||||||
bool m_trace;
|
bool m_trace;
|
||||||
bool m_debug;
|
bool m_debug;
|
||||||
unsigned int m_rxFrequency;
|
unsigned int m_rxFrequency;
|
||||||
|
@ -212,9 +213,8 @@ private:
|
||||||
unsigned int m_fmCtcssLowThreshold;
|
unsigned int m_fmCtcssLowThreshold;
|
||||||
float m_fmCtcssLevel;
|
float m_fmCtcssLevel;
|
||||||
unsigned int m_fmKerchunkTime;
|
unsigned int m_fmKerchunkTime;
|
||||||
bool m_fmKerchunkTX;
|
|
||||||
unsigned int m_fmHangTime;
|
unsigned int m_fmHangTime;
|
||||||
bool m_fmUseCOS;
|
unsigned int m_fmAccessMode;
|
||||||
bool m_fmCOSInvert;
|
bool m_fmCOSInvert;
|
||||||
unsigned int m_fmRFAudioBoost;
|
unsigned int m_fmRFAudioBoost;
|
||||||
float m_fmMaxDevLevel;
|
float m_fmMaxDevLevel;
|
||||||
|
|
|
@ -56,7 +56,8 @@ m_rtcpTimer(1000U, 0U, 200U),
|
||||||
m_hangTimer(1000U, 5U),
|
m_hangTimer(1000U, 5U),
|
||||||
m_hangType(0U),
|
m_hangType(0U),
|
||||||
m_hangSrc(0U),
|
m_hangSrc(0U),
|
||||||
m_hangDst(0U)
|
m_hangDst(0U),
|
||||||
|
m_random()
|
||||||
{
|
{
|
||||||
assert(localPort > 0U);
|
assert(localPort > 0U);
|
||||||
assert(!gwyAddress.empty());
|
assert(!gwyAddress.empty());
|
||||||
|
@ -65,6 +66,10 @@ m_hangDst(0U)
|
||||||
m_sacch = new unsigned char[10U];
|
m_sacch = new unsigned char[10U];
|
||||||
|
|
||||||
m_address = CUDPSocket::lookup(gwyAddress);
|
m_address = CUDPSocket::lookup(gwyAddress);
|
||||||
|
|
||||||
|
std::random_device rd;
|
||||||
|
std::mt19937 mt(rd());
|
||||||
|
m_random = mt;
|
||||||
}
|
}
|
||||||
|
|
||||||
CNXDNKenwoodNetwork::~CNXDNKenwoodNetwork()
|
CNXDNKenwoodNetwork::~CNXDNKenwoodNetwork()
|
||||||
|
@ -87,7 +92,8 @@ bool CNXDNKenwoodNetwork::open()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ssrc = m_rtpSocket.getLocalAddress();
|
std::uniform_int_distribution<unsigned int> dist(0x00000001, 0xfffffffe);
|
||||||
|
m_ssrc = dist(m_random);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
class CNXDNKenwoodNetwork : public INXDNNetwork {
|
class CNXDNKenwoodNetwork : public INXDNNetwork {
|
||||||
public:
|
public:
|
||||||
|
@ -69,6 +70,7 @@ private:
|
||||||
unsigned char m_hangType;
|
unsigned char m_hangType;
|
||||||
unsigned short m_hangSrc;
|
unsigned short m_hangSrc;
|
||||||
unsigned short m_hangDst;
|
unsigned short m_hangDst;
|
||||||
|
std::mt19937 m_random;
|
||||||
|
|
||||||
bool processIcomVoiceHeader(const unsigned char* data);
|
bool processIcomVoiceHeader(const unsigned char* data);
|
||||||
bool processIcomVoiceData(const unsigned char* data);
|
bool processIcomVoiceData(const unsigned char* data);
|
||||||
|
|
|
@ -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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
#include "NullModem.h"
|
#include "NullModem.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
CNullModem::CNullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug) :
|
CNullModem::CNullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug) :
|
||||||
CModem(port, duplex,rxInvert, txInvert,pttInvert,txDelay, dmrDelay, trace, debug),
|
CModem(port, duplex,rxInvert, txInvert,pttInvert,txDelay, dmrDelay, useCOSAsLockout, trace, debug),
|
||||||
m_hwType(HWT_MMDVM)
|
m_hwType(HWT_MMDVM)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
class CNullModem : public CModem {
|
class CNullModem : public CModem {
|
||||||
public:
|
public:
|
||||||
CNullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug);
|
CNullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool useCOSAsLockout, bool trace, bool debug);
|
||||||
virtual ~CNullModem();
|
virtual ~CNullModem();
|
||||||
|
|
||||||
virtual void setSerialParams(const std::string& protocol, unsigned int address){};
|
virtual void setSerialParams(const std::string& protocol, unsigned int address){};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2006-2016,2020 by Jonathan Naylor G4KLX
|
* Copyright (C) 2006-2016 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -258,31 +258,3 @@ void CUDPSocket::close()
|
||||||
::close(m_fd);
|
::close(m_fd);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long CUDPSocket::getLocalAddress() const
|
|
||||||
{
|
|
||||||
unsigned long address = 0UL;
|
|
||||||
|
|
||||||
char hostname[80U];
|
|
||||||
int ret = ::gethostname(hostname, 80);
|
|
||||||
if (ret == -1)
|
|
||||||
return 0UL;
|
|
||||||
|
|
||||||
struct hostent* phe = ::gethostbyname(hostname);
|
|
||||||
if (phe == NULL)
|
|
||||||
return 0UL;
|
|
||||||
|
|
||||||
if (phe->h_addrtype != AF_INET)
|
|
||||||
return 0UL;
|
|
||||||
|
|
||||||
for (unsigned int i = 0U; phe->h_addr_list[i] != NULL; i++) {
|
|
||||||
struct in_addr addr;
|
|
||||||
::memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
|
|
||||||
if (addr.s_addr != INADDR_LOOPBACK) {
|
|
||||||
address = addr.s_addr;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return address;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2009-2011,2013,2015,2016,2020 by Jonathan Naylor G4KLX
|
* Copyright (C) 2009-2011,2013,2015,2016 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -47,8 +47,6 @@ public:
|
||||||
|
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
unsigned long getLocalAddress() const;
|
|
||||||
|
|
||||||
static in_addr lookup(const std::string& hostName);
|
static in_addr lookup(const std::string& hostName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue