Merge pull request #361 from juribeparada/master

Adding support for new MMDVM_HS hardware description strings
This commit is contained in:
Jonathan Naylor 2017-12-29 17:08:40 +00:00 committed by GitHub
commit 469dc7ecd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 3 deletions

View file

@ -524,7 +524,7 @@ bool CDMRNetwork::writeOptions()
bool CDMRNetwork::writeConfig() bool CDMRNetwork::writeConfig()
{ {
const char* software = "MMDVM"; const char* software;
char slots = '0'; char slots = '0';
if (m_duplex) { if (m_duplex) {
if (m_slot1 && m_slot2) if (m_slot1 && m_slot2)
@ -533,6 +533,18 @@ bool CDMRNetwork::writeConfig()
slots = '1'; slots = '1';
else if (!m_slot1 && m_slot2) else if (!m_slot1 && m_slot2)
slots = '2'; slots = '2';
switch (m_hwType) {
case HWT_MMDVM:
software = "MMDVM";
break;
case HWT_MMDVM_HS:
software = "MMDVM_MMDVM_HS";
break;
default:
software = "MMDVM_Unknown";
break;
}
} else { } else {
slots = '4'; slots = '4';
@ -543,8 +555,14 @@ bool CDMRNetwork::writeConfig()
case HWT_DVMEGA: case HWT_DVMEGA:
software = "MMDVM_DVMega"; software = "MMDVM_DVMega";
break; break;
case HWT_MMDVM_ZUMSPOT:
software = "MMDVM_ZUMspot";
break;
case HWT_MMDVM_HS_HAT:
software = "MMDVM_MMDVM_HS_Hat";
break;
case HWT_MMDVM_HS: case HWT_MMDVM_HS:
software = "MMDVM_HS"; software = "MMDVM_MMDVM_HS";
break; break;
default: default:
software = "MMDVM_Unknown"; software = "MMDVM_Unknown";

View file

@ -36,6 +36,8 @@ const unsigned char TAG_EOT = 0x03U;
enum HW_TYPE { enum HW_TYPE {
HWT_MMDVM, HWT_MMDVM,
HWT_DVMEGA, HWT_DVMEGA,
HWT_MMDVM_ZUMSPOT,
HWT_MMDVM_HS_HAT,
HWT_MMDVM_HS, HWT_MMDVM_HS,
HWT_UNKNOWN HWT_UNKNOWN
}; };

View file

@ -914,11 +914,15 @@ bool CModem::readVersion()
CThread::sleep(10U); CThread::sleep(10U);
RESP_TYPE_MMDVM resp = getResponse(); RESP_TYPE_MMDVM resp = getResponse();
if (resp == RTM_OK && m_buffer[2U] == MMDVM_GET_VERSION) { if (resp == RTM_OK && m_buffer[2U] == MMDVM_GET_VERSION) {
if (::memcmp(m_buffer + 4U, "MMDVM", 5U) == 0) if (::memcmp(m_buffer + 4U, "MMDVM ", 6U) == 0)
m_hwType = HWT_MMDVM; m_hwType = HWT_MMDVM;
else if (::memcmp(m_buffer + 4U, "DVMEGA", 6U) == 0) else if (::memcmp(m_buffer + 4U, "DVMEGA", 6U) == 0)
m_hwType = HWT_DVMEGA; m_hwType = HWT_DVMEGA;
else if (::memcmp(m_buffer + 4U, "ZUMspot", 7U) == 0) else if (::memcmp(m_buffer + 4U, "ZUMspot", 7U) == 0)
m_hwType = HWT_MMDVM_ZUMSPOT;
else if (::memcmp(m_buffer + 4U, "MMDVM_HS_Hat", 12U) == 0)
m_hwType = HWT_MMDVM_HS_HAT;
else if (::memcmp(m_buffer + 4U, "MMDVM_HS-", 9U) == 0)
m_hwType = HWT_MMDVM_HS; m_hwType = HWT_MMDVM_HS;
LogInfo("MMDVM protocol version: %u, description: %.*s", m_buffer[3U], m_length - 4U, m_buffer + 4U); LogInfo("MMDVM protocol version: %u, description: %.*s", m_buffer[3U], m_length - 4U, m_buffer + 4U);