Keep the SET_CONFIG command unchanged for DVMegas.

This commit is contained in:
Jonathan Naylor 2016-06-22 20:42:14 +01:00
parent 10e3a85691
commit 05e08a232f
3 changed files with 11 additions and 7 deletions

View file

@ -686,7 +686,7 @@ bool CMMDVMHost::createModem()
LogInfo(" Osc. Offset: %dppm", oscOffset); LogInfo(" Osc. Offset: %dppm", oscOffset);
m_modem = new CModem(port, rxInvert, txInvert, pttInvert, txDelay, rxLevel, txLevel, dmrDelay, oscOffset, debug); m_modem = new CModem(port, m_duplex, rxInvert, txInvert, pttInvert, txDelay, rxLevel, txLevel, dmrDelay, oscOffset, debug);
m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled); m_modem->setModeParams(m_dstarEnabled, m_dmrEnabled, m_ysfEnabled);
m_modem->setModeLevels(dstarLevel, dmrLevel1, dmrLevel3, ysfLevel1, ysfLevel3, dmrThreshold, ysfThreshold); m_modem->setModeLevels(dstarLevel, dmrLevel1, dmrLevel3, ysfLevel1, ysfLevel3, dmrThreshold, ysfThreshold);
m_modem->setRFParams(rxFrequency, txFrequency); m_modem->setRFParams(rxFrequency, txFrequency);

View file

@ -76,9 +76,10 @@ const unsigned int MAX_RESPONSES = 30U;
const unsigned int BUFFER_LENGTH = 500U; const unsigned int BUFFER_LENGTH = 500U;
CModem::CModem(const std::string& port, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int rxLevel, unsigned int txLevel, unsigned int dmrDelay, int oscOffset, bool debug) : CModem::CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int rxLevel, unsigned int txLevel, unsigned int dmrDelay, int oscOffset, bool debug) :
m_port(port), m_port(port),
m_colorCode(0U), m_colorCode(0U),
m_duplex(duplex),
m_rxInvert(rxInvert), m_rxInvert(rxInvert),
m_txInvert(txInvert), m_txInvert(txInvert),
m_pttInvert(pttInvert), m_pttInvert(pttInvert),
@ -760,11 +761,13 @@ bool CModem::readStatus()
bool CModem::setConfig() bool CModem::setConfig()
{ {
unsigned int length = m_duplex ? 19U : 12U;
unsigned char buffer[20U]; unsigned char buffer[20U];
buffer[0U] = MMDVM_FRAME_START; buffer[0U] = MMDVM_FRAME_START;
buffer[1U] = 19U; buffer[1U] = length;
buffer[2U] = MMDVM_SET_CONFIG; buffer[2U] = MMDVM_SET_CONFIG;
@ -805,10 +808,10 @@ bool CModem::setConfig()
buffer[17U] = (unsigned char)(m_dmrThreshold + 128); buffer[17U] = (unsigned char)(m_dmrThreshold + 128);
buffer[18U] = (unsigned char)(m_ysfThreshold + 128); buffer[18U] = (unsigned char)(m_ysfThreshold + 128);
// CUtils::dump(1U, "Written", buffer, 19U); // CUtils::dump(1U, "Written", buffer, length);
int ret = m_serial.write(buffer, 19U); int ret = m_serial.write(buffer, length);
if (ret != 19) if (ret != int(length))
return false; return false;
unsigned int count = 0U; unsigned int count = 0U;

View file

@ -33,7 +33,7 @@ enum RESP_TYPE_MMDVM {
class CModem { class CModem {
public: public:
CModem(const std::string& port, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int rxLevel, unsigned int txLevel, unsigned int dmrDelay, int oscOffset, bool debug = false); CModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int rxLevel, unsigned int txLevel, unsigned int dmrDelay, int oscOffset, bool debug = false);
~CModem(); ~CModem();
void setRFParams(unsigned int rxFrequency, unsigned int txFrequency); void setRFParams(unsigned int rxFrequency, unsigned int txFrequency);
@ -78,6 +78,7 @@ public:
private: private:
std::string m_port; std::string m_port;
unsigned int m_colorCode; unsigned int m_colorCode;
bool m_duplex;
bool m_rxInvert; bool m_rxInvert;
bool m_txInvert; bool m_txInvert;
bool m_pttInvert; bool m_pttInvert;