STR seems to work well now

This commit is contained in:
Robin Müller 2023-04-16 03:52:10 +02:00
parent 9997aa5470
commit 680d496b28
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 6 additions and 34 deletions

View File

@ -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);

2
tmtc

@ -1 +1 @@
Subproject commit d00e4247f66eb2f010f1fe53ee7f59b7fb992481
Subproject commit d623e83be8536f8887f1da00a1f0c4be191db1e8