avoid duplicate code

This commit is contained in:
Robin Müller 2022-08-29 20:08:59 +02:00
parent 81a7c21cd1
commit 9a9085b9e6
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -12,7 +12,7 @@ MessageQueueMessage::MessageQueueMessage() : messageSize(getMinimumMessageSize()
MessageQueueMessage::MessageQueueMessage(uint8_t* data, size_t size) MessageQueueMessage::MessageQueueMessage(uint8_t* data, size_t size)
: messageSize(MessageQueueMessage::HEADER_SIZE + size) { : messageSize(MessageQueueMessage::HEADER_SIZE + size) {
if (size <= MessageQueueMessage::MAX_DATA_SIZE) { if (size <= MessageQueueMessage::MAX_DATA_SIZE) {
std::memcpy(internalBuffer + MessageQueueMessage::HEADER_SIZE, data, size); std::memcpy(MessageQueueMessage::getData(), data, size);
this->messageSize = MessageQueueMessage::HEADER_SIZE + size; this->messageSize = MessageQueueMessage::HEADER_SIZE + size;
} else { } else {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1