Skip to content

Commit

Permalink
Adding support for new MMDVM_HS hardware description strings
Browse files Browse the repository at this point in the history
  • Loading branch information
juribeparada committed Dec 26, 2017
1 parent bafa100 commit e425bdc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
22 changes: 20 additions & 2 deletions DMRNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ bool CDMRNetwork::writeOptions()

bool CDMRNetwork::writeConfig()
{
const char* software = "MMDVM";
const char* software;
char slots = '0';
if (m_duplex) {
if (m_slot1 && m_slot2)
Expand All @@ -533,6 +533,18 @@ bool CDMRNetwork::writeConfig()
slots = '1';
else if (!m_slot1 && m_slot2)
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 {
slots = '4';

Expand All @@ -543,8 +555,14 @@ bool CDMRNetwork::writeConfig()
case HWT_DVMEGA:
software = "MMDVM_DVMega";
break;
case HWT_MMDVM_ZUMSPOT:
software = "MMDVM_ZUMspot";
break;
case HWT_MMDVM_HS_HAT:
software = "MMDVM_MMDVM_HS_Hat";
break;
case HWT_MMDVM_HS:
software = "MMDVM_HS";
software = "MMDVM_MMDVM_HS";
break;
default:
software = "MMDVM_Unknown";
Expand Down
2 changes: 2 additions & 0 deletions Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const unsigned char TAG_EOT = 0x03U;
enum HW_TYPE {
HWT_MMDVM,
HWT_DVMEGA,
HWT_MMDVM_ZUMSPOT,
HWT_MMDVM_HS_HAT,
HWT_MMDVM_HS,
HWT_UNKNOWN
};
Expand Down
6 changes: 5 additions & 1 deletion Modem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,15 @@ 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)
if (::memcmp(m_buffer + 4U, "MMDVM ", 6U) == 0)
m_hwType = HWT_MMDVM;
else if (::memcmp(m_buffer + 4U, "DVMEGA", 6U) == 0)
m_hwType = HWT_DVMEGA;
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;

LogInfo("MMDVM protocol version: %u, description: %.*s", m_buffer[3U], m_length - 4U, m_buffer + 4U);
Expand Down

0 comments on commit e425bdc

Please sign in to comment.