Add crude M17 capability checking for V1 MMDVMs.

This commit is contained in:
Jonathan Naylor
2023-07-23 15:00:07 +01:00
parent 8a80d9678c
commit 38227730d0
2 changed files with 28 additions and 25 deletions

View File

@@ -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;
} }

View File

@@ -19,6 +19,6 @@
#if !defined(VERSION_H) #if !defined(VERSION_H)
#define VERSION_H #define VERSION_H
const char* VERSION = "20220523"; const char* VERSION = "20230723";
#endif #endif