Remove the last traces of M17 packet mode and fix a buffer overrun bug.

This commit is contained in:
Jonathan Naylor 2021-08-08 18:55:09 +01:00
parent 96c0e5b141
commit 2aabdb61ab
6 changed files with 12 additions and 98 deletions

View file

@ -1329,20 +1329,6 @@ void CSerialPort::processMessage(uint8_t type, const uint8_t* buffer, uint16_t l
sendNAK(type, err);
}
break;
case MMDVM_M17_PACKET:
if (m_m17Enable) {
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
err = m17TX.writeData(buffer, length);
}
if (err == 0U) {
if (m_modemState == STATE_IDLE)
setMode(STATE_M17);
} else {
DEBUG2("Received invalid M17 packet data", err);
sendNAK(type, err);
}
break;
#endif
#if defined(MODE_POCSAG)
@ -1740,29 +1726,6 @@ void CSerialPort::writeM17Stream(const uint8_t* data, uint8_t length)
writeInt(1U, reply, count);
}
void CSerialPort::writeM17Packet(const uint8_t* data, uint8_t length)
{
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
return;
if (!m_m17Enable)
return;
uint8_t reply[130U];
reply[0U] = MMDVM_FRAME_START;
reply[1U] = 0U;
reply[2U] = MMDVM_M17_PACKET;
uint8_t count = 3U;
for (uint8_t i = 0U; i < length; i++, count++)
reply[count] = data[i];
reply[1U] = count;
writeInt(1U, reply, count);
}
void CSerialPort::writeM17Lost()
{
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)