mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Keep the SET_CONFIG command unchanged for DVMegas.
This commit is contained in:
@@ -686,7 +686,7 @@ bool CMMDVMHost::createModem()
|
||||
|
||||
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->setModeLevels(dstarLevel, dmrLevel1, dmrLevel3, ysfLevel1, ysfLevel3, dmrThreshold, ysfThreshold);
|
||||
m_modem->setRFParams(rxFrequency, txFrequency);
|
||||
|
||||
13
Modem.cpp
13
Modem.cpp
@@ -76,9 +76,10 @@ const unsigned int MAX_RESPONSES = 30U;
|
||||
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_colorCode(0U),
|
||||
m_duplex(duplex),
|
||||
m_rxInvert(rxInvert),
|
||||
m_txInvert(txInvert),
|
||||
m_pttInvert(pttInvert),
|
||||
@@ -760,11 +761,13 @@ bool CModem::readStatus()
|
||||
|
||||
bool CModem::setConfig()
|
||||
{
|
||||
unsigned int length = m_duplex ? 19U : 12U;
|
||||
|
||||
unsigned char buffer[20U];
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
|
||||
buffer[1U] = 19U;
|
||||
buffer[1U] = length;
|
||||
|
||||
buffer[2U] = MMDVM_SET_CONFIG;
|
||||
|
||||
@@ -805,10 +808,10 @@ bool CModem::setConfig()
|
||||
buffer[17U] = (unsigned char)(m_dmrThreshold + 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);
|
||||
if (ret != 19)
|
||||
int ret = m_serial.write(buffer, length);
|
||||
if (ret != int(length))
|
||||
return false;
|
||||
|
||||
unsigned int count = 0U;
|
||||
|
||||
3
Modem.h
3
Modem.h
@@ -33,7 +33,7 @@ enum RESP_TYPE_MMDVM {
|
||||
|
||||
class CModem {
|
||||
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();
|
||||
|
||||
void setRFParams(unsigned int rxFrequency, unsigned int txFrequency);
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
private:
|
||||
std::string m_port;
|
||||
unsigned int m_colorCode;
|
||||
bool m_duplex;
|
||||
bool m_rxInvert;
|
||||
bool m_txInvert;
|
||||
bool m_pttInvert;
|
||||
|
||||
Reference in New Issue
Block a user