diff --git a/mission/acs/str/ArcsecDatalinkLayer.cpp b/mission/acs/str/ArcsecDatalinkLayer.cpp index c8b265d1..b15e8e64 100644 --- a/mission/acs/str/ArcsecDatalinkLayer.cpp +++ b/mission/acs/str/ArcsecDatalinkLayer.cpp @@ -30,13 +30,16 @@ ReturnValue_t ArcsecDatalinkLayer::checkRingBufForFrame(const uint8_t** decodedF } // Now we can try decoding the whole frame. size_t encodedDataSize = 0; - // TODO: Find SLIP ID slip_error_t slipError = slip_decode_frame( decodedRxFrame, &rxFrameSize, rxAnalysisBuffer + startIdx, - sizeof(rxAnalysisBuffer) - startIdx, &encodedDataSize, ARC_DEF_SAGITTA_SLIP_ID); + idx - startIdx + 1, &encodedDataSize, ARC_DEF_SAGITTA_SLIP_ID); decodeRingBuf.deleteData(idx + 1); switch (slipError) { case (SLIP_OK): { + if(decodedFrame != nullptr) { + *decodedFrame = decodedRxFrame; + } + frameLen = rxFrameSize; return returnvalue::OK; } case (SLIP_BAD_CRC): { @@ -57,32 +60,6 @@ ReturnValue_t ArcsecDatalinkLayer::checkRingBufForFrame(const uint8_t** decodedF } } } - // switch (decResult) { - // case ARC_DEC_INPROGRESS: { - // break; - // } - // case ARC_DEC_ERROR: { - // decodeRingBuf.deleteData(idx); - // return returnvalue::FAILED; - // } - // case ARC_DEC_ASYNC: - // case ARC_DEC_SYNC: { - // // Reset length of SLIP struct for next frame - // slipInfo.length = 0; - // if (decodedFrame != nullptr) { - // *decodedFrame = decodedRxFrame; - // } - // frameLen = rxFrameSize; - // decodeRingBuf.deleteData(idx); - // return returnvalue::OK; - // } - // default: - // sif::debug << "ArcsecDatalinkLayer::decodeFrame: Unknown result code" << std::endl; - // break; - // return returnvalue::FAILED; - // } - // } - // decodeRingBuf.deleteData(currentLen); return DEC_IN_PROGRESS; } @@ -96,14 +73,9 @@ ReturnValue_t ArcsecDatalinkLayer::feedData(const uint8_t* rawData, size_t rawDa } void ArcsecDatalinkLayer::reset() { - // slipInit(); decodeRingBuf.clear(); } -// void ArcsecDatalinkLayer::slipInit() { -// slip_decode_init(rxBufferArc, sizeof(rxBufferArc), &slipInfo); -// } - void ArcsecDatalinkLayer::encodeFrame(const uint8_t* data, size_t length, const uint8_t** txFrame, size_t& size) { slip_encode_frame(data, length, txEncoded, &size, ARC_DEF_SAGITTA_SLIP_ID); diff --git a/tmtc b/tmtc index d00e4247..d623e83b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d00e4247f66eb2f010f1fe53ee7f59b7fb992481 +Subproject commit d623e83be8536f8887f1da00a1f0c4be191db1e8