more robust sp creator len setter

This commit is contained in:
Robin Müller 2024-10-09 10:37:52 +02:00
parent c5ec984d0b
commit 9fafccd6f1
Signed by: muellerr
GPG Key ID: A649FB78196E3849

View File

@ -43,10 +43,11 @@ ReturnValue_t SpacePacketCreator::serialize(uint8_t **buffer, size_t *size, size
void SpacePacketCreator::setCcsdsLenFromTotalDataFieldLen(size_t actualLength) { void SpacePacketCreator::setCcsdsLenFromTotalDataFieldLen(size_t actualLength) {
if (actualLength == 0) { if (actualLength == 0) {
return; setDataLenField(actualLength);
} } else {
setDataLenField(actualLength - 1); setDataLenField(actualLength - 1);
} }
}
size_t SpacePacketCreator::getSerializedSize() const { return ccsds::HEADER_LEN; } size_t SpacePacketCreator::getSerializedSize() const { return ccsds::HEADER_LEN; }
ReturnValue_t SpacePacketCreator::deSerialize(const uint8_t **buffer, size_t *size, ReturnValue_t SpacePacketCreator::deSerialize(const uint8_t **buffer, size_t *size,