diff --git a/Conf.cpp b/Conf.cpp index 52cefd1..e39c5a3 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -91,7 +91,6 @@ m_modemDMRTXLevel(50U), m_modemYSFTXLevel(50U), m_modemP25TXLevel(50U), m_modemRSSIMappingFile(), -m_modemSamplesDir(), m_modemDebug(false), m_umpEnabled(false), m_umpPort(), @@ -335,8 +334,6 @@ bool CConf::read() m_modemP25TXLevel = (unsigned int)::atoi(value); else if (::strcmp(key, "RSSIMappingFile") == 0) m_modemRSSIMappingFile = value; - else if (::strcmp(key, "SamplesDir") == 0) - m_modemSamplesDir = value; else if (::strcmp(key, "Debug") == 0) m_modemDebug = ::atoi(value) == 1; } else if (section == SECTION_UMP) { @@ -753,11 +750,6 @@ std::string CConf::getModemRSSIMappingFile () const return m_modemRSSIMappingFile; } -std::string CConf::getModemSamplesDir() const -{ - return m_modemSamplesDir; -} - bool CConf::getModemDebug() const { return m_modemDebug; diff --git a/Conf.h b/Conf.h index 2598ed2..38ee173 100644 --- a/Conf.h +++ b/Conf.h @@ -78,7 +78,6 @@ public: unsigned int getModemYSFTXLevel() const; unsigned int getModemP25TXLevel() const; std::string getModemRSSIMappingFile() const; - std::string getModemSamplesDir() const; bool getModemDebug() const; // The UMP section @@ -232,7 +231,6 @@ private: unsigned int m_modemYSFTXLevel; unsigned int m_modemP25TXLevel; std::string m_modemRSSIMappingFile; - std::string m_modemSamplesDir; bool m_modemDebug; bool m_umpEnabled; diff --git a/MMDVM.ini b/MMDVM.ini index d1423b2..80e1525 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -50,7 +50,6 @@ TXLevel=50 # YSFTXLevel=50 # P25TXLevel=50 RSSIMappingFile=RSSI.dat -SamplesDir=. Debug=0 [UMP] diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 7357510..5ff96f6 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -807,7 +807,6 @@ bool CMMDVMHost::createModem() bool lowDeviation = m_conf.getFusionLowDeviation(); unsigned int rxFrequency = m_conf.getRxFrequency(); unsigned int txFrequency = m_conf.getTxFrequency(); - std::string samplesDir = m_conf.getModemSamplesDir(); LogInfo("Modem Parameters"); LogInfo(" Port: %s", port.c_str()); @@ -825,7 +824,7 @@ bool CMMDVMHost::createModem() LogInfo(" RX Frequency: %uHz", rxFrequency); LogInfo(" TX Frequency: %uHz", txFrequency); - m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, samplesDir, debug); + m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, dmrDelay, 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 db38322..a35418a 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -72,8 +72,6 @@ const unsigned char MMDVM_NAK = 0x7FU; const unsigned char MMDVM_SERIAL = 0x80U; -const unsigned char MMDVM_SAMPLES = 0xF0U; - const unsigned char MMDVM_DEBUG1 = 0xF1U; const unsigned char MMDVM_DEBUG2 = 0xF2U; const unsigned char MMDVM_DEBUG3 = 0xF3U; @@ -85,7 +83,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, 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, bool debug) : m_port(port), m_dmrColorCode(0U), m_ysfLoDev(false), @@ -101,7 +99,6 @@ m_dstarTXLevel(0U), m_dmrTXLevel(0U), m_ysfTXLevel(0U), m_p25TXLevel(0U), -m_samplesDir(samplesDir), m_debug(debug), m_rxFrequency(0U), m_txFrequency(0U), @@ -480,10 +477,6 @@ void CModem::clock(unsigned int ms) printDebug(); break; - case MMDVM_SAMPLES: - dumpSamples(); - break; - default: LogMessage("Unknown message, type: %02X", m_buffer[2U]); CUtils::dump("Buffer dump", m_buffer, m_length); @@ -1301,50 +1294,3 @@ void CModem::printDebug() LogMessage("Debug: %.*s %d %d %d %d", m_length - 11U, m_buffer + 3U, val1, val2, val3, val4); } } - -void CModem::dumpSamples() -{ - if (m_samplesDir.empty()) - m_samplesDir = "."; - - time_t now; - ::time(&now); - - struct tm* tm = ::localtime(&now); - - const char* mode = NULL; - switch (m_buffer[5U]) { - case MODE_DSTAR: - mode = "DStar"; - break; - case MODE_DMR: - mode = "DMR"; - break; - case MODE_P25: - mode = "P25"; - break; - case MODE_YSF: - mode = "YSF"; - break; - default: - LogWarning("Unknown protocol passed to samples dump - %u", m_buffer[5U]); - return; - } - - char filename[150U]; -#if defined(_WIN32) || defined(_WIN64) - ::sprintf(filename, "%s\\Samples-%s-%04d%02d%02d.dat", m_samplesDir.c_str(), mode, tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); -#else - ::sprintf(filename, "%s/Samples-%s-%04d%02d%02d.dat", m_samplesDir.c_str(), mode, tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); -#endif - - FILE* fp = ::fopen(filename, "a+b"); - if (fp == NULL) { - LogWarning("Unable to open samples file for writing - %s", filename); - return; - } - - ::fwrite(m_buffer + 6U, 1U, m_length - 6U, fp); - - ::fclose(fp); -} diff --git a/Modem.h b/Modem.h index d38e1f7..4f5a6cb 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, 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, bool debug = false); ~CModem(); void setRFParams(unsigned int rxFrequency, unsigned int txFrequency); @@ -103,7 +103,6 @@ private: unsigned int m_dmrTXLevel; unsigned int m_ysfTXLevel; unsigned int m_p25TXLevel; - std::string m_samplesDir; bool m_debug; unsigned int m_rxFrequency; unsigned int m_txFrequency; @@ -145,7 +144,6 @@ private: bool setFrequency(); void printDebug(); - void dumpSamples(); RESP_TYPE_MMDVM getResponse(); };