Identify an MMDVM in DMO mode for DMR network reporting.

This commit is contained in:
Jonathan Naylor
2016-09-05 17:40:43 +01:00
parent d6466f6e94
commit d84b3cbd7d
6 changed files with 41 additions and 6 deletions

View File

@@ -19,7 +19,6 @@
#include "DStarDefines.h"
#include "DMRDefines.h"
#include "YSFDefines.h"
#include "Defines.h"
#include "Thread.h"
#include "Modem.h"
#include "Utils.h"
@@ -117,7 +116,8 @@ m_dmrSpace2(0U),
m_ysfSpace(0U),
m_tx(false),
m_lockout(false),
m_error(false)
m_error(false),
m_hwType(HWT_UNKNOWN)
{
assert(!port.empty());
@@ -741,6 +741,11 @@ bool CModem::readVersion()
CThread::sleep(10U);
RESP_TYPE_MMDVM resp = getResponse();
if (resp == RTM_OK && m_buffer[2U] == MMDVM_GET_VERSION) {
if (::memcmp(m_buffer + 4U, "MMDVM", 5U) == 0)
m_hwType = HWT_MMDVM;
else if (::memcmp(m_buffer + 4U, "DVMEGA", 6U) == 0)
m_hwType = HWT_DVMEGA;
LogInfo("MMDVM protocol version: %u, description: %.*s", m_buffer[3U], m_length - 4U, m_buffer + 4U);
return true;
}
@@ -1016,6 +1021,11 @@ RESP_TYPE_MMDVM CModem::getResponse()
}
}
HW_TYPE CModem::getHWType() const
{
return m_hwType;
}
bool CModem::setMode(unsigned char mode)
{
unsigned char buffer[4U];