From 37420dc93c6ed0a9ae169617e833d138044d904c Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 29 Jun 2023 17:13:00 +0100 Subject: [PATCH] Make compiling D-Star conditional. --- AMBEFEC.cpp | 6 +- AMBEFEC.h | 9 +- CRC.cpp | 6 +- CRC.h | 8 +- Conf.cpp | 24 ++ Conf.h | 1030 +++++++++++++++++++++++---------------------- DStarControl.cpp | 67 +-- DStarControl.h | 9 +- DStarHeader.cpp | 7 +- DStarHeader.h | 9 +- DStarNetwork.cpp | 7 +- DStarNetwork.h | 8 +- DStarSlowData.cpp | 5 + DStarSlowData.h | 6 + MMDVMHost.cpp | 108 ++++- MMDVMHost.h | 10 + Modem.cpp | 60 ++- Modem.h | 20 + RemoteControl.cpp | 55 ++- RemoteControl.h | 6 + 20 files changed, 847 insertions(+), 613 deletions(-) diff --git a/AMBEFEC.cpp b/AMBEFEC.cpp index 03f8ac2..5b293c5 100644 --- a/AMBEFEC.cpp +++ b/AMBEFEC.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010,2014,2016,2018,2021 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2014,2016,2018,2021,2023 by Jonathan Naylor G4KLX * Copyright (C) 2016 Mathias Weyland, HB9FRV * * This program is free software; you can redistribute it and/or modify @@ -574,6 +574,7 @@ unsigned int CAMBEFEC::regenerateDMR(unsigned char* bytes) const return errors; } +#if defined(USE_DSTAR) unsigned int CAMBEFEC::regenerateDStar(unsigned char* bytes) const { assert(bytes != NULL); @@ -605,6 +606,7 @@ unsigned int CAMBEFEC::regenerateDStar(unsigned char* bytes) const return errors; } +#endif unsigned int CAMBEFEC::regenerateYSFDN(unsigned char* bytes) const { @@ -791,6 +793,7 @@ unsigned int CAMBEFEC::regenerateIMBE(unsigned char* bytes) const return errors; } +#if defined(USE_DSTAR) unsigned int CAMBEFEC::regenerateDStar(unsigned int& a, unsigned int& b) const { unsigned int orig_a = a; @@ -824,6 +827,7 @@ unsigned int CAMBEFEC::regenerateDStar(unsigned int& a, unsigned int& b) const return errsA + errsB; } +#endif unsigned int CAMBEFEC::regenerateDMR(unsigned int& a, unsigned int& b, unsigned int& c) const { diff --git a/AMBEFEC.h b/AMBEFEC.h index 7e242d4..ebe5322 100644 --- a/AMBEFEC.h +++ b/AMBEFEC.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010,2014,2016,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2014,2016,2018,2023 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,8 @@ #if !defined(AMBEFEC_H) #define AMBEFEC_H +#include "Defines.h" + class CAMBEFEC { public: CAMBEFEC(); @@ -26,14 +28,17 @@ public: unsigned int regenerateDMR(unsigned char* bytes) const; +#if defined(USE_DSTAR) unsigned int regenerateDStar(unsigned char* bytes) const; - +#endif unsigned int regenerateYSFDN(unsigned char* bytes) const; unsigned int regenerateIMBE(unsigned char* bytes) const; private: +#if defined(USE_DSTAR) unsigned int regenerateDStar(unsigned int& a, unsigned int& b) const; +#endif unsigned int regenerateDMR(unsigned int& a, unsigned int& b,unsigned int& c) const; }; diff --git a/CRC.cpp b/CRC.cpp index c99ca6c..fbb5db0 100644 --- a/CRC.cpp +++ b/CRC.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2023 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 @@ const uint8_t CRC8_TABLE[] = { 0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB, 0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3, 0x01 }; +#if defined(USE_DSTAR) const uint16_t CCITT16_TABLE1[] = { 0x0000U, 0x1189U, 0x2312U, 0x329bU, 0x4624U, 0x57adU, 0x6536U, 0x74bfU, 0x8c48U, 0x9dc1U, 0xaf5aU, 0xbed3U, 0xca6cU, 0xdbe5U, 0xe97eU, 0xf8f7U, @@ -83,6 +84,7 @@ const uint16_t CCITT16_TABLE1[] = { 0x6b46U, 0x7acfU, 0x4854U, 0x59ddU, 0x2d62U, 0x3cebU, 0x0e70U, 0x1ff9U, 0xf78fU, 0xe606U, 0xd49dU, 0xc514U, 0xb1abU, 0xa022U, 0x92b9U, 0x8330U, 0x7bc7U, 0x6a4eU, 0x58d5U, 0x495cU, 0x3de3U, 0x2c6aU, 0x1ef1U, 0x0f78U }; +#endif const uint16_t CCITT16_TABLE2[] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, @@ -186,6 +188,7 @@ bool CCRC::checkCCITT162(const unsigned char *in, unsigned int length) return crc8[0U] == in[length - 1U] && crc8[1U] == in[length - 2U]; } +#if defined(USE_DSTAR) void CCRC::addCCITT161(unsigned char *in, unsigned int length) { assert(in != NULL); @@ -226,6 +229,7 @@ bool CCRC::checkCCITT161(const unsigned char *in, unsigned int length) return crc8[0U] == in[length - 2U] && crc8[1U] == in[length - 1U]; } +#endif unsigned char CCRC::crc8(const unsigned char *in, unsigned int length) { diff --git a/CRC.h b/CRC.h index e80c3f6..140dfc3 100644 --- a/CRC.h +++ b/CRC.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2023 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,16 +19,22 @@ #if !defined(CRC_H) #define CRC_H +#include "Defines.h" + class CCRC { public: static bool checkFiveBit(bool* in, unsigned int tcrc); static void encodeFiveBit(const bool* in, unsigned int& tcrc); +#if defined(USE_DSTAR) static void addCCITT161(unsigned char* in, unsigned int length); +#endif static void addCCITT162(unsigned char* in, unsigned int length); +#if defined(USE_DSTAR) static bool checkCCITT161(const unsigned char* in, unsigned int length); +#endif static bool checkCCITT162(const unsigned char* in, unsigned int length); static unsigned char crc8(const unsigned char* in, unsigned int length); diff --git a/Conf.cpp b/Conf.cpp index 6376d89..3b5abca 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -38,7 +38,9 @@ enum SECTION { SECTION_NXDNID_LOOKUP, SECTION_MODEM, SECTION_TRANSPARENT, +#if defined(USE_DSTAR) SECTION_DSTAR, +#endif SECTION_DMR, SECTION_FUSION, SECTION_P25, @@ -53,7 +55,9 @@ enum SECTION { #if defined(USE_AX25) SECTION_AX25, #endif +#if defined(USE_DSTAR) SECTION_DSTAR_NETWORK, +#endif SECTION_DMR_NETWORK, SECTION_FUSION_NETWORK, SECTION_P25_NETWORK, @@ -140,6 +144,7 @@ m_transparentRemoteAddress(), m_transparentRemotePort(0U), m_transparentLocalPort(0U), m_transparentSendFrameType(0U), +#if defined(USE_DSTAR) m_dstarEnabled(false), m_dstarModule("C"), m_dstarSelfOnly(false), @@ -150,6 +155,7 @@ m_dstarAckTime(750U), m_dstarAckMessage(DSTAR_ACK_BER), m_dstarErrorReply(true), m_dstarRemoteGateway(false), +#endif m_dstarModeHang(10U), m_dmrEnabled(false), m_dmrBeacons(DMR_BEACONS_OFF), @@ -252,13 +258,17 @@ m_ax25SlotTime(30U), m_ax25PPersist(128U), m_ax25Trace(false), #endif +#if defined(USE_DSTAR) m_dstarNetworkEnabled(false), m_dstarGatewayAddress(), m_dstarGatewayPort(0U), m_dstarLocalAddress(), m_dstarLocalPort(0U), +#endif m_dstarNetworkModeHang(3U), +#if defined(USE_DSTAR) m_dstarNetworkDebug(false), +#endif m_dmrNetworkEnabled(false), m_dmrNetworkGatewayAddress(), m_dmrNetworkGatewayPort(0U), @@ -373,8 +383,10 @@ bool CConf::read() section = SECTION_MODEM; else if (::strncmp(buffer, "[Transparent Data]", 18U) == 0) section = SECTION_TRANSPARENT; +#if defined(USE_DSTAR) else if (::strncmp(buffer, "[D-Star]", 8U) == 0) section = SECTION_DSTAR; +#endif else if (::strncmp(buffer, "[DMR]", 5U) == 0) section = SECTION_DMR; else if (::strncmp(buffer, "[System Fusion]", 15U) == 0) @@ -397,8 +409,10 @@ bool CConf::read() else if (::strncmp(buffer, "[AX.25]", 7U) == 0) section = SECTION_AX25; #endif +#if defined(USE_DSTAR) else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0) section = SECTION_DSTAR_NETWORK; +#endif else if (::strncmp(buffer, "[DMR Network]", 13U) == 0) section = SECTION_DMR_NETWORK; else if (::strncmp(buffer, "[System Fusion Network]", 23U) == 0) @@ -619,6 +633,7 @@ bool CConf::read() m_transparentLocalPort = (unsigned short)::atoi(value); else if (::strcmp(key, "SendFrameType") == 0) m_transparentSendFrameType = (unsigned int)::atoi(value); +#if defined(USE_DSTAR) } else if (section == SECTION_DSTAR) { if (::strcmp(key, "Enable") == 0) m_dstarEnabled = ::atoi(value) == 1; @@ -667,6 +682,7 @@ bool CConf::read() m_dstarRemoteGateway = ::atoi(value) == 1; else if (::strcmp(key, "ModeHang") == 0) m_dstarModeHang = (unsigned int)::atoi(value); +#endif } else if (section == SECTION_DMR) { if (::strcmp(key, "Enable") == 0) m_dmrEnabled = ::atoi(value) == 1; @@ -920,6 +936,7 @@ bool CConf::read() else if (::strcmp(key, "Trace") == 0) m_ax25Trace = ::atoi(value) == 1; #endif +#if defined(USE_DSTAR) } else if (section == SECTION_DSTAR_NETWORK) { if (::strcmp(key, "Enable") == 0) m_dstarNetworkEnabled = ::atoi(value) == 1; @@ -935,6 +952,7 @@ bool CConf::read() m_dstarNetworkModeHang = (unsigned int)::atoi(value); else if (::strcmp(key, "Debug") == 0) m_dstarNetworkDebug = ::atoi(value) == 1; +#endif } else if (section == SECTION_DMR_NETWORK) { if (::strcmp(key, "Enable") == 0) m_dmrNetworkEnabled = ::atoi(value) == 1; @@ -1327,10 +1345,12 @@ float CConf::getModemCWIdTXLevel() const return m_modemCWIdTXLevel; } +#if defined(USE_DSTAR) float CConf::getModemDStarTXLevel() const { return m_modemDStarTXLevel; } +#endif float CConf::getModemDMRTXLevel() const { @@ -1423,6 +1443,7 @@ unsigned int CConf::getTransparentSendFrameType() const return m_transparentSendFrameType; } +#if defined(USE_DSTAR) bool CConf::getDStarEnabled() const { return m_dstarEnabled; @@ -1477,6 +1498,7 @@ unsigned int CConf::getDStarModeHang() const { return m_dstarModeHang; } +#endif bool CConf::getDMREnabled() const { @@ -1929,6 +1951,7 @@ bool CConf::getAX25Trace() const } #endif +#if defined(USE_DSTAR) bool CConf::getDStarNetworkEnabled() const { return m_dstarNetworkEnabled; @@ -1963,6 +1986,7 @@ bool CConf::getDStarNetworkDebug() const { return m_dstarNetworkDebug; } +#endif bool CConf::getDMRNetworkEnabled() const { diff --git a/Conf.h b/Conf.h index e78088a..6f9a5c9 100644 --- a/Conf.h +++ b/Conf.h @@ -25,613 +25,625 @@ class CConf { public: - CConf(const std::string& file); - ~CConf(); + CConf(const std::string& file); + ~CConf(); - bool read(); + bool read(); - // The General section - std::string getCallsign() const; - unsigned int getId() const; - unsigned int getTimeout() const; - bool getDuplex() const; - bool getDaemon() const; + // The General section + std::string getCallsign() const; + unsigned int getId() const; + unsigned int getTimeout() const; + bool getDuplex() const; + bool getDaemon() const; - // The Info section - unsigned int getRXFrequency() const; - unsigned int getTXFrequency() const; - unsigned int getPower() const; - float getLatitude() const; - float getLongitude() const; - int getHeight() const; - std::string getLocation() const; - std::string getDescription() const; - std::string getURL() const; + // The Info section + unsigned int getRXFrequency() const; + unsigned int getTXFrequency() const; + unsigned int getPower() const; + float getLatitude() const; + float getLongitude() const; + int getHeight() const; + std::string getLocation() const; + std::string getDescription() const; + std::string getURL() const; - // The Log section - unsigned int getLogMQTTLevel() const; - unsigned int getLogDisplayLevel() const; + // The Log section + unsigned int getLogMQTTLevel() const; + unsigned int getLogDisplayLevel() const; - // The MQTT section - std::string getMQTTHost() const; - unsigned short getMQTTPort() const; - unsigned int getMQTTKeepalive() const; - std::string getMQTTName() const; + // The MQTT section + std::string getMQTTHost() const; + unsigned short getMQTTPort() const; + unsigned int getMQTTKeepalive() const; + std::string getMQTTName() const; - // The CW ID section - bool getCWIdEnabled() const; - unsigned int getCWIdTime() const; - std::string getCWIdCallsign() const; + // The CW ID section + bool getCWIdEnabled() const; + unsigned int getCWIdTime() const; + std::string getCWIdCallsign() const; - // The DMR Id section - std::string getDMRIdLookupFile() const; - unsigned int getDMRIdLookupTime() const; + // The DMR Id section + std::string getDMRIdLookupFile() const; + unsigned int getDMRIdLookupTime() const; - // The NXDN Id section - std::string getNXDNIdLookupFile() const; - unsigned int getNXDNIdLookupTime() const; + // The NXDN Id section + std::string getNXDNIdLookupFile() const; + unsigned int getNXDNIdLookupTime() const; - // The Modem section - std::string getModemProtocol() const; - std::string getModemUARTPort() const; - unsigned int getModemUARTSpeed() const; - std::string getModemI2CPort() const; - unsigned int getModemI2CAddress() const; - std::string getModemModemAddress() const; - unsigned short getModemModemPort() const; - std::string getModemLocalAddress() const; - unsigned short getModemLocalPort() const; - bool getModemRXInvert() const; - bool getModemTXInvert() const; - bool getModemPTTInvert() const; - unsigned int getModemTXDelay() const; - unsigned int getModemDMRDelay() const; - int getModemTXOffset() const; - int getModemRXOffset() const; - int getModemRXDCOffset() const; - int getModemTXDCOffset() const; - float getModemRFLevel() const; - float getModemRXLevel() const; - float getModemCWIdTXLevel() const; - float getModemDStarTXLevel() const; - float getModemDMRTXLevel() const; - float getModemYSFTXLevel() const; - float getModemP25TXLevel() const; - float getModemNXDNTXLevel() const; - float getModemM17TXLevel() const; + // The Modem section + std::string getModemProtocol() const; + std::string getModemUARTPort() const; + unsigned int getModemUARTSpeed() const; + std::string getModemI2CPort() const; + unsigned int getModemI2CAddress() const; + std::string getModemModemAddress() const; + unsigned short getModemModemPort() const; + std::string getModemLocalAddress() const; + unsigned short getModemLocalPort() const; + bool getModemRXInvert() const; + bool getModemTXInvert() const; + bool getModemPTTInvert() const; + unsigned int getModemTXDelay() const; + unsigned int getModemDMRDelay() const; + int getModemTXOffset() const; + int getModemRXOffset() const; + int getModemRXDCOffset() const; + int getModemTXDCOffset() const; + float getModemRFLevel() const; + float getModemRXLevel() const; + float getModemCWIdTXLevel() const; +#if defined(USE_DSTAR) + float getModemDStarTXLevel() const; +#endif + float getModemDMRTXLevel() const; + float getModemYSFTXLevel() const; + float getModemP25TXLevel() const; + float getModemNXDNTXLevel() const; + float getModemM17TXLevel() const; #if defined(USE_POCSAG) - float getModemPOCSAGTXLevel() const; + float getModemPOCSAGTXLevel() const; #endif #if defined(USE_FM) - float getModemFMTXLevel() const; + float getModemFMTXLevel() const; #endif #if defined(USE_AX25) - float getModemAX25TXLevel() const; + float getModemAX25TXLevel() const; #endif - std::string getModemRSSIMappingFile() const; - bool getModemUseCOSAsLockout() const; - bool getModemTrace() const; - bool getModemDebug() const; + std::string getModemRSSIMappingFile() const; + bool getModemUseCOSAsLockout() const; + bool getModemTrace() const; + bool getModemDebug() const; - // The Transparent Data section - bool getTransparentEnabled() const; - std::string getTransparentRemoteAddress() const; - unsigned short getTransparentRemotePort() const; - unsigned short getTransparentLocalPort() const; - unsigned int getTransparentSendFrameType() const; + // The Transparent Data section + bool getTransparentEnabled() const; + std::string getTransparentRemoteAddress() const; + unsigned short getTransparentRemotePort() const; + unsigned short getTransparentLocalPort() const; + unsigned int getTransparentSendFrameType() const; - // The D-Star section - bool getDStarEnabled() const; - std::string getDStarModule() const; - bool getDStarSelfOnly() const; - std::vector getDStarBlackList() const; - std::vector getDStarWhiteList() const; - bool getDStarAckReply() const; - unsigned int getDStarAckTime() const; - DSTAR_ACK_MESSAGE getDStarAckMessage() const; - bool getDStarErrorReply() const; - bool getDStarRemoteGateway() const; - unsigned int getDStarModeHang() const; + // The D-Star section +#if defined(USE_DSTAR) + bool getDStarEnabled() const; + std::string getDStarModule() const; + bool getDStarSelfOnly() const; + std::vector getDStarBlackList() const; + std::vector getDStarWhiteList() const; + bool getDStarAckReply() const; + unsigned int getDStarAckTime() const; + DSTAR_ACK_MESSAGE getDStarAckMessage() const; + bool getDStarErrorReply() const; + bool getDStarRemoteGateway() const; + unsigned int getDStarModeHang() const; +#endif - // The DMR section - bool getDMREnabled() const; - DMR_BEACONS getDMRBeacons() const; - unsigned int getDMRBeaconInterval() const; - unsigned int getDMRBeaconDuration() const; - unsigned int getDMRId() const; - unsigned int getDMRColorCode() const; - bool getDMREmbeddedLCOnly() const; - bool getDMRDumpTAData() const; - bool getDMRSelfOnly() const; - std::vector getDMRPrefixes() const; - std::vector getDMRBlackList() const; - std::vector getDMRWhiteList() const; - std::vector getDMRSlot1TGWhiteList() const; - std::vector getDMRSlot2TGWhiteList() const; - unsigned int getDMRCallHang() const; - unsigned int getDMRTXHang() const; - unsigned int getDMRModeHang() const; - DMR_OVCM_TYPES getDMROVCM() const; + // The DMR section + bool getDMREnabled() const; + DMR_BEACONS getDMRBeacons() const; + unsigned int getDMRBeaconInterval() const; + unsigned int getDMRBeaconDuration() const; + unsigned int getDMRId() const; + unsigned int getDMRColorCode() const; + bool getDMREmbeddedLCOnly() const; + bool getDMRDumpTAData() const; + bool getDMRSelfOnly() const; + std::vector getDMRPrefixes() const; + std::vector getDMRBlackList() const; + std::vector getDMRWhiteList() const; + std::vector getDMRSlot1TGWhiteList() const; + std::vector getDMRSlot2TGWhiteList() const; + unsigned int getDMRCallHang() const; + unsigned int getDMRTXHang() const; + unsigned int getDMRModeHang() const; + DMR_OVCM_TYPES getDMROVCM() const; - // The System Fusion section - bool getFusionEnabled() const; - bool getFusionLowDeviation() const; - bool getFusionRemoteGateway() const; - bool getFusionSelfOnly() const; - unsigned int getFusionTXHang() const; - unsigned int getFusionModeHang() const; + // The System Fusion section + bool getFusionEnabled() const; + bool getFusionLowDeviation() const; + bool getFusionRemoteGateway() const; + bool getFusionSelfOnly() const; + unsigned int getFusionTXHang() const; + unsigned int getFusionModeHang() const; - // The P25 section - bool getP25Enabled() const; - unsigned int getP25Id() const; - unsigned int getP25NAC() const; - bool getP25SelfOnly() const; - bool getP25OverrideUID() const; - bool getP25RemoteGateway() const; - unsigned int getP25TXHang() const; - unsigned int getP25ModeHang() const; + // The P25 section + bool getP25Enabled() const; + unsigned int getP25Id() const; + unsigned int getP25NAC() const; + bool getP25SelfOnly() const; + bool getP25OverrideUID() const; + bool getP25RemoteGateway() const; + unsigned int getP25TXHang() const; + unsigned int getP25ModeHang() const; - // The NXDN section - bool getNXDNEnabled() const; - unsigned int getNXDNId() const; - unsigned int getNXDNRAN() const; - bool getNXDNSelfOnly() const; - bool getNXDNRemoteGateway() const; - unsigned int getNXDNTXHang() const; - unsigned int getNXDNModeHang() const; + // The NXDN section + bool getNXDNEnabled() const; + unsigned int getNXDNId() const; + unsigned int getNXDNRAN() const; + bool getNXDNSelfOnly() const; + bool getNXDNRemoteGateway() const; + unsigned int getNXDNTXHang() const; + unsigned int getNXDNModeHang() const; - // The M17 section - bool getM17Enabled() const; - unsigned int getM17CAN() const; - bool getM17SelfOnly() const; - bool getM17AllowEncryption() const; - unsigned int getM17TXHang() const; - unsigned int getM17ModeHang() const; + // The M17 section + bool getM17Enabled() const; + unsigned int getM17CAN() const; + bool getM17SelfOnly() const; + bool getM17AllowEncryption() const; + unsigned int getM17TXHang() const; + unsigned int getM17ModeHang() const; #if defined(USE_POCSAG) - // The POCSAG section - bool getPOCSAGEnabled() const; - unsigned int getPOCSAGFrequency() const; + // The POCSAG section + bool getPOCSAGEnabled() const; + unsigned int getPOCSAGFrequency() const; #endif #if defined(USE_AX25) - // The AX.25 section - bool getAX25Enabled() const; - unsigned int getAX25TXDelay() const; - int getAX25RXTwist() const; - unsigned int getAX25SlotTime() const; - unsigned int getAX25PPersist() const; - bool getAX25Trace() const; + // The AX.25 section + bool getAX25Enabled() const; + unsigned int getAX25TXDelay() const; + int getAX25RXTwist() const; + unsigned int getAX25SlotTime() const; + unsigned int getAX25PPersist() const; + bool getAX25Trace() const; #endif #if defined(USE_FM) - // 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; - unsigned int getFMAccessMode() const; - bool getFMLinkMode() const; - bool getFMCOSInvert() const; - bool getFMNoiseSquelch() const; - unsigned int getFMSquelchHighThreshold() const; - unsigned int getFMSquelchLowThreshold() const; - unsigned int getFMRFAudioBoost() const; - float getFMMaxDevLevel() const; - unsigned int getFMExtAudioBoost() const; - unsigned int getFMModeHang() 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; + unsigned int getFMAccessMode() const; + bool getFMLinkMode() const; + bool getFMCOSInvert() const; + bool getFMNoiseSquelch() const; + unsigned int getFMSquelchHighThreshold() const; + unsigned int getFMSquelchLowThreshold() const; + unsigned int getFMRFAudioBoost() const; + float getFMMaxDevLevel() const; + unsigned int getFMExtAudioBoost() const; + unsigned int getFMModeHang() const; #endif - // The D-Star Network section - bool getDStarNetworkEnabled() const; - std::string getDStarGatewayAddress() const; - unsigned short getDStarGatewayPort() const; - std::string getDStarLocalAddress() const; - unsigned short getDStarLocalPort() const; - unsigned int getDStarNetworkModeHang() const; - bool getDStarNetworkDebug() const; +#if defined(USE_DSTAR) + // The D-Star Network section + bool getDStarNetworkEnabled() const; + std::string getDStarGatewayAddress() const; + unsigned short getDStarGatewayPort() const; + std::string getDStarLocalAddress() const; + unsigned short getDStarLocalPort() const; + unsigned int getDStarNetworkModeHang() const; + bool getDStarNetworkDebug() const; +#endif - // The DMR Network section - bool getDMRNetworkEnabled() const; - std::string getDMRNetworkGatewayAddress() const; - unsigned short getDMRNetworkGatewayPort() const; - std::string getDMRNetworkLocalAddress() const; - unsigned short getDMRNetworkLocalPort() const; - bool getDMRNetworkDebug() const; - unsigned int getDMRNetworkJitter() const; - bool getDMRNetworkSlot1() const; - bool getDMRNetworkSlot2() const; - unsigned int getDMRNetworkModeHang() const; + // The DMR Network section + bool getDMRNetworkEnabled() const; + std::string getDMRNetworkGatewayAddress() const; + unsigned short getDMRNetworkGatewayPort() const; + std::string getDMRNetworkLocalAddress() const; + unsigned short getDMRNetworkLocalPort() const; + bool getDMRNetworkDebug() const; + unsigned int getDMRNetworkJitter() const; + bool getDMRNetworkSlot1() const; + bool getDMRNetworkSlot2() const; + unsigned int getDMRNetworkModeHang() const; - // The System Fusion Network section - bool getFusionNetworkEnabled() const; - std::string getFusionNetworkLocalAddress() const; - unsigned short getFusionNetworkLocalPort() const; - std::string getFusionNetworkGatewayAddress() const; - unsigned short getFusionNetworkGatewayPort() const; - unsigned int getFusionNetworkModeHang() const; - bool getFusionNetworkDebug() const; + // The System Fusion Network section + bool getFusionNetworkEnabled() const; + std::string getFusionNetworkLocalAddress() const; + unsigned short getFusionNetworkLocalPort() const; + std::string getFusionNetworkGatewayAddress() const; + unsigned short getFusionNetworkGatewayPort() const; + unsigned int getFusionNetworkModeHang() const; + bool getFusionNetworkDebug() const; - // The P25 Network section - bool getP25NetworkEnabled() const; - std::string getP25GatewayAddress() const; - unsigned short getP25GatewayPort() const; - std::string getP25LocalAddress() const; - unsigned short getP25LocalPort() const; - unsigned int getP25NetworkModeHang() const; - bool getP25NetworkDebug() const; + // The P25 Network section + bool getP25NetworkEnabled() const; + std::string getP25GatewayAddress() const; + unsigned short getP25GatewayPort() const; + std::string getP25LocalAddress() const; + unsigned short getP25LocalPort() const; + unsigned int getP25NetworkModeHang() const; + bool getP25NetworkDebug() const; - // The NXDN Network section - bool getNXDNNetworkEnabled() const; - std::string getNXDNNetworkProtocol() const; - std::string getNXDNGatewayAddress() const; - unsigned short getNXDNGatewayPort() const; - std::string getNXDNLocalAddress() const; - unsigned short getNXDNLocalPort() const; - unsigned int getNXDNNetworkModeHang() const; - bool getNXDNNetworkDebug() const; + // The NXDN Network section + bool getNXDNNetworkEnabled() const; + std::string getNXDNNetworkProtocol() const; + std::string getNXDNGatewayAddress() const; + unsigned short getNXDNGatewayPort() const; + std::string getNXDNLocalAddress() const; + unsigned short getNXDNLocalPort() const; + unsigned int getNXDNNetworkModeHang() const; + bool getNXDNNetworkDebug() const; - // The M17 Network section - bool getM17NetworkEnabled() const; - std::string getM17GatewayAddress() const; - unsigned short getM17GatewayPort() const; - std::string getM17LocalAddress() const; - unsigned short getM17LocalPort() const; - unsigned int getM17NetworkModeHang() const; - bool getM17NetworkDebug() const; + // The M17 Network section + bool getM17NetworkEnabled() const; + std::string getM17GatewayAddress() const; + unsigned short getM17GatewayPort() const; + std::string getM17LocalAddress() const; + unsigned short getM17LocalPort() const; + unsigned int getM17NetworkModeHang() const; + bool getM17NetworkDebug() const; #if defined(USE_POCSAG) - // The POCSAG Network section - bool getPOCSAGNetworkEnabled() const; - std::string getPOCSAGGatewayAddress() const; - unsigned short getPOCSAGGatewayPort() const; - std::string getPOCSAGLocalAddress() const; - unsigned short getPOCSAGLocalPort() const; - unsigned int getPOCSAGNetworkModeHang() const; - bool getPOCSAGNetworkDebug() const; + // The POCSAG Network section + bool getPOCSAGNetworkEnabled() const; + std::string getPOCSAGGatewayAddress() const; + unsigned short getPOCSAGGatewayPort() const; + std::string getPOCSAGLocalAddress() const; + unsigned short getPOCSAGLocalPort() const; + unsigned int getPOCSAGNetworkModeHang() const; + bool getPOCSAGNetworkDebug() const; #endif #if defined(USE_FM) - // The FM Network section - bool getFMNetworkEnabled() const; - std::string getFMNetworkProtocol() const; - std::string getFMGatewayAddress() const; - unsigned short getFMGatewayPort() const; - std::string getFMLocalAddress() const; - unsigned short getFMLocalPort() const; - bool getFMPreEmphasis() const; - bool getFMDeEmphasis() const; - float getFMTXAudioGain() const; - float getFMRXAudioGain() const; - unsigned int getFMNetworkModeHang() const; - bool getFMNetworkDebug() const; + // The FM Network section + bool getFMNetworkEnabled() const; + std::string getFMNetworkProtocol() const; + std::string getFMGatewayAddress() const; + unsigned short getFMGatewayPort() const; + std::string getFMLocalAddress() const; + unsigned short getFMLocalPort() const; + bool getFMPreEmphasis() const; + bool getFMDeEmphasis() const; + float getFMTXAudioGain() const; + float getFMRXAudioGain() const; + unsigned int getFMNetworkModeHang() const; + bool getFMNetworkDebug() const; #endif #if defined(USE_AX25) - // The AX.25 Network section - bool getAX25NetworkEnabled() const; - std::string getAX25NetworkPort() const; - unsigned int getAX25NetworkSpeed() const; - bool getAX25NetworkDebug() const; + // The AX.25 Network section + bool getAX25NetworkEnabled() const; + std::string getAX25NetworkPort() const; + unsigned int getAX25NetworkSpeed() const; + bool getAX25NetworkDebug() const; #endif - // The Lock File section - bool getLockFileEnabled() const; - std::string getLockFileName() const; + // The Lock File section + bool getLockFileEnabled() const; + std::string getLockFileName() const; - // The Remote Control section - bool getRemoteControlEnabled() const; + // The Remote Control section + bool getRemoteControlEnabled() const; private: - std::string m_file; - std::string m_callsign; - unsigned int m_id; - unsigned int m_timeout; - bool m_duplex; - bool m_daemon; + std::string m_file; + std::string m_callsign; + unsigned int m_id; + unsigned int m_timeout; + bool m_duplex; + bool m_daemon; - unsigned int m_rxFrequency; - unsigned int m_txFrequency; - unsigned int m_power; - float m_latitude; - float m_longitude; - int m_height; - std::string m_location; - std::string m_description; - std::string m_url; + unsigned int m_rxFrequency; + unsigned int m_txFrequency; + unsigned int m_power; + float m_latitude; + float m_longitude; + int m_height; + std::string m_location; + std::string m_description; + std::string m_url; - unsigned int m_logMQTTLevel; - unsigned int m_logDisplayLevel; + unsigned int m_logMQTTLevel; + unsigned int m_logDisplayLevel; - std::string m_mqttHost; - unsigned short m_mqttPort; - unsigned int m_mqttKeepalive; - std::string m_mqttName; + std::string m_mqttHost; + unsigned short m_mqttPort; + unsigned int m_mqttKeepalive; + std::string m_mqttName; - bool m_cwIdEnabled; - unsigned int m_cwIdTime; - std::string m_cwIdCallsign; + bool m_cwIdEnabled; + unsigned int m_cwIdTime; + std::string m_cwIdCallsign; - std::string m_dmrIdLookupFile; - unsigned int m_dmrIdLookupTime; + std::string m_dmrIdLookupFile; + unsigned int m_dmrIdLookupTime; - std::string m_nxdnIdLookupFile; - unsigned int m_nxdnIdLookupTime; + std::string m_nxdnIdLookupFile; + unsigned int m_nxdnIdLookupTime; - std::string m_modemProtocol; - std::string m_modemUARTPort; - unsigned int m_modemUARTSpeed; - std::string m_modemI2CPort; - unsigned int m_modemI2CAddress; - std::string m_modemModemAddress; - unsigned short m_modemModemPort; - std::string m_modemLocalAddress; - unsigned short m_modemLocalPort; - bool m_modemRXInvert; - bool m_modemTXInvert; - bool m_modemPTTInvert; - unsigned int m_modemTXDelay; - unsigned int m_modemDMRDelay; - int m_modemTXOffset; - int m_modemRXOffset; - int m_modemRXDCOffset; - int m_modemTXDCOffset; - float m_modemRFLevel; - float m_modemRXLevel; - float m_modemCWIdTXLevel; - float m_modemDStarTXLevel; - float m_modemDMRTXLevel; - float m_modemYSFTXLevel; - float m_modemP25TXLevel; - float m_modemNXDNTXLevel; - float m_modemM17TXLevel; - float m_modemPOCSAGTXLevel; - float m_modemFMTXLevel; - float m_modemAX25TXLevel; - std::string m_modemRSSIMappingFile; - bool m_modemUseCOSAsLockout; - bool m_modemTrace; - bool m_modemDebug; + std::string m_modemProtocol; + std::string m_modemUARTPort; + unsigned int m_modemUARTSpeed; + std::string m_modemI2CPort; + unsigned int m_modemI2CAddress; + std::string m_modemModemAddress; + unsigned short m_modemModemPort; + std::string m_modemLocalAddress; + unsigned short m_modemLocalPort; + bool m_modemRXInvert; + bool m_modemTXInvert; + bool m_modemPTTInvert; + unsigned int m_modemTXDelay; + unsigned int m_modemDMRDelay; + int m_modemTXOffset; + int m_modemRXOffset; + int m_modemRXDCOffset; + int m_modemTXDCOffset; + float m_modemRFLevel; + float m_modemRXLevel; + float m_modemCWIdTXLevel; + float m_modemDStarTXLevel; + float m_modemDMRTXLevel; + float m_modemYSFTXLevel; + float m_modemP25TXLevel; + float m_modemNXDNTXLevel; + float m_modemM17TXLevel; + float m_modemPOCSAGTXLevel; + float m_modemFMTXLevel; + float m_modemAX25TXLevel; + std::string m_modemRSSIMappingFile; + bool m_modemUseCOSAsLockout; + bool m_modemTrace; + bool m_modemDebug; - bool m_transparentEnabled; - std::string m_transparentRemoteAddress; - unsigned short m_transparentRemotePort; - unsigned short m_transparentLocalPort; - unsigned int m_transparentSendFrameType; + bool m_transparentEnabled; + std::string m_transparentRemoteAddress; + unsigned short m_transparentRemotePort; + unsigned short m_transparentLocalPort; + unsigned int m_transparentSendFrameType; - bool m_dstarEnabled; - std::string m_dstarModule; - bool m_dstarSelfOnly; - std::vector m_dstarBlackList; - std::vector m_dstarWhiteList; - bool m_dstarAckReply; - unsigned int m_dstarAckTime; - DSTAR_ACK_MESSAGE m_dstarAckMessage; - bool m_dstarErrorReply; - bool m_dstarRemoteGateway; - unsigned int m_dstarModeHang; +#if defined(USE_DSTAR) + bool m_dstarEnabled; + std::string m_dstarModule; + bool m_dstarSelfOnly; + std::vector m_dstarBlackList; + std::vector m_dstarWhiteList; + bool m_dstarAckReply; + unsigned int m_dstarAckTime; + DSTAR_ACK_MESSAGE m_dstarAckMessage; + bool m_dstarErrorReply; + bool m_dstarRemoteGateway; +#endif + unsigned int m_dstarModeHang; - bool m_dmrEnabled; - DMR_BEACONS m_dmrBeacons; - unsigned int m_dmrBeaconInterval; - unsigned int m_dmrBeaconDuration; - unsigned int m_dmrId; - unsigned int m_dmrColorCode; - bool m_dmrSelfOnly; - bool m_dmrEmbeddedLCOnly; - bool m_dmrDumpTAData; - std::vector m_dmrPrefixes; - std::vector m_dmrBlackList; - std::vector m_dmrWhiteList; - std::vector m_dmrSlot1TGWhiteList; - std::vector m_dmrSlot2TGWhiteList; - unsigned int m_dmrCallHang; - unsigned int m_dmrTXHang; - unsigned int m_dmrModeHang; - DMR_OVCM_TYPES m_dmrOVCM; + bool m_dmrEnabled; + DMR_BEACONS m_dmrBeacons; + unsigned int m_dmrBeaconInterval; + unsigned int m_dmrBeaconDuration; + unsigned int m_dmrId; + unsigned int m_dmrColorCode; + bool m_dmrSelfOnly; + bool m_dmrEmbeddedLCOnly; + bool m_dmrDumpTAData; + std::vector m_dmrPrefixes; + std::vector m_dmrBlackList; + std::vector m_dmrWhiteList; + std::vector m_dmrSlot1TGWhiteList; + std::vector m_dmrSlot2TGWhiteList; + unsigned int m_dmrCallHang; + unsigned int m_dmrTXHang; + unsigned int m_dmrModeHang; + DMR_OVCM_TYPES m_dmrOVCM; - bool m_fusionEnabled; - bool m_fusionLowDeviation; - bool m_fusionRemoteGateway; - bool m_fusionSelfOnly; - unsigned int m_fusionTXHang; - unsigned int m_fusionModeHang; + bool m_fusionEnabled; + bool m_fusionLowDeviation; + bool m_fusionRemoteGateway; + bool m_fusionSelfOnly; + unsigned int m_fusionTXHang; + unsigned int m_fusionModeHang; - bool m_p25Enabled; - unsigned int m_p25Id; - unsigned int m_p25NAC; - bool m_p25SelfOnly; - bool m_p25OverrideUID; - bool m_p25RemoteGateway; - unsigned int m_p25TXHang; - unsigned int m_p25ModeHang; + bool m_p25Enabled; + unsigned int m_p25Id; + unsigned int m_p25NAC; + bool m_p25SelfOnly; + bool m_p25OverrideUID; + bool m_p25RemoteGateway; + unsigned int m_p25TXHang; + unsigned int m_p25ModeHang; - bool m_nxdnEnabled; - unsigned int m_nxdnId; - unsigned int m_nxdnRAN; - bool m_nxdnSelfOnly; - bool m_nxdnRemoteGateway; - unsigned int m_nxdnTXHang; - unsigned int m_nxdnModeHang; + bool m_nxdnEnabled; + unsigned int m_nxdnId; + unsigned int m_nxdnRAN; + bool m_nxdnSelfOnly; + bool m_nxdnRemoteGateway; + unsigned int m_nxdnTXHang; + unsigned int m_nxdnModeHang; - bool m_m17Enabled; - unsigned int m_m17CAN; - bool m_m17SelfOnly; - bool m_m17AllowEncryption; - unsigned int m_m17TXHang; - unsigned int m_m17ModeHang; + bool m_m17Enabled; + unsigned int m_m17CAN; + bool m_m17SelfOnly; + bool m_m17AllowEncryption; + unsigned int m_m17TXHang; + unsigned int m_m17ModeHang; #if defined(USE_POCSAG) - bool m_pocsagEnabled; + bool m_pocsagEnabled; #endif - unsigned int m_pocsagFrequency; + unsigned int m_pocsagFrequency; #if defined(USE_FM) - bool m_fmEnabled; + bool m_fmEnabled; #endif - std::string m_fmCallsign; + std::string m_fmCallsign; #if defined(USE_FM) - 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_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; #endif - unsigned int m_fmTimeout; + unsigned int m_fmTimeout; #if defined(USE_FM) - 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; - unsigned int m_fmAccessMode; - bool m_fmLinkMode; - bool m_fmCOSInvert; - bool m_fmNoiseSquelch; - unsigned int m_fmSquelchHighThreshold; - unsigned int m_fmSquelchLowThreshold; - unsigned int m_fmRFAudioBoost; - float m_fmMaxDevLevel; - unsigned int m_fmExtAudioBoost; + 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; + unsigned int m_fmAccessMode; + bool m_fmLinkMode; + bool m_fmCOSInvert; + bool m_fmNoiseSquelch; + unsigned int m_fmSquelchHighThreshold; + unsigned int m_fmSquelchLowThreshold; + unsigned int m_fmRFAudioBoost; + float m_fmMaxDevLevel; + unsigned int m_fmExtAudioBoost; #endif - unsigned int m_fmModeHang; + unsigned int m_fmModeHang; #if defined(USE_AX25) - bool m_ax25Enabled; + bool m_ax25Enabled; #endif - unsigned int m_ax25TXDelay; + unsigned int m_ax25TXDelay; #if defined(USE_AX25) - int m_ax25RXTwist; - unsigned int m_ax25SlotTime; - unsigned int m_ax25PPersist; - bool m_ax25Trace; + int m_ax25RXTwist; + unsigned int m_ax25SlotTime; + unsigned int m_ax25PPersist; + bool m_ax25Trace; #endif - bool m_dstarNetworkEnabled; - std::string m_dstarGatewayAddress; - unsigned short m_dstarGatewayPort; - std::string m_dstarLocalAddress; - unsigned short m_dstarLocalPort; - unsigned int m_dstarNetworkModeHang; - bool m_dstarNetworkDebug; +#if defined(USE_DSTAR) + bool m_dstarNetworkEnabled; + std::string m_dstarGatewayAddress; + unsigned short m_dstarGatewayPort; + std::string m_dstarLocalAddress; + unsigned short m_dstarLocalPort; +#endif + unsigned int m_dstarNetworkModeHang; +#if defined(USE_DSTAR) + bool m_dstarNetworkDebug; +#endif - bool m_dmrNetworkEnabled; - std::string m_dmrNetworkGatewayAddress; - unsigned short m_dmrNetworkGatewayPort; - std::string m_dmrNetworkLocalAddress; - unsigned short m_dmrNetworkLocalPort; - bool m_dmrNetworkDebug; - unsigned int m_dmrNetworkJitter; - bool m_dmrNetworkSlot1; - bool m_dmrNetworkSlot2; - unsigned int m_dmrNetworkModeHang; + bool m_dmrNetworkEnabled; + std::string m_dmrNetworkGatewayAddress; + unsigned short m_dmrNetworkGatewayPort; + std::string m_dmrNetworkLocalAddress; + unsigned short m_dmrNetworkLocalPort; + bool m_dmrNetworkDebug; + unsigned int m_dmrNetworkJitter; + bool m_dmrNetworkSlot1; + bool m_dmrNetworkSlot2; + unsigned int m_dmrNetworkModeHang; - bool m_fusionNetworkEnabled; - std::string m_fusionNetworkLocalAddress; - unsigned short m_fusionNetworkLocalPort; - std::string m_fusionNetworkGatewayAddress; - unsigned short m_fusionNetworkGatewayPort; - unsigned int m_fusionNetworkModeHang; - bool m_fusionNetworkDebug; + bool m_fusionNetworkEnabled; + std::string m_fusionNetworkLocalAddress; + unsigned short m_fusionNetworkLocalPort; + std::string m_fusionNetworkGatewayAddress; + unsigned short m_fusionNetworkGatewayPort; + unsigned int m_fusionNetworkModeHang; + bool m_fusionNetworkDebug; - bool m_p25NetworkEnabled; - std::string m_p25GatewayAddress; - unsigned short m_p25GatewayPort; - std::string m_p25LocalAddress; - unsigned short m_p25LocalPort; - unsigned int m_p25NetworkModeHang; - bool m_p25NetworkDebug; + bool m_p25NetworkEnabled; + std::string m_p25GatewayAddress; + unsigned short m_p25GatewayPort; + std::string m_p25LocalAddress; + unsigned short m_p25LocalPort; + unsigned int m_p25NetworkModeHang; + bool m_p25NetworkDebug; - bool m_nxdnNetworkEnabled; - std::string m_nxdnNetworkProtocol; - std::string m_nxdnGatewayAddress; - unsigned short m_nxdnGatewayPort; - std::string m_nxdnLocalAddress; - unsigned short m_nxdnLocalPort; - unsigned int m_nxdnNetworkModeHang; - bool m_nxdnNetworkDebug; + bool m_nxdnNetworkEnabled; + std::string m_nxdnNetworkProtocol; + std::string m_nxdnGatewayAddress; + unsigned short m_nxdnGatewayPort; + std::string m_nxdnLocalAddress; + unsigned short m_nxdnLocalPort; + unsigned int m_nxdnNetworkModeHang; + bool m_nxdnNetworkDebug; - bool m_m17NetworkEnabled; - std::string m_m17GatewayAddress; - unsigned short m_m17GatewayPort; - std::string m_m17LocalAddress; - unsigned short m_m17LocalPort; - unsigned int m_m17NetworkModeHang; - bool m_m17NetworkDebug; + bool m_m17NetworkEnabled; + std::string m_m17GatewayAddress; + unsigned short m_m17GatewayPort; + std::string m_m17LocalAddress; + unsigned short m_m17LocalPort; + unsigned int m_m17NetworkModeHang; + bool m_m17NetworkDebug; #if defined(USE_POCSAG) - bool m_pocsagNetworkEnabled; - std::string m_pocsagGatewayAddress; - unsigned short m_pocsagGatewayPort; - std::string m_pocsagLocalAddress; - unsigned short m_pocsagLocalPort; - unsigned int m_pocsagNetworkModeHang; - bool m_pocsagNetworkDebug; + bool m_pocsagNetworkEnabled; + std::string m_pocsagGatewayAddress; + unsigned short m_pocsagGatewayPort; + std::string m_pocsagLocalAddress; + unsigned short m_pocsagLocalPort; + unsigned int m_pocsagNetworkModeHang; + bool m_pocsagNetworkDebug; #endif #if defined(USE_FM) - bool m_fmNetworkEnabled; - std::string m_fmNetworkProtocol; - std::string m_fmGatewayAddress; - unsigned short m_fmGatewayPort; - std::string m_fmLocalAddress; - unsigned short m_fmLocalPort; - bool m_fmPreEmphasis; - bool m_fmDeEmphasis; - float m_fmTXAudioGain; - float m_fmRXAudioGain; + bool m_fmNetworkEnabled; + std::string m_fmNetworkProtocol; + std::string m_fmGatewayAddress; + unsigned short m_fmGatewayPort; + std::string m_fmLocalAddress; + unsigned short m_fmLocalPort; + bool m_fmPreEmphasis; + bool m_fmDeEmphasis; + float m_fmTXAudioGain; + float m_fmRXAudioGain; #endif - unsigned int m_fmNetworkModeHang; + unsigned int m_fmNetworkModeHang; #if defined(USE_FM) - bool m_fmNetworkDebug; + bool m_fmNetworkDebug; #endif #if defined(USE_AX25) - bool m_ax25NetworkEnabled; - std::string m_ax25NetworkPort; - unsigned int m_ax25NetworkSpeed; - bool m_ax25NetworkDebug; + bool m_ax25NetworkEnabled; + std::string m_ax25NetworkPort; + unsigned int m_ax25NetworkSpeed; + bool m_ax25NetworkDebug; #endif - bool m_lockFileEnabled; - std::string m_lockFileName; + bool m_lockFileEnabled; + std::string m_lockFileName; - bool m_remoteControlEnabled; + bool m_remoteControlEnabled; }; #endif diff --git a/DStarControl.cpp b/DStarControl.cpp index 197eda8..19f8c52 100644 --- a/DStarControl.cpp +++ b/DStarControl.cpp @@ -16,6 +16,8 @@ #include "Sync.h" #include "Log.h" +#if defined(USE_DSTAR) + #include #include #include @@ -38,8 +40,6 @@ bool CallsignCompare(const std::string& arg, const unsigned char* my) return true; } -// #define DUMP_DSTAR - CDStarControl::CDStarControl(const std::string& callsign, const std::string& module, bool selfOnly, bool ackReply, unsigned int ackTime, DSTAR_ACK_MESSAGE ackMessage, bool errorReply, const std::vector& blackList, const std::vector& whiteList, CDStarNetwork* network, unsigned int timeout, bool duplex, bool remoteGateway, CRSSIInterpolator* rssiMapper) : m_callsign(NULL), m_gateway(NULL), @@ -703,10 +703,6 @@ void CDStarControl::writeEndNet() if (m_network != NULL) m_network->reset(); - -#if defined(DUMP_DSTAR) - closeFile(); -#endif } void CDStarControl::writeNetwork() @@ -768,10 +764,6 @@ void CDStarControl::writeNetwork() writeQueueHeaderNet(data); -#if defined(DUMP_DSTAR) - openFile(); - writeFile(data + 1U, length - 1U); -#endif m_netState = RS_NET_AUDIO; LINK_STATUS status = LS_NONE; @@ -797,10 +789,6 @@ void CDStarControl::writeNetwork() data[1U] = TAG_EOT; -#if defined(DUMP_DSTAR) - writeFile(data + 1U, length - 1U); - closeFile(); -#endif m_netNextFrameIsFastData = false; m_netSkipDTMFBlankingFrames = 0U; @@ -852,12 +840,6 @@ void CDStarControl::writeNetwork() m_packetTimer.start(); m_netFrames++; -#if defined(DUMP_DSTAR) - if (n == 1U) - writeFile(m_netVoiceSyncData + 1U, m_netVoiceSyncDataLen - 1U); - if (n >= 1U) - writeFile(data + 1U, length - 1U); -#endif if (n == 1U) writeQueueDataNet(m_netVoiceSyncData + 1U); if (n >= 1U) @@ -906,9 +888,6 @@ void CDStarControl::clock() LogMessage("D-Star, network watchdog has expired, %.1f seconds, %u%% packet loss", float(m_netFrames) / 50.0F, (m_netLost * 100U) / m_netFrames); writeJSONNet("lost", float(m_netFrames) / 50.0F, (m_netLost * 100U) / m_netFrames); writeEndNet(); -#if defined(DUMP_DSTAR) - closeFile(); -#endif } } @@ -1088,46 +1067,6 @@ void CDStarControl::writeNetworkDataRF(const unsigned char* data, unsigned int e m_network->writeData(data + 1U, DSTAR_FRAME_LENGTH_BYTES, errors, end, m_netState != RS_NET_IDLE); } -bool CDStarControl::openFile() -{ - if (m_fp != NULL) - return true; - - time_t t; - ::time(&t); - - struct tm* tm = ::localtime(&t); - - char name[100U]; - ::sprintf(name, "DStar_%04d%02d%02d_%02d%02d%02d.ambe", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); - - m_fp = ::fopen(name, "wb"); - if (m_fp == NULL) - return false; - - ::fwrite("DSTAR", 1U, 4U, m_fp); - - return true; -} - -bool CDStarControl::writeFile(const unsigned char* data, unsigned int length) -{ - if (m_fp == NULL) - return false; - - ::fwrite(data, 1U, length, m_fp); - - return true; -} - -void CDStarControl::closeFile() -{ - if (m_fp != NULL) { - ::fclose(m_fp); - m_fp = NULL; - } -} - bool CDStarControl::insertSilence(const unsigned char* data, unsigned char seqNo) { assert(data != NULL); @@ -1559,3 +1498,5 @@ std::string CDStarControl::convertBuffer(const unsigned char* buffer, unsigned i return callsign; } +#endif + diff --git a/DStarControl.h b/DStarControl.h index 95655e5..114b7ed 100644 --- a/DStarControl.h +++ b/DStarControl.h @@ -31,6 +31,8 @@ #include "Timer.h" #include "Modem.h" +#if defined(USE_DSTAR) + #include #include @@ -152,10 +154,6 @@ private: std::string convertBuffer(const unsigned char* buffer, unsigned int length) const; - bool openFile(); - bool writeFile(const unsigned char* data, unsigned int length); - void closeFile(); - bool insertSilence(const unsigned char* data, unsigned char seqNo); void insertSilence(unsigned int count); @@ -166,3 +164,6 @@ private: }; #endif + +#endif + diff --git a/DStarHeader.cpp b/DStarHeader.cpp index e06ed1a..b882501 100644 --- a/DStarHeader.cpp +++ b/DStarHeader.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) 2016 by Jonathan Naylor G4KLX +* Copyright (C) 2016,2023 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 @@ -20,6 +20,8 @@ #include "DStarHeader.h" #include "CRC.h" +#if defined(USE_DSTAR) + #include #include #include @@ -163,3 +165,6 @@ void CDStarHeader::get(unsigned char* header) const CCRC::addCCITT161(header, DSTAR_HEADER_LENGTH_BYTES); } + +#endif + diff --git a/DStarHeader.h b/DStarHeader.h index 867f1da..2f85079 100644 --- a/DStarHeader.h +++ b/DStarHeader.h @@ -1,5 +1,5 @@ /* -* Copyright (C) 2016 by Jonathan Naylor G4KLX +* Copyright (C) 2016,2023 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,10 @@ #ifndef DStarHeader_H #define DStarHeader_H +#include "Defines.h" + +#if defined(USE_DSTAR) + class CDStarHeader { public: CDStarHeader(const unsigned char* header); @@ -56,3 +60,6 @@ private: }; #endif + +#endif + diff --git a/DStarNetwork.cpp b/DStarNetwork.cpp index dbb6a2c..27ccc01 100644 --- a/DStarNetwork.cpp +++ b/DStarNetwork.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014,2016,2019,2020,2021 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2014,2016,2019,2020,2021,2023 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 @@ -23,6 +23,8 @@ #include "Utils.h" #include "Log.h" +#if defined(USE_DSTAR) + #include #include #include @@ -345,3 +347,6 @@ void CDStarNetwork::getStatus(LINK_STATUS& status, unsigned char* reflector) ::memcpy(reflector, m_linkReflector, DSTAR_LONG_CALLSIGN_LENGTH); } + +#endif + diff --git a/DStarNetwork.h b/DStarNetwork.h index d7a1cc4..72d4cc0 100644 --- a/DStarNetwork.h +++ b/DStarNetwork.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014,2016,2020,2021 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2014,2016,2020,2021,2023 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 @@ -22,8 +22,11 @@ #include "DStarDefines.h" #include "RingBuffer.h" #include "UDPSocket.h" +#include "Defines.h" #include "Timer.h" +#if defined(USE_DSTAR) + #include #include #include @@ -73,3 +76,6 @@ private: }; #endif + +#endif + diff --git a/DStarSlowData.cpp b/DStarSlowData.cpp index 5f11b70..17e297d 100644 --- a/DStarSlowData.cpp +++ b/DStarSlowData.cpp @@ -22,6 +22,8 @@ #include "CRC.h" #include "Log.h" +#if defined(USE_DSTAR) + #include #include #include @@ -233,3 +235,6 @@ void CDStarSlowData::getSlowData(unsigned char* data) data[2U] = 'f' ^ DSTAR_SCRAMBLER_BYTES[2U]; } } + +#endif + diff --git a/DStarSlowData.h b/DStarSlowData.h index eaedf45..3e7dd58 100644 --- a/DStarSlowData.h +++ b/DStarSlowData.h @@ -20,6 +20,9 @@ #define DStarSlowData_H #include "DStarHeader.h" +#include "Defines.h" + +#if defined(USE_DSTAR) class CDStarSlowData { public: @@ -53,3 +56,6 @@ private: }; #endif + +#endif + diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 3277326..adfb595 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -146,7 +146,9 @@ int main(int argc, char** argv) CMMDVMHost::CMMDVMHost(const std::string& confFile) : m_conf(confFile), m_modem(NULL), +#if defined(USE_DSTAR) m_dstar(NULL), +#endif m_dmr(NULL), m_ysf(NULL), m_p25(NULL), @@ -161,7 +163,9 @@ m_fm(NULL), #if defined(USE_AX25) m_ax25(NULL), #endif +#if defined(USE_DSTAR) m_dstarNetwork(NULL), +#endif m_dmrNetwork(NULL), m_ysfNetwork(NULL), m_p25Network(NULL), @@ -177,7 +181,9 @@ m_fmNetwork(NULL), m_ax25Network(NULL), #endif m_mode(MODE_IDLE), +#if defined(USE_DSTAR) m_dstarRFModeHang(10U), +#endif m_dmrRFModeHang(10U), m_ysfRFModeHang(10U), m_p25RFModeHang(10U), @@ -186,7 +192,9 @@ m_m17RFModeHang(10U), #if defined(USE_FM) m_fmRFModeHang(10U), #endif +#if defined(USE_DSTAR) m_dstarNetModeHang(3U), +#endif m_dmrNetModeHang(3U), m_ysfNetModeHang(3U), m_p25NetModeHang(3U), @@ -334,10 +342,12 @@ int CMMDVMHost::run() if (!ret) return 1; +#if defined(USE_DSTAR) if (m_dstarEnabled && !m_modem->hasDStar()) { LogWarning("D-Star enabled in the host but not in the modem firmware, disabling"); m_dstarEnabled = false; } +#endif if (m_dmrEnabled && !m_modem->hasDMR()) { LogWarning("DMR enabled in the host but not in the modem firmware, disabling"); @@ -388,11 +398,13 @@ int CMMDVMHost::run() LogInfo("Opening network connections"); writeJSONMessage("Opening network connections"); +#if defined(USE_DSTAR) if (m_dstarEnabled && m_conf.getDStarNetworkEnabled()) { ret = createDStarNetwork(); if (!ret) return 1; } +#endif if (m_dmrEnabled && m_conf.getDMRNetworkEnabled()) { ret = createDMRNetwork(); @@ -535,6 +547,7 @@ int CMMDVMHost::run() CStopWatch stopWatch; stopWatch.start(); +#if defined(USE_DSTAR) if (m_dstarEnabled) { std::string module = m_conf.getDStarModule(); bool selfOnly = m_conf.getDStarSelfOnly(); @@ -564,6 +577,7 @@ int CMMDVMHost::run() m_dstar = new CDStarControl(m_callsign, module, selfOnly, ackReply, ackTime, ackMessage, errorReply, blackList, whiteList, m_dstarNetwork, m_timeout, m_duplex, remoteGateway, rssi); } +#endif DMR_BEACONS dmrBeacons = DMR_BEACONS_OFF; CTimer dmrBeaconIntervalTimer(1000U); @@ -822,6 +836,7 @@ int CMMDVMHost::run() unsigned int len; bool ret; +#if defined(USE_DSTAR) len = m_modem->readDStarData(data); if (m_dstar != NULL && len > 0U) { if (m_mode == MODE_IDLE) { @@ -838,6 +853,7 @@ int CMMDVMHost::run() LogWarning("D-Star modem data received when in mode %u", m_mode); } } +#endif len = m_modem->readDMRData1(data); if (m_dmr != NULL && len > 0U) { @@ -1020,6 +1036,7 @@ int CMMDVMHost::run() setMode(MODE_IDLE); } +#if defined(USE_DSTAR) if (m_dstar != NULL) { ret = m_modem->hasDStarSpace(); if (ret) { @@ -1038,6 +1055,7 @@ int CMMDVMHost::run() } } } +#endif if (m_dmr != NULL) { ret = m_modem->hasDMRSpace1(); @@ -1249,9 +1267,11 @@ int CMMDVMHost::run() m_reload = false; } - + +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->clock(); +#endif if (m_dmr != NULL) m_dmr->clock(); if (m_ysf != NULL) @@ -1271,8 +1291,10 @@ int CMMDVMHost::run() m_fm->clock(ms); #endif +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->clock(ms); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->clock(ms); if (m_ysfNetwork != NULL) @@ -1372,10 +1394,12 @@ int CMMDVMHost::run() LogInfo("Closing network connections"); writeJSONMessage("Closing network connections"); +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) { m_dstarNetwork->close(); delete m_dstarNetwork; } +#endif if (m_dmrNetwork != NULL) { m_dmrNetwork->close(true); @@ -1433,7 +1457,9 @@ int CMMDVMHost::run() LogInfo("Stopping protocol handlers"); writeJSONMessage("Stopping protocol handlers"); +#if defined(USE_DSTAR) delete m_dstar; +#endif delete m_dmr; delete m_ysf; delete m_p25; @@ -1481,7 +1507,11 @@ bool CMMDVMHost::createModem() unsigned int dmrDelay = m_conf.getModemDMRDelay(); float rxLevel = m_conf.getModemRXLevel(); float cwIdTXLevel = m_conf.getModemCWIdTXLevel(); +#if defined(USE_DSTAR) float dstarTXLevel = m_conf.getModemDStarTXLevel(); +#else + float dstarTXLevel = 0.0F; +#endif float dmrTXLevel = m_conf.getModemDMRTXLevel(); float ysfTXLevel = m_conf.getModemYSFTXLevel(); float p25TXLevel = m_conf.getModemP25TXLevel(); @@ -1561,7 +1591,9 @@ bool CMMDVMHost::createModem() LogInfo(" DMR Delay: %u (%.1fms)", dmrDelay, float(dmrDelay) * 0.0416666F); LogInfo(" RX Level: %.1f%%", rxLevel); LogInfo(" CW Id TX Level: %.1f%%", cwIdTXLevel); +#if defined(USE_DSTAR) LogInfo(" D-Star TX Level: %.1f%%", dstarTXLevel); +#endif LogInfo(" DMR TX Level: %.1f%%", dmrTXLevel); LogInfo(" YSF TX Level: %.1f%%", ysfTXLevel); LogInfo(" P25 TX Level: %.1f%%", p25TXLevel); @@ -1709,6 +1741,7 @@ bool CMMDVMHost::createModem() return true; } +#if defined(USE_DSTAR) bool CMMDVMHost::createDStarNetwork() { std::string gatewayAddress = m_conf.getDStarGatewayAddress(); @@ -1738,6 +1771,7 @@ bool CMMDVMHost::createDStarNetwork() return true; } +#endif bool CMMDVMHost::createDMRNetwork() { @@ -2017,7 +2051,9 @@ bool CMMDVMHost::createAX25Network() void CMMDVMHost::readParams() { +#if defined(USE_DSTAR) m_dstarEnabled = m_conf.getDStarEnabled(); +#endif m_dmrEnabled = m_conf.getDMREnabled(); m_ysfEnabled = m_conf.getFusionEnabled(); m_p25Enabled = m_conf.getP25Enabled(); @@ -2042,7 +2078,9 @@ void CMMDVMHost::readParams() LogInfo(" Id: %u", m_id); LogInfo(" Duplex: %s", m_duplex ? "yes" : "no"); LogInfo(" Timeout: %us", m_timeout); +#if defined(USE_DSTAR) LogInfo(" D-Star: %s", m_dstarEnabled ? "enabled" : "disabled"); +#endif LogInfo(" DMR: %s", m_dmrEnabled ? "enabled" : "disabled"); LogInfo(" YSF: %s", m_ysfEnabled ? "enabled" : "disabled"); LogInfo(" P25: %s", m_p25Enabled ? "enabled" : "disabled"); @@ -2065,8 +2103,10 @@ void CMMDVMHost::setMode(unsigned char mode) switch (mode) { case MODE_DSTAR: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(true); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2089,8 +2129,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(true); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2122,8 +2164,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_DMR: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(true); if (m_ysfNetwork != NULL) @@ -2146,8 +2190,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(true); if (m_ysf != NULL) @@ -2183,8 +2229,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_YSF: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2207,8 +2255,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2240,8 +2290,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_P25: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2264,8 +2316,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2297,8 +2351,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_NXDN: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2321,8 +2377,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2354,8 +2412,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_M17: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2378,8 +2438,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2411,8 +2473,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_POCSAG: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2435,8 +2499,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2468,8 +2534,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_FM: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2492,8 +2560,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(true); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2529,8 +2599,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; case MODE_LOCKOUT: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2553,8 +2625,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2591,8 +2665,10 @@ void CMMDVMHost::setMode(unsigned char mode) case MODE_ERROR: LogMessage("Mode set to Error"); +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(false); if (m_ysfNetwork != NULL) @@ -2615,8 +2691,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(false); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(false); +#endif if (m_dmr != NULL) m_dmr->enable(false); if (m_ysf != NULL) @@ -2651,8 +2729,10 @@ void CMMDVMHost::setMode(unsigned char mode) break; default: +#if defined(USE_DSTAR) if (m_dstarNetwork != NULL) m_dstarNetwork->enable(true); +#endif if (m_dmrNetwork != NULL) m_dmrNetwork->enable(true); if (m_ysfNetwork != NULL) @@ -2675,8 +2755,10 @@ void CMMDVMHost::setMode(unsigned char mode) if (m_ax25Network != NULL) m_ax25Network->enable(true); #endif +#if defined(USE_DSTAR) if (m_dstar != NULL) m_dstar->enable(true); +#endif if (m_dmr != NULL) m_dmr->enable(true); if (m_ysf != NULL) @@ -2752,10 +2834,12 @@ void CMMDVMHost::remoteControl(const std::string& commandString) m_fixedMode = false; setMode(MODE_LOCKOUT); break; +#if defined(USE_DSTAR) case RCD_MODE_DSTAR: if (m_dstar != NULL) processModeCommand(MODE_DSTAR, m_dstarRFModeHang); break; +#endif case RCD_MODE_DMR: if (m_dmr != NULL) processModeCommand(MODE_DMR, m_dmrRFModeHang); @@ -2782,12 +2866,14 @@ void CMMDVMHost::remoteControl(const std::string& commandString) processModeCommand(MODE_FM, 0); break; #endif +#if defined(USE_DSTAR) case RCD_ENABLE_DSTAR: if (m_dstar != NULL && !m_dstarEnabled) processEnableCommand(m_dstarEnabled, true); if (m_dstarNetwork != NULL) m_dstarNetwork->enable(true); break; +#endif case RCD_ENABLE_DMR: if (m_dmr != NULL && !m_dmrEnabled) processEnableCommand(m_dmrEnabled, true); @@ -2830,12 +2916,14 @@ void CMMDVMHost::remoteControl(const std::string& commandString) processEnableCommand(m_ax25Enabled, true); break; #endif +#if defined(USE_DSTAR) case RCD_DISABLE_DSTAR: if (m_dstar != NULL && m_dstarEnabled) processEnableCommand(m_dstarEnabled, false); if (m_dstarNetwork != NULL) m_dstarNetwork->enable(false); break; +#endif case RCD_DISABLE_DMR: if (m_dmr != NULL && m_dmrEnabled) processEnableCommand(m_dmrEnabled, false); @@ -2974,12 +3062,15 @@ void CMMDVMHost::processEnableCommand(bool& mode, bool enabled) void CMMDVMHost::buildNetworkStatusString(std::string &str) { str = ""; - str += std::string("dstar:") + (((m_dstarNetwork == NULL) || (m_dstarEnabled == false)) ? "n/a" : (m_dstarNetwork->isConnected() ? "conn" : "disc")); - str += std::string(" dmr:") + (((m_dmrNetwork == NULL) || (m_dmrEnabled == false)) ? "n/a" : (m_dmrNetwork->isConnected() ? "conn" : "disc")); - str += std::string(" ysf:") + (((m_ysfNetwork == NULL) || (m_ysfEnabled == false)) ? "n/a" : (m_ysfNetwork->isConnected() ? "conn" : "disc")); - str += std::string(" p25:") + (((m_p25Network == NULL) || (m_p25Enabled == false)) ? "n/a" : (m_p25Network->isConnected() ? "conn" : "disc")); - str += std::string(" nxdn:") + (((m_nxdnNetwork == NULL) || (m_nxdnEnabled == false)) ? "n/a" : (m_nxdnNetwork->isConnected() ? "conn" : "disc")); - str += std::string(" m17:") + (((m_m17Network == NULL) || (m_m17Enabled == false)) ? "n/a" : (m_m17Network->isConnected() ? "conn" : "disc")); + +#if defined(USE_DSTAR) + str += std::string("dstar:") + (((m_dstarNetwork == NULL) || !m_dstarEnabled) ? "n/a" : (m_dstarNetwork->isConnected() ? "conn" : "disc")); +#endif + str += std::string(" dmr:") + (((m_dmrNetwork == NULL) || !m_dmrEnabled) ? "n/a" : (m_dmrNetwork->isConnected() ? "conn" : "disc")); + str += std::string(" ysf:") + (((m_ysfNetwork == NULL) || !m_ysfEnabled) ? "n/a" : (m_ysfNetwork->isConnected() ? "conn" : "disc")); + str += std::string(" p25:") + (((m_p25Network == NULL) || !m_p25Enabled) ? "n/a" : (m_p25Network->isConnected() ? "conn" : "disc")); + str += std::string(" nxdn:") + (((m_nxdnNetwork == NULL) || !m_nxdnEnabled) ? "n/a" : (m_nxdnNetwork->isConnected() ? "conn" : "disc")); + str += std::string(" m17:") + (((m_m17Network == NULL) || !m_m17Enabled) ? "n/a" : (m_m17Network->isConnected() ? "conn" : "disc")); #if defined(USE_FM) str += std::string(" fm:") + (m_fmEnabled ? "conn" : "n/a"); #endif @@ -2989,6 +3080,7 @@ void CMMDVMHost::buildNetworkHostsString(std::string &str) { str = ""; +#if defined(USE_DSTAR) std::string dstarReflector; if (m_dstarEnabled && (m_dstarNetwork != NULL)) { unsigned char ref[DSTAR_LONG_CALLSIGN_LENGTH + 1]; @@ -3010,7 +3102,9 @@ void CMMDVMHost::buildNetworkHostsString(std::string &str) break; } } + str += std::string("dstar:\"") + ((dstarReflector.length() == 0) ? "NONE" : dstarReflector) + "\""; +#endif str += std::string(" dmr:\"") + ((m_dmrEnabled && (m_dmrNetwork != NULL)) ? m_conf.getDMRNetworkGatewayAddress() : "NONE") + "\""; str += std::string(" ysf:\"") + ((m_ysfEnabled && (m_ysfNetwork != NULL)) ? m_conf.getFusionNetworkGatewayAddress() : "NONE") + "\""; str += std::string(" p25:\"") + ((m_p25Enabled && (m_p25Network != NULL)) ? m_conf.getP25GatewayAddress() : "NONE") + "\""; diff --git a/MMDVMHost.h b/MMDVMHost.h index b453282..f699a21 100644 --- a/MMDVMHost.h +++ b/MMDVMHost.h @@ -61,7 +61,9 @@ public: private: CConf m_conf; CModem* m_modem; +#if defined(USE_DSTAR) CDStarControl* m_dstar; +#endif CDMRControl* m_dmr; CYSFControl* m_ysf; CP25Control* m_p25; @@ -76,7 +78,9 @@ private: #if defined(USE_AX25) CAX25Control* m_ax25; #endif +#if defined(USE_DSTAR) CDStarNetwork* m_dstarNetwork; +#endif CDMRNetwork* m_dmrNetwork; CYSFNetwork* m_ysfNetwork; CP25Network* m_p25Network; @@ -92,7 +96,9 @@ private: CAX25Network* m_ax25Network; #endif unsigned char m_mode; +#if defined(USE_DSTAR) unsigned int m_dstarRFModeHang; +#endif unsigned int m_dmrRFModeHang; unsigned int m_ysfRFModeHang; unsigned int m_p25RFModeHang; @@ -101,7 +107,9 @@ private: #if defined(USE_FM) unsigned int m_fmRFModeHang; #endif +#if defined(USE_DSTAR) unsigned int m_dstarNetModeHang; +#endif unsigned int m_dmrNetModeHang; unsigned int m_ysfNetModeHang; unsigned int m_p25NetModeHang; @@ -140,7 +148,9 @@ private: void readParams(); bool createModem(); +#if defined(USE_DSTAR) bool createDStarNetwork(); +#endif bool createDMRNetwork(); bool createYSFNetwork(); bool createP25Network(); diff --git a/Modem.cpp b/Modem.cpp index 9302202..eb4d684 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -51,10 +51,12 @@ const unsigned char MMDVM_SET_FREQ = 0x04U; const unsigned char MMDVM_SEND_CWID = 0x0AU; +#if defined(USE_DSTAR) const unsigned char MMDVM_DSTAR_HEADER = 0x10U; const unsigned char MMDVM_DSTAR_DATA = 0x11U; const unsigned char MMDVM_DSTAR_LOST = 0x12U; const unsigned char MMDVM_DSTAR_EOT = 0x13U; +#endif const unsigned char MMDVM_DMR_DATA1 = 0x18U; const unsigned char MMDVM_DMR_LOST1 = 0x19U; @@ -117,7 +119,9 @@ const unsigned int MAX_RESPONSES = 30U; const unsigned int BUFFER_LENGTH = 2000U; +#if defined(USE_DSTAR) const unsigned char CAP1_DSTAR = 0x01U; +#endif const unsigned char CAP1_DMR = 0x02U; const unsigned char CAP1_YSF = 0x04U; const unsigned char CAP1_P25 = 0x08U; @@ -149,7 +153,9 @@ m_txDelay(txDelay), m_dmrDelay(dmrDelay), m_rxLevel(0.0F), m_cwIdTXLevel(0.0F), +#if defined(USE_DSTAR) m_dstarTXLevel(0.0F), +#endif m_dmrTXLevel(0.0F), m_ysfTXLevel(0.0F), m_p25TXLevel(0.0F), @@ -173,7 +179,9 @@ m_txFrequency(0U), #if defined(USE_POCSAG) m_pocsagFrequency(0U), #endif +#if defined(USE_DSTAR) m_dstarEnabled(false), +#endif m_dmrEnabled(false), m_ysfEnabled(false), m_p25Enabled(false), @@ -196,8 +204,10 @@ m_length(0U), m_offset(0U), m_state(SS_START), m_type(0U), +#if defined(USE_DSTAR) m_rxDStarData(1000U, "Modem RX D-Star"), m_txDStarData(1000U, "Modem TX D-Star"), +#endif m_rxDMRData1(1000U, "Modem RX DMR1"), m_rxDMRData2(1000U, "Modem RX DMR2"), m_txDMRData1(1000U, "Modem TX DMR1"), @@ -229,7 +239,9 @@ m_sendTransparentDataFrameType(0U), m_statusTimer(1000U, 0U, 250U), m_inactivityTimer(1000U, 2U), m_playoutTimer(1000U, 0U, 10U), +#if defined(USE_DSTAR) m_dstarSpace(0U), +#endif m_dmrSpace1(0U), m_dmrSpace2(0U), m_ysfSpace(0U), @@ -327,7 +339,9 @@ void CModem::setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int tx void CModem::setModeParams(bool dstarEnabled, bool dmrEnabled, bool ysfEnabled, bool p25Enabled, bool nxdnEnabled, bool m17Enabled, bool pocsagEnabled, bool fmEnabled, bool ax25Enabled) { +#if defined(USE_DSTAR) m_dstarEnabled = dstarEnabled; +#endif m_dmrEnabled = dmrEnabled; m_ysfEnabled = ysfEnabled; m_p25Enabled = p25Enabled; @@ -348,7 +362,9 @@ void CModem::setLevels(float rxLevel, float cwIdTXLevel, float dstarTXLevel, flo { m_rxLevel = rxLevel; m_cwIdTXLevel = cwIdTXLevel; +#if defined(USE_DSTAR) m_dstarTXLevel = dstarTXLevel; +#endif m_dmrTXLevel = dmrTXLevel; m_ysfTXLevel = ysfTXLevel; m_p25TXLevel = p25TXLevel; @@ -521,6 +537,7 @@ void CModem::clock(unsigned int ms) } else { // type == RTM_OK switch (m_type) { +#if defined(USE_DSTAR) case MMDVM_DSTAR_HEADER: { if (m_trace) CUtils::dump(1U, "RX D-Star Header", m_buffer, m_length); @@ -572,6 +589,7 @@ void CModem::clock(unsigned int ms) m_rxDStarData.addData(&data, 1U); } break; +#endif case MMDVM_DMR_DATA1: { if (m_trace) @@ -867,8 +885,9 @@ void CModem::clock(unsigned int ms) #if defined(USE_AX25) m_ax25Space = 0U; #endif - +#if defined(USE_DSTAR) m_dstarSpace = m_buffer[m_offset + 3U]; +#endif m_dmrSpace1 = m_buffer[m_offset + 4U]; m_dmrSpace2 = m_buffer[m_offset + 5U]; m_ysfSpace = m_buffer[m_offset + 6U]; @@ -906,7 +925,9 @@ void CModem::clock(unsigned int ms) LogError("MMDVM DAC levels have overflowed"); m_cd = (m_buffer[m_offset + 1U] & 0x40U) == 0x40U; +#if defined(USE_DSTAR) m_dstarSpace = m_buffer[m_offset + 3U]; +#endif m_dmrSpace1 = m_buffer[m_offset + 4U]; m_dmrSpace2 = m_buffer[m_offset + 5U]; m_ysfSpace = m_buffer[m_offset + 6U]; @@ -926,7 +947,9 @@ void CModem::clock(unsigned int ms) break; default: +#if defined(USE_DSTAR) m_dstarSpace = 0U; +#endif m_dmrSpace1 = 0U; m_dmrSpace2 = 0U; m_ysfSpace = 0U; @@ -1003,6 +1026,7 @@ void CModem::clock(unsigned int ms) if (!m_playoutTimer.hasExpired()) return; +#if defined(USE_DSTAR) if (m_dstarSpace > 1U && !m_txDStarData.isEmpty()) { unsigned char buffer[4U]; m_txDStarData.peek(buffer, 4U); @@ -1039,6 +1063,7 @@ void CModem::clock(unsigned int ms) m_playoutTimer.start(); } } +#endif if (m_dmrSpace1 > 1U && !m_txDMRData1.isEmpty()) { unsigned char len = 0U; @@ -1254,6 +1279,7 @@ void CModem::close() m_port->close(); } +#if defined(USE_DSTAR) unsigned int CModem::readDStarData(unsigned char* data) { assert(data != NULL); @@ -1267,6 +1293,7 @@ unsigned int CModem::readDStarData(unsigned char* data) return len; } +#endif unsigned int CModem::readDMRData1(unsigned char* data) { @@ -1412,6 +1439,7 @@ unsigned int CModem::readSerialData(unsigned char* data) return len; } +#if defined(USE_DSTAR) bool CModem::hasDStarSpace() const { unsigned int space = m_txDStarData.freeSpace() / (DSTAR_FRAME_LENGTH_BYTES + 4U); @@ -1452,6 +1480,7 @@ bool CModem::writeDStarData(const unsigned char* data, unsigned int length) return true; } +#endif bool CModem::hasDMRSpace1() const { @@ -1781,6 +1810,7 @@ bool CModem::writeTransparentData(const unsigned char* data, unsigned int length return true; } +#if defined(USE_DSTAR) bool CModem::writeDStarInfo(const char* my1, const char* my2, const char* your, const char* type, const char* reflector) { assert(m_port != NULL); @@ -1809,6 +1839,7 @@ bool CModem::writeDStarInfo(const char* my1, const char* my2, const char* your, return m_port->write(buffer, 33U) != 33; } +#endif bool CModem::writeDMRInfo(unsigned int slotNo, const std::string& src, bool group, const std::string& dest, const char* type) { @@ -2025,10 +2056,12 @@ bool CModem::hasError() const return m_error; } +#if defined(USE_DSTAR) bool CModem::hasDStar() const { return (m_capabilities1 & CAP1_DSTAR) == CAP1_DSTAR; } +#endif bool CModem::hasDMR() const { @@ -2138,11 +2171,14 @@ bool CModem::readVersion() switch (m_protocolVersion) { case 1U: LogInfo("MMDVM protocol version: 1, description: %.*s", m_length - 4U, m_buffer + 4U); - m_capabilities1 = CAP1_DSTAR | CAP1_DMR | CAP1_YSF | CAP1_P25 | CAP1_NXDN | CAP1_M17; -#if defined(USE_POCSAG) - m_capabilities2 = CAP2_POCSAG; -#else + m_capabilities1 = 0x00U; m_capabilities2 = 0x00U; +#if defined(USE_DSTAR) + m_capabilities1 |= CAP1_DSTAR; +#endif + m_capabilities1 |= CAP1_DMR | CAP1_YSF | CAP1_P25 | CAP1_NXDN | CAP1_M17; +#if defined(USE_POCSAG) + m_capabilities2 |= CAP2_POCSAG; #endif return true; @@ -2166,8 +2202,10 @@ bool CModem::readVersion() m_capabilities2 = m_buffer[5U]; char modeText[100U]; ::strcpy(modeText, "Modes:"); +#if defined(USE_DSTAR) if (hasDStar()) ::strcat(modeText, " D-Star"); +#endif if (hasDMR()) ::strcat(modeText, " DMR"); if (hasYSF()) @@ -2266,8 +2304,10 @@ bool CModem::setConfig1() buffer[3U] |= 0x80U; buffer[4U] = 0x00U; +#if defined(USE_DSTAR) if (m_dstarEnabled) buffer[4U] |= 0x01U; +#endif if (m_dmrEnabled) buffer[4U] |= 0x02U; if (m_ysfEnabled) @@ -2297,7 +2337,11 @@ bool CModem::setConfig1() buffer[11U] = 128U; // Was OscOffset +#if defined(USE_DSTAR) buffer[12U] = (unsigned char)(m_dstarTXLevel * 2.55F + 0.5F); +#else + buffer[12U] = 0U; +#endif buffer[13U] = (unsigned char)(m_dmrTXLevel * 2.55F + 0.5F); buffer[14U] = (unsigned char)(m_ysfTXLevel * 2.55F + 0.5F); buffer[15U] = (unsigned char)(m_p25TXLevel * 2.55F + 0.5F); @@ -2388,8 +2432,10 @@ bool CModem::setConfig2() buffer[3U] |= 0x80U; buffer[4U] = 0x00U; +#if defined(USE_DSTAR) if (m_dstarEnabled) buffer[4U] |= 0x01U; +#endif if (m_dmrEnabled) buffer[4U] |= 0x02U; if (m_ysfEnabled) @@ -2424,7 +2470,11 @@ bool CModem::setConfig2() buffer[10U] = (unsigned char)(m_rxLevel * 2.55F + 0.5F); buffer[11U] = (unsigned char)(m_cwIdTXLevel * 2.55F + 0.5F); +#if defined(USE_DSTAR) buffer[12U] = (unsigned char)(m_dstarTXLevel * 2.55F + 0.5F); +#else + buffer[12U] = 0U; +#endif buffer[13U] = (unsigned char)(m_dmrTXLevel * 2.55F + 0.5F); buffer[14U] = (unsigned char)(m_ysfTXLevel * 2.55F + 0.5F); buffer[15U] = (unsigned char)(m_p25TXLevel * 2.55F + 0.5F); diff --git a/Modem.h b/Modem.h index 3abfb09..1645303 100644 --- a/Modem.h +++ b/Modem.h @@ -68,7 +68,9 @@ public: bool open(); +#if defined(USE_DSTAR) bool hasDStar() const; +#endif bool hasDMR() const; bool hasYSF() const; bool hasP25() const; @@ -85,7 +87,9 @@ public: #endif unsigned int getVersion() const; +#if defined(USE_DSTAR) unsigned int readDStarData(unsigned char* data); +#endif unsigned int readDMRData1(unsigned char* data); unsigned int readDMRData2(unsigned char* data); unsigned int readYSFData(unsigned char* data); @@ -99,7 +103,9 @@ public: unsigned int readAX25Data(unsigned char* data); #endif +#if defined(USE_DSTAR) bool hasDStarSpace() const; +#endif bool hasDMRSpace1() const; bool hasDMRSpace2() const; bool hasYSFSpace() const; @@ -123,7 +129,10 @@ public: bool hasError() const; bool writeConfig(); + +#if defined(USE_DSTAR) bool writeDStarData(const unsigned char* data, unsigned int length); +#endif bool writeDMRData1(const unsigned char* data, unsigned int length); bool writeDMRData2(const unsigned char* data, unsigned int length); bool writeYSFData(const unsigned char* data, unsigned int length); @@ -140,7 +149,9 @@ public: bool writeAX25Data(const unsigned char* data, unsigned int length); #endif +#if defined(USE_DSTAR) bool writeDStarInfo(const char* my1, const char* my2, const char* your, const char* type, const char* reflector); +#endif bool writeDMRInfo(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type); bool writeYSFInfo(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin); bool writeP25Info(const char* source, bool group, unsigned int dest, const char* type); @@ -188,7 +199,9 @@ private: unsigned int m_dmrDelay; float m_rxLevel; float m_cwIdTXLevel; +#if defined(USE_DSTAR) float m_dstarTXLevel; +#endif float m_dmrTXLevel; float m_ysfTXLevel; float m_p25TXLevel; @@ -212,7 +225,9 @@ private: #if defined(USE_POCSAG) unsigned int m_pocsagFrequency; #endif +#if defined(USE_DSTAR) bool m_dstarEnabled; +#endif bool m_dmrEnabled; bool m_ysfEnabled; bool m_p25Enabled; @@ -235,8 +250,11 @@ private: unsigned int m_offset; SERIAL_STATE m_state; unsigned char m_type; + +#if defined(USE_DSTAR) CRingBuffer m_rxDStarData; CRingBuffer m_txDStarData; +#endif CRingBuffer m_rxDMRData1; CRingBuffer m_rxDMRData2; CRingBuffer m_txDMRData1; @@ -268,7 +286,9 @@ private: CTimer m_statusTimer; CTimer m_inactivityTimer; CTimer m_playoutTimer; +#if defined(USE_DSTAR) unsigned int m_dstarSpace; +#endif unsigned int m_dmrSpace1; unsigned int m_dmrSpace2; unsigned int m_ysfSpace; diff --git a/RemoteControl.cpp b/RemoteControl.cpp index a7da964..76e8bf4 100644 --- a/RemoteControl.cpp +++ b/RemoteControl.cpp @@ -65,8 +65,10 @@ REMOTE_COMMAND CRemoteControl::getCommand(const std::string& command) m_command = RCD_MODE_IDLE; else if (m_args.at(1U) == "lockout") m_command = RCD_MODE_LOCKOUT; +#if defined(USE_DSTAR) else if (m_args.at(1U) == "d-star") m_command = RCD_MODE_DSTAR; +#endif else if (m_args.at(1U) == "dmr") m_command = RCD_MODE_DMR; else if (m_args.at(1U) == "ysf") @@ -80,50 +82,67 @@ REMOTE_COMMAND CRemoteControl::getCommand(const std::string& command) else reply = "KO"; } else if (m_args.at(0U) == "enable" && m_args.size() >= ENABLE_ARGS) { +#if defined(USE_DSTAR) if (m_args.at(1U) == "dstar") m_command = RCD_ENABLE_DSTAR; - else if (m_args.at(1U) == "dmr") + else +#endif + if (m_args.at(1U) == "dmr") m_command = RCD_ENABLE_DMR; - else if (m_args.at(1U) == "ysf") + else + if (m_args.at(1U) == "ysf") m_command = RCD_ENABLE_YSF; - else if (m_args.at(1U) == "p25") + else + if (m_args.at(1U) == "p25") m_command = RCD_ENABLE_P25; - else if (m_args.at(1U) == "nxdn") + else + if (m_args.at(1U) == "nxdn") m_command = RCD_ENABLE_NXDN; - else if (m_args.at(1U) == "m17") + else + if (m_args.at(1U) == "m17") m_command = RCD_ENABLE_M17; #if defined(USE_FM) - else if (m_args.at(1U) == "fm") + if (m_args.at(1U) == "fm") m_command = RCD_ENABLE_FM; + else #endif #if defined(USE_AX25) - else if (m_args.at(1U) == "ax25") + if (m_args.at(1U) == "ax25") m_command = RCD_ENABLE_AX25; -#endif else +#endif reply = "KO"; } else if (m_args.at(0U) == "disable" && m_args.size() >= DISABLE_ARGS) { +#if defined(USE_DSTAR) if (m_args.at(1U) == "dstar") m_command = RCD_DISABLE_DSTAR; - else if (m_args.at(1U) == "dmr") + else +#endif + if (m_args.at(1U) == "dmr") m_command = RCD_DISABLE_DMR; - else if (m_args.at(1U) == "ysf") + else + if (m_args.at(1U) == "ysf") m_command = RCD_DISABLE_YSF; - else if (m_args.at(1U) == "p25") + else + if (m_args.at(1U) == "p25") m_command = RCD_DISABLE_P25; - else if (m_args.at(1U) == "nxdn") + else + if (m_args.at(1U) == "nxdn") m_command = RCD_DISABLE_NXDN; - else if (m_args.at(1U) == "m17") + else + if (m_args.at(1U) == "m17") m_command = RCD_DISABLE_M17; + else #if defined(USE_FM) - else if (m_args.at(1U) == "fm") + if (m_args.at(1U) == "fm") m_command = RCD_DISABLE_FM; + else #endif #if defined(USE_AX25) - else if (m_args.at(1U) == "ax25") + if (m_args.at(1U) == "ax25") m_command = RCD_DISABLE_AX25; -#endif else +#endif reply = "KO"; #if defined(USE_POCSAG) } else if (m_args.at(0U) == "page" && m_args.size() >= PAGE_ARGS) { @@ -185,7 +204,9 @@ unsigned int CRemoteControl::getArgCount() const switch (m_command) { case RCD_MODE_IDLE: case RCD_MODE_LOCKOUT: +#if defined(USE_DSTAR) case RCD_MODE_DSTAR: +#endif case RCD_MODE_DMR: case RCD_MODE_YSF: case RCD_MODE_P25: @@ -211,7 +232,9 @@ std::string CRemoteControl::getArgString(unsigned int n) const switch (m_command) { case RCD_MODE_IDLE: case RCD_MODE_LOCKOUT: +#if defined(USE_DSTAR) case RCD_MODE_DSTAR: +#endif case RCD_MODE_DMR: case RCD_MODE_YSF: case RCD_MODE_P25: diff --git a/RemoteControl.h b/RemoteControl.h index 5daf064..0d36a73 100644 --- a/RemoteControl.h +++ b/RemoteControl.h @@ -32,7 +32,9 @@ enum REMOTE_COMMAND { RCD_NONE, RCD_MODE_IDLE, RCD_MODE_LOCKOUT, +#if defined(USE_DSTAR) RCD_MODE_DSTAR, +#endif RCD_MODE_DMR, RCD_MODE_YSF, RCD_MODE_P25, @@ -41,7 +43,9 @@ enum REMOTE_COMMAND { #if defined(USE_FM) RCD_MODE_FM, #endif +#if defined(USE_DSTAR) RCD_ENABLE_DSTAR, +#endif RCD_ENABLE_DMR, RCD_ENABLE_YSF, RCD_ENABLE_P25, @@ -53,7 +57,9 @@ enum REMOTE_COMMAND { #if defined(USE_AX25) RCD_ENABLE_AX25, #endif +#if defined(USE_DSTAR) RCD_DISABLE_DSTAR, +#endif RCD_DISABLE_DMR, RCD_DISABLE_YSF, RCD_DISABLE_P25,