Skip to content

Commit bd30a35

Browse files
committed
Fix free space check for remote commands and HEARTBEAT frames
1 parent 142e2a4 commit bd30a35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Firmware/LoRaSerial/Radio.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ PacketType rcvDatagram()
23512351
// * Received datagramType
23522352
// * DATAGRAM_DUPLICATE
23532353
// * DATAGRAM_BAD
2354-
PacketType validateDatagram(VIRTUAL_CIRCUIT * vc, PacketType datagramType, uint8_t ackNumber, uint16_t freeBytes)
2354+
PacketType validateDatagram(VIRTUAL_CIRCUIT * vc, PacketType datagramType, uint8_t ackNumber, int freeBytes)
23552355
{
23562356
if (ackNumber != vc->rmtTxAckNumber)
23572357
{
@@ -2389,12 +2389,12 @@ PacketType validateDatagram(VIRTUAL_CIRCUIT * vc, PacketType datagramType, uint8
23892389
}
23902390

23912391
//Verify that there is sufficient space in the serialTransmitBuffer
2392-
if (inCommandMode || ((sizeof(serialTransmitBuffer) - availableTXBytes()) < rxDataBytes))
2392+
if (inCommandMode || (freeBytes < rxDataBytes))
23932393
{
23942394
if (settings.debugReceive || settings.debugDatagrams)
23952395
{
23962396
systemPrintTimestamp();
2397-
systemPrintln("Insufficient space in the serialTransmitBuffer");
2397+
systemPrintln("Insufficient space in the receive buffer");
23982398
}
23992399
insufficientSpace++;
24002400

0 commit comments

Comments
 (0)