Fixed bug where iRxBufferLength was not getting cleared
diff --git a/src/vfs/ant_rx_chardev.c b/src/vfs/ant_rx_chardev.c
index 778f0c9..f15e97a 100644
--- a/src/vfs/ant_rx_chardev.c
+++ b/src/vfs/ant_rx_chardev.c
@@ -272,6 +272,8 @@
iRet = 0;
goto out;
}
+
+ iRxBufferLength = 0; // reset buffer length here since we should have a full packet
#if ANT_HCI_OPCODE_SIZE == 1 // Check the different message types by opcode
ANT_U8 opcode = aucRxBuffer[ANT_HCI_OPCODE_OFFSET];
@@ -329,7 +331,7 @@
&aucRxBuffer[iCurrentHciPacketOffset + ANT_HCI_DATA_OFFSET]);
} else {
ANT_WARN("%s rx callback is null", pstChnlInfo->pcDevicePath);
- }
+ }
}
iCurrentHciPacketOffset = iCurrentHciPacketOffset + ANT_HCI_HEADER_SIZE + ANT_HCI_FOOTER_SIZE + iHciDataSize;