mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-05-07 13:37:48 +00:00
Remove the last traces of M17 packet mode and fix a buffer overrun bug.
This commit is contained in:
parent
96c0e5b141
commit
2aabdb61ab
6 changed files with 12 additions and 98 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue