remove HDLC framing including CRC
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2022-11-16 14:42:18 +01:00
parent 3510cc85fc
commit 5b770a6407
4 changed files with 32 additions and 7 deletions

View File

@ -1051,9 +1051,14 @@ ReturnValue_t PlocSupvUartManager::parseRecRingBufForHdlc(size_t& readSize, size
if (encodedBuf[idx] == HDLC_END_MARKER) {
if (startMarkerFound) {
// Probably a packet, so decode it
hdlc_remove_framing(encodedBuf.data() + startIdx, idx + 1 - startIdx, decodedBuf.data(),
&decodedLen);
int retval = hdlc_remove_framing_with_crc_check(
encodedBuf.data() + startIdx, idx + 1 - startIdx, decodedBuf.data(), &decodedLen);
readSize = idx + 1;
if (retval == -1 or retval == -2) {
triggerEvent(HDLC_FRAME_REMOVAL_ERROR, retval);
} else if (retval == 1) {
triggerEvent(HDLC_CRC_ERROR);
}
return returnvalue::OK;
} else {
readSize = ++idx;