1
0
forked from fsfw/fsfw

added new interface to host and linux osal

This commit is contained in:
2020-06-11 02:03:18 +02:00
parent c1fe326f67
commit a9c7ad84c8
11 changed files with 90 additions and 40 deletions

View File

@ -160,3 +160,11 @@ uint8_t* CommandMessage::getData() {
const uint8_t* CommandMessage::getData() const {
return internalMessage->getData();
}
size_t CommandMessage::getMessageSize() const {
return COMMAND_MESSAGE_SIZE;
}
size_t CommandMessage::getMaximumMessageSize() const {
return MessageQueueMessage::MAX_MESSAGE_SIZE;
}

View File

@ -85,6 +85,8 @@ public:
uint8_t * getData() override;
const uint8_t* getData() const override;
size_t getMinimumMessageSize() const override;
size_t getMessageSize() const override;
size_t getMaximumMessageSize() const override;
/**
* Extract message ID, which is the first byte of the command ID.

View File

@ -67,3 +67,11 @@ void MessageQueueMessage::print() {
void MessageQueueMessage::clear() {
memset(this->getBuffer(), 0, this->MAX_MESSAGE_SIZE);
}
size_t MessageQueueMessage::getMessageSize() const {
return this->messageSize;
}
size_t MessageQueueMessage::getMaximumMessageSize() const {
return this->MAX_MESSAGE_SIZE;
}

View File

@ -149,6 +149,10 @@ public:
*/
virtual size_t getMinimumMessageSize() const override;
virtual size_t getMessageSize() const override;
virtual size_t getMaximumMessageSize() const override;
/**
* @brief This is a debug method that prints the content
* (till messageSize) to the debug output.

View File

@ -71,6 +71,18 @@ public:
* check the size of an incoming message.
*/
virtual size_t getMinimumMessageSize() const = 0;
/**
* Get message size of current message implementation.
* @return
*/
virtual size_t getMessageSize() const = 0;
/**
* Get maximum allowed size of current message implementation.
* @return
*/
virtual size_t getMaximumMessageSize() const = 0;
};