remove HDLC framing including CRC
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user