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,9 +43,10 @@ ReturnValue_t SpacePacketCreator::serialize(uint8_t **buffer, size_t *size, size
void SpacePacketCreator::setCcsdsLenFromTotalDataFieldLen(size_t actualLength) {
if (actualLength == 0) {
return;
setDataLenField(actualLength);
} else {
setDataLenField(actualLength - 1);
}
setDataLenField(actualLength - 1);
}
size_t SpacePacketCreator::getSerializedSize() const { return ccsds::HEADER_LEN; }