WIP: TC Packet PUS new serializer/creator function #629
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#629
Loading…
Reference in New Issue
No description provided.
Delete Branch "KSat/fsfw:mueller/tc-packet-pus-improvement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hm
setApplicationData
is not able to check any length or do I miss something there? This seems to be a fancy wrapper for memcpy without any possible check for the size ofthis->tcData->appdata
. So, everything must be checked by the user before. We should add this in the documentation. If not used correctly, this introduces issues which are difficult to track.I can look into adding that documentation or whether a size check is possible.
Refactored this to leave
TcPacketPus
untouched and circumvent store with new function which can serialize and initialize TC packets into a given buffer. Still needs to be tested.This class is then only intended for serialization/packet creation. It has the same style as the CFDP PDU serializer classes. I will also probably unit test this class.
TC Packet PUS improvementsto WIP: TC Packet PUS new serializer/creator functionJust small remarks
@ -0,0 +16,4 @@
return RETURN_OK;
}
size_t TcPacketSerializer::getSerializedSize() const { return TC_PACKET_MIN_SIZE + cfg.appDataLen; }
TC_PACKET_MIN_SIZE is compile time fix for a specific pus version. PusConfig allows for different PusVersions. This might be an issue for PUS A usage at compile time and PUS C usage here.
@ -0,0 +14,4 @@
uint16_t sourceId = 0;
uint8_t* appData = nullptr;
size_t appDataLen = 0;
pus::PusVersion pusVersion = pus::PusVersion::PUS_C_VERSION;
Maybe fix this at compile time to be disallow problems with TC_PACKET_MIN_SIZE
Mis-clicked previous review. :( See comments above.
LGTM
Will be obsolete with #655
Pull request closed