Merge remote-tracking branch 'origin/development' into mueller/master

This commit is contained in:
Robin Müller 2021-05-12 18:38:10 +02:00
commit b06113993c
4 changed files with 11 additions and 6 deletions

View File

@ -5,6 +5,8 @@
#include "../../ipc/MutexFactory.h"
#include "../../ipc/MutexGuard.h"
#include <cstring>
MessageQueue::MessageQueue(size_t messageDepth, size_t maxMessageSize):
messageSize(maxMessageSize), messageDepth(messageDepth) {
queueLock = MutexFactory::instance()->createMutex();
@ -126,8 +128,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
internalErrorReporter->queueMessageNotSent();
}
}
// TODO: Better returnvalue
return HasReturnvaluesIF::RETURN_FAILED;
return MessageQueueIF::DESTINATION_INVALID;
}
if(targetQueue->messageQueue.size() < targetQueue->messageDepth) {
MutexGuard mutexLock(targetQueue->queueLock, MutexIF::TimeoutType::WAITING, 20);

View File

@ -217,15 +217,15 @@ private:
* @brief The class stores the queue id it got assigned.
* If initialization fails, the queue id is set to zero.
*/
MessageQueueId_t mqId = 0;
MessageQueueId_t mqId = MessageQueueIF::NO_QUEUE;
size_t messageSize = 0;
size_t messageDepth = 0;
MutexIF* queueLock;
bool defaultDestinationSet = false;
MessageQueueId_t defaultDestination = 0;
MessageQueueId_t lastPartner = 0;
MessageQueueId_t defaultDestination = MessageQueueIF::NO_QUEUE;
MessageQueueId_t lastPartner = MessageQueueIF::NO_QUEUE;
};
#endif /* FRAMEWORK_OSAL_HOST_MESSAGEQUEUE_H_ */

View File

@ -19,7 +19,10 @@
class SerializeIF {
public:
enum class Endianness : uint8_t {
BIG, LITTLE, MACHINE
BIG,
LITTLE,
MACHINE,
NETWORK = BIG // Added for convenience like htons on sockets
};
static const uint8_t INTERFACE_ID = CLASS_ID::SERIALIZE_IF;

View File

@ -3,6 +3,7 @@
#include <FSFWConfig.h>
#include "../returnvalues/HasReturnvaluesIF.h"
#include <FSFWConfig.h>
/**
* A class implementing this IF provides facilities to add a time stamp to the