Remove the OscOffset parameter.

This commit is contained in:
Jonathan Naylor
2017-03-07 20:38:06 +00:00
parent 917727602c
commit d51b7261cf
6 changed files with 16 additions and 28 deletions

View File

@@ -90,7 +90,6 @@ m_modemDStarTXLevel(50U),
m_modemDMRTXLevel(50U), m_modemDMRTXLevel(50U),
m_modemYSFTXLevel(50U), m_modemYSFTXLevel(50U),
m_modemP25TXLevel(50U), m_modemP25TXLevel(50U),
m_modemOscOffset(0),
m_modemRSSIMappingFile(), m_modemRSSIMappingFile(),
m_modemSamplesDir(), m_modemSamplesDir(),
m_modemDebug(false), m_modemDebug(false),
@@ -217,9 +216,9 @@ bool CConf::read()
section = SECTION_P25; section = SECTION_P25;
else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0) else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0)
section = SECTION_DSTAR_NETWORK; section = SECTION_DSTAR_NETWORK;
else if (::strncmp(buffer, "[DMR Network]", 13U) == 0) else if (::strncmp(buffer, "[DMR Network]", 13U) == 0)
section = SECTION_DMR_NETWORK; 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; section = SECTION_FUSION_NETWORK;
else if (::strncmp(buffer, "[P25 Network]", 13U) == 0) else if (::strncmp(buffer, "[P25 Network]", 13U) == 0)
section = SECTION_P25_NETWORK; section = SECTION_P25_NETWORK;
@@ -236,15 +235,18 @@ bool CConf::read()
else else
section = SECTION_NONE; section = SECTION_NONE;
continue; continue;
} }
char* key = ::strtok(buffer, " \t=\r\n"); char* key = ::strtok(buffer, " \t=\r\n");
if (key == NULL) if (key == NULL)
continue; continue;
char* value = ::strtok(NULL, "\r\n"); char* value = ::strtok(NULL, "\r\n");
if (section == SECTION_GENERAL) { if (value == NULL)
value = "";
if (section == SECTION_GENERAL) {
if (::strcmp(key, "Callsign") == 0) { if (::strcmp(key, "Callsign") == 0) {
// Convert the callsign to upper case // Convert the callsign to upper case
for (unsigned int i = 0U; value[i] != 0; i++) for (unsigned int i = 0U; value[i] != 0; i++)
@@ -329,8 +331,6 @@ bool CConf::read()
m_modemYSFTXLevel = (unsigned int)::atoi(value); m_modemYSFTXLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "P25TXLevel") == 0) else if (::strcmp(key, "P25TXLevel") == 0)
m_modemP25TXLevel = (unsigned int)::atoi(value); m_modemP25TXLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "OscOffset") == 0)
m_modemOscOffset = ::atoi(value);
else if (::strcmp(key, "RSSIMappingFile") == 0) else if (::strcmp(key, "RSSIMappingFile") == 0)
m_modemRSSIMappingFile = value; m_modemRSSIMappingFile = value;
else if (::strcmp(key, "SamplesDir") == 0) else if (::strcmp(key, "SamplesDir") == 0)
@@ -742,11 +742,6 @@ unsigned int CConf::getModemP25TXLevel() const
return m_modemP25TXLevel; return m_modemP25TXLevel;
} }
int CConf::getModemOscOffset() const
{
return m_modemOscOffset;
}
std::string CConf::getModemRSSIMappingFile () const std::string CConf::getModemRSSIMappingFile () const
{ {
return m_modemRSSIMappingFile; return m_modemRSSIMappingFile;

2
Conf.h
View File

@@ -77,7 +77,6 @@ public:
unsigned int getModemDMRTXLevel() const; unsigned int getModemDMRTXLevel() const;
unsigned int getModemYSFTXLevel() const; unsigned int getModemYSFTXLevel() const;
unsigned int getModemP25TXLevel() const; unsigned int getModemP25TXLevel() const;
int getModemOscOffset() const;
std::string getModemRSSIMappingFile() const; std::string getModemRSSIMappingFile() const;
std::string getModemSamplesDir() const; std::string getModemSamplesDir() const;
bool getModemDebug() const; bool getModemDebug() const;
@@ -230,7 +229,6 @@ private:
unsigned int m_modemDMRTXLevel; unsigned int m_modemDMRTXLevel;
unsigned int m_modemYSFTXLevel; unsigned int m_modemYSFTXLevel;
unsigned int m_modemP25TXLevel; unsigned int m_modemP25TXLevel;
int m_modemOscOffset;
std::string m_modemRSSIMappingFile; std::string m_modemRSSIMappingFile;
std::string m_modemSamplesDir; std::string m_modemSamplesDir;
bool m_modemDebug; bool m_modemDebug;

View File

@@ -49,7 +49,6 @@ TXLevel=50
# DMRTXLevel=50 # DMRTXLevel=50
# YSFTXLevel=50 # YSFTXLevel=50
# P25TXLevel=50 # P25TXLevel=50
OscOffset=0
RSSIMappingFile=RSSI.dat RSSIMappingFile=RSSI.dat
SamplesDir=. SamplesDir=.
Debug=0 Debug=0

View File

@@ -796,7 +796,6 @@ bool CMMDVMHost::createModem()
unsigned int colorCode = m_conf.getDMRColorCode(); unsigned int colorCode = m_conf.getDMRColorCode();
unsigned int rxFrequency = m_conf.getRxFrequency(); unsigned int rxFrequency = m_conf.getRxFrequency();
unsigned int txFrequency = m_conf.getTxFrequency(); unsigned int txFrequency = m_conf.getTxFrequency();
int oscOffset = m_conf.getModemOscOffset();
std::string samplesDir = m_conf.getModemSamplesDir(); std::string samplesDir = m_conf.getModemSamplesDir();
LogInfo("Modem Parameters"); LogInfo("Modem Parameters");
@@ -814,9 +813,8 @@ bool CMMDVMHost::createModem()
LogInfo(" P25 TX Level: %u%%", p25TXLevel); LogInfo(" P25 TX Level: %u%%", p25TXLevel);
LogInfo(" RX Frequency: %uHz", rxFrequency); LogInfo(" RX Frequency: %uHz", rxFrequency);
LogInfo(" TX Frequency: %uHz", txFrequency); 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->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled, m_p25Enabled);
m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel); m_modem->setLevels(rxLevel, cwIdTXLevel, dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel);
m_modem->setRFParams(rxFrequency, txFrequency); m_modem->setRFParams(rxFrequency, txFrequency);

View File

@@ -85,7 +85,7 @@ const unsigned int MAX_RESPONSES = 30U;
const unsigned int BUFFER_LENGTH = 2000U; const unsigned int BUFFER_LENGTH = 2000U;
CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, 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_port(port),
m_colorCode(0U), m_colorCode(0U),
m_duplex(duplex), m_duplex(duplex),
@@ -100,7 +100,6 @@ m_dstarTXLevel(0U),
m_dmrTXLevel(0U), m_dmrTXLevel(0U),
m_ysfTXLevel(0U), m_ysfTXLevel(0U),
m_p25TXLevel(0U), m_p25TXLevel(0U),
m_oscOffset(oscOffset),
m_samplesDir(samplesDir), m_samplesDir(samplesDir),
m_debug(debug), m_debug(debug),
m_rxFrequency(0U), m_rxFrequency(0U),
@@ -980,7 +979,7 @@ bool CModem::setConfig()
buffer[10U] = m_dmrDelay; buffer[10U] = m_dmrDelay;
buffer[11U] = (unsigned char)(m_oscOffset + 128); buffer[11U] = 0U; // Was OscOffset
buffer[12U] = (m_dstarTXLevel * 255U) / 100U; buffer[12U] = (m_dstarTXLevel * 255U) / 100U;
buffer[13U] = (m_dmrTXLevel * 255U) / 100U; buffer[13U] = (m_dmrTXLevel * 255U) / 100U;

View File

@@ -34,7 +34,7 @@ enum RESP_TYPE_MMDVM {
class CModem { class CModem {
public: public:
CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, 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(); ~CModem();
void setRFParams(unsigned int rxFrequency, unsigned int txFrequency); void setRFParams(unsigned int rxFrequency, unsigned int txFrequency);
@@ -101,7 +101,6 @@ private:
unsigned int m_dmrTXLevel; unsigned int m_dmrTXLevel;
unsigned int m_ysfTXLevel; unsigned int m_ysfTXLevel;
unsigned int m_p25TXLevel; unsigned int m_p25TXLevel;
int m_oscOffset;
std::string m_samplesDir; std::string m_samplesDir;
bool m_debug; bool m_debug;
unsigned int m_rxFrequency; unsigned int m_rxFrequency;