bugfix hk message size

This commit is contained in:
Robin Müller 2020-06-17 20:21:49 +02:00
parent b68ad9e4f9
commit d5ae74f860
3 changed files with 5 additions and 5 deletions

View File

@ -4,8 +4,8 @@
HousekeepingMessage::HousekeepingMessage(MessageQueueMessageIF* message): HousekeepingMessage::HousekeepingMessage(MessageQueueMessageIF* message):
CommandMessageBase(message) { CommandMessageBase(message) {
if(message->getMaximumMessageSize() < HK_MESSAGE_SIZE) { if(message->getMaximumMessageSize() < HK_MESSAGE_SIZE) {
sif::error << "CommandMessage::ComandMessage: Passed message buffer" sif::error << "HousekeepingMessage::HousekeepingMessage: Passed "
" can not hold minimum "<< HK_MESSAGE_SIZE "message buffer can not hold minimum " << HK_MESSAGE_SIZE
<< " bytes!" << std::endl; << " bytes!" << std::endl;
return; return;
} }

View File

@ -36,8 +36,8 @@ union sid_t {
class HousekeepingMessage : public CommandMessageBase { class HousekeepingMessage : public CommandMessageBase {
public: public:
static constexpr size_t HK_MESSAGE_SIZE = sizeof(MessageQueueId_t) static constexpr size_t HK_MESSAGE_SIZE = CommandMessageIF::HEADER_SIZE +
+ sizeof(Command_t) + sizeof(sid_t) * sizeof(uint32_t); sizeof(sid_t) + sizeof(uint32_t);
/** /**
* The HK message is initialized with a pointer to a message which holds * The HK message is initialized with a pointer to a message which holds

View File

@ -12,7 +12,7 @@ CommandMessage::CommandMessage(MessageQueueMessageIF* receiverMessage):
if(receiverMessage->getMaximumMessageSize() < if(receiverMessage->getMaximumMessageSize() <
getMinimumMessageSize()) { getMinimumMessageSize()) {
sif::error << "CommandMessage::ComandMessage: Passed message buffer" sif::error << "CommandMessage::ComandMessage: Passed message buffer"
" can not hold minimum "<< MINIMUM_COMMAND_MESSAGE_SIZE " can not hold minimum "<< getMinimumMessageSize()
<< " bytes!" << std::endl; << " bytes!" << std::endl;
return; return;
} }