Fixed bug where the receiving exact number of bytes would lead to saving
diff --git a/src/vfs/ant_rx_chardev.c b/src/vfs/ant_rx_chardev.c
index f15e97a..d6262e5 100644
--- a/src/vfs/ant_rx_chardev.c
+++ b/src/vfs/ant_rx_chardev.c
@@ -267,7 +267,7 @@
iRxLenRead += iRxBufferLength; // add existing data on
// if we didn't get a full packet, then just exit
- if (iRxLenRead <= (aucRxBuffer[ANT_HCI_SIZE_OFFSET] + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE)) {
+ if (iRxLenRead < (aucRxBuffer[ANT_HCI_SIZE_OFFSET] + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE)) {
iRxBufferLength = iRxLenRead;
iRet = 0;
goto out;
@@ -306,7 +306,7 @@
// This currently works as no size value is greater than 255, and little endian
iHciDataSize = aucRxBuffer[iCurrentHciPacketOffset + ANT_HCI_SIZE_OFFSET];
- if ((iHciDataSize + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE + iCurrentHciPacketOffset) >=
+ if ((iHciDataSize + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE + iCurrentHciPacketOffset) >
iRxLenRead) {
// we don't have a whole packet
iRxBufferLength = iRxLenRead - iCurrentHciPacketOffset;