From d51b7261cf250fa7967bc995f3a2186b72021ab9 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 7 Mar 2017 20:38:06 +0000 Subject: [PATCH] Remove the OscOffset parameter. --- Conf.cpp | 29 ++++++++++++----------------- Conf.h | 2 -- MMDVM.ini | 1 - MMDVMHost.cpp | 4 +--- Modem.cpp | 5 ++--- Modem.h | 3 +-- 6 files changed, 16 insertions(+), 28 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index 32297ca..c100fb6 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -90,7 +90,6 @@ m_modemDStarTXLevel(50U), m_modemDMRTXLevel(50U), m_modemYSFTXLevel(50U), m_modemP25TXLevel(50U), -m_modemOscOffset(0), m_modemRSSIMappingFile(), m_modemSamplesDir(), m_modemDebug(false), @@ -217,9 +216,9 @@ bool CConf::read() section = SECTION_P25; else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0) section = SECTION_DSTAR_NETWORK; - else if (::strncmp(buffer, "[DMR Network]", 13U) == 0) + else if (::strncmp(buffer, "[DMR Network]", 13U) == 0) section = SECTION_DMR_NETWORK; - else if (::strncmp(buffer, "[System Fusion Network]", 23U) == 0) + else if (::strncmp(buffer, "[System Fusion Network]", 23U) == 0) section = SECTION_FUSION_NETWORK; else if (::strncmp(buffer, "[P25 Network]", 13U) == 0) section = SECTION_P25_NETWORK; @@ -236,15 +235,18 @@ bool CConf::read() else section = SECTION_NONE; - continue; - } + continue; + } - char* key = ::strtok(buffer, " \t=\r\n"); - if (key == NULL) - continue; + char* key = ::strtok(buffer, " \t=\r\n"); + if (key == NULL) + continue; - char* value = ::strtok(NULL, "\r\n"); - if (section == SECTION_GENERAL) { + char* value = ::strtok(NULL, "\r\n"); + if (value == NULL) + value = ""; + + if (section == SECTION_GENERAL) { if (::strcmp(key, "Callsign") == 0) { // Convert the callsign to upper case for (unsigned int i = 0U; value[i] != 0; i++) @@ -329,8 +331,6 @@ bool CConf::read() m_modemYSFTXLevel = (unsigned int)::atoi(value); else if (::strcmp(key, "P25TXLevel") == 0) m_modemP25TXLevel = (unsigned int)::atoi(value); - else if (::strcmp(key, "OscOffset") == 0) - m_modemOscOffset = ::atoi(value); else if (::strcmp(key, "RSSIMappingFile") == 0) m_modemRSSIMappingFile = value; else if (::strcmp(key, "SamplesDir") == 0) @@ -742,11 +742,6 @@ unsigned int CConf::getModemP25TXLevel() const return m_modemP25TXLevel; } -int CConf::getModemOscOffset() const -{ - return m_modemOscOffset; -} - std::string CConf::getModemRSSIMappingFile () const { return m_modemRSSIMappingFile; diff --git a/Conf.h b/Conf.h index 1136a60..57401e2 100644 --- a/Conf.h +++ b/Conf.h @@ -77,7 +77,6 @@ public: unsigned int getModemDMRTXLevel() const; unsigned int getModemYSFTXLevel() const; unsigned int getModemP25TXLevel() const; - int getModemOscOffset() const; std::string getModemRSSIMappingFile() const; std::string getModemSamplesDir() const; bool getModemDebug() const; @@ -230,7 +229,6 @@ private: unsigned int m_modemDMRTXLevel; unsigned int m_modemYSFTXLevel; unsigned int m_modemP25TXLevel; - int m_modemOscOffset; std::string m_modemRSSIMappingFile; std::string m_modemSamplesDir; bool m_modemDebug; diff --git a/MMDVM.ini b/MMDVM.ini index 56f6396..d7a24fb 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -49,7 +49,6 @@ TXLevel=50 # DMRTXLevel=50 # YSFTXLevel=50 # P25TXLevel=50 -OscOffset=0 RSSIMappingFile=RSSI.dat SamplesDir=. Debug=0 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 4051ba4..cea5c9b 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -796,7 +796,6 @@ bool CMMDVMHost::createModem() unsigned int colorCode = m_conf.getDMRColorCode(); unsigned int rxFrequency = m_conf.getRxFrequency(); unsigned int txFrequency = m_conf.getTxFrequency(); - int oscOffset = m_conf.getModemOscOffset(); std::string samplesDir = m_conf.getModemSamplesDir(); LogInfo("Modem Parameters"); @@ -814,9 +813,8 @@ bool CMMDVMHost::createModem() LogInfo(" P25 TX Level: %u%%", p25TXLevel); LogInfo(" RX Frequency: %uHz", rxFrequency); LogInfo(" TX Frequency: %uHz", txFrequency); - LogInfo(" Osc. Offset: %dppm", oscOffset); - m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, oscOffset, samplesDir, debug); + m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, samplesDir, debug); m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled); m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel); m_modem->setRFParams(rxFrequency, txFrequency); diff --git a/Modem.cpp b/Modem.cpp index fffbb86..408b9c6 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -85,7 +85,7 @@ const unsigned int MAX_RESPONSES = 30U; 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, int oscOffset, const std::string& samplesDir, bool debug) : +CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, const std::string& samplesDir, bool debug) : m_port(port), m_colorCode(0U), m_duplex(duplex), @@ -100,7 +100,6 @@ m_dstarTXLevel(0U), m_dmrTXLevel(0U), m_ysfTXLevel(0U), m_p25TXLevel(0U), -m_oscOffset(oscOffset), m_samplesDir(samplesDir), m_debug(debug), m_rxFrequency(0U), @@ -980,7 +979,7 @@ bool CModem::setConfig() buffer[10U] = m_dmrDelay; - buffer[11U] = (unsigned char)(m_oscOffset + 128); + buffer[11U] = 0U; // Was OscOffset buffer[12U] = (m_dstarTXLevel * 255U) / 100U; buffer[13U] = (m_dmrTXLevel * 255U) / 100U; diff --git a/Modem.h b/Modem.h index 6c31992..1ab6b38 100644 --- a/Modem.h +++ b/Modem.h @@ -34,7 +34,7 @@ enum RESP_TYPE_MMDVM { class CModem { public: - CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, int oscOffset, const std::string& samplesDir, bool debug = false); + CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, const std::string& samplesDir, bool debug = false); ~CModem(); void setRFParams(unsigned int rxFrequency, unsigned int txFrequency); @@ -101,7 +101,6 @@ private: unsigned int m_dmrTXLevel; unsigned int m_ysfTXLevel; unsigned int m_p25TXLevel; - int m_oscOffset; std::string m_samplesDir; bool m_debug; unsigned int m_rxFrequency;