mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-23 00:35:53 +08:00
Add crude M17 capability checking for V1 MMDVMs.
This commit is contained in:
19
Modem.cpp
19
Modem.cpp
@@ -2027,9 +2027,11 @@ bool CModem::readVersion()
|
|||||||
switch (m_protocolVersion) {
|
switch (m_protocolVersion) {
|
||||||
case 1U:
|
case 1U:
|
||||||
LogInfo("MMDVM protocol version: 1, description: %.*s", m_length - 4U, m_buffer + 4U);
|
LogInfo("MMDVM protocol version: 1, description: %.*s", m_length - 4U, m_buffer + 4U);
|
||||||
m_capabilities1 = CAP1_DSTAR | CAP1_DMR | CAP1_YSF | CAP1_P25 | CAP1_NXDN | CAP1_M17;
|
m_capabilities1 = CAP1_DSTAR | CAP1_DMR | CAP1_YSF | CAP1_P25 | CAP1_NXDN;
|
||||||
m_capabilities2 = CAP2_POCSAG;
|
m_capabilities2 = CAP2_POCSAG;
|
||||||
return true;
|
if (::strstr((char*)(m_buffer + 4U), "v1.6.") != NULL)
|
||||||
|
m_capabilities1 |= CAP1_M17;
|
||||||
|
break;
|
||||||
|
|
||||||
case 2U:
|
case 2U:
|
||||||
LogInfo("MMDVM protocol version: 2, description: %.*s", m_length - 23U, m_buffer + 23U);
|
LogInfo("MMDVM protocol version: 2, description: %.*s", m_length - 23U, m_buffer + 23U);
|
||||||
@@ -2049,6 +2051,13 @@ bool CModem::readVersion()
|
|||||||
}
|
}
|
||||||
m_capabilities1 = m_buffer[4U];
|
m_capabilities1 = m_buffer[4U];
|
||||||
m_capabilities2 = m_buffer[5U];
|
m_capabilities2 = m_buffer[5U];
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
LogError("MMDVM protocol version: %u, unsupported by this version of the MMDVM Host", m_protocolVersion);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
char modeText[100U];
|
char modeText[100U];
|
||||||
::strcpy(modeText, "Modes:");
|
::strcpy(modeText, "Modes:");
|
||||||
if (hasDStar())
|
if (hasDStar())
|
||||||
@@ -2070,12 +2079,6 @@ bool CModem::readVersion()
|
|||||||
if (hasAX25())
|
if (hasAX25())
|
||||||
::strcat(modeText, " AX.25");
|
::strcat(modeText, " AX.25");
|
||||||
LogInfo(modeText);
|
LogInfo(modeText);
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
|
||||||
LogError("MMDVM protocol version: %u, unsupported by this version of the MMDVM Host", m_protocolVersion);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user