fixed host os
This commit is contained in:
parent
a0098e8b17
commit
e164282253
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "fwSubsystemIdRanges.h"
|
#include "fwSubsystemIdRanges.h"
|
||||||
//could be move to more suitable location
|
//could be move to more suitable location
|
||||||
#include <config/tmtc/subsystemIdRanges.h>
|
#include <subsystemIdRanges.h>
|
||||||
|
|
||||||
typedef uint16_t EventId_t;
|
typedef uint16_t EventId_t;
|
||||||
typedef uint8_t EventSeverity_t;
|
typedef uint8_t EventSeverity_t;
|
||||||
|
@ -20,20 +20,20 @@ MessageQueue::~MessageQueue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueue::sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, bool ignoreFault) {
|
MessageQueueMessage* message, bool ignoreFault) {
|
||||||
return sendMessageFrom(sendTo, message, this->getId(), ignoreFault);
|
return sendMessageFrom(sendTo, message, this->getId(), ignoreFault);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendToDefault(MessageQueueMessageIF* message) {
|
ReturnValue_t MessageQueue::sendToDefault(MessageQueueMessage* message) {
|
||||||
return sendToDefaultFrom(message, this->getId());
|
return sendToDefaultFrom(message, this->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendToDefaultFrom(MessageQueueMessageIF* message,
|
ReturnValue_t MessageQueue::sendToDefaultFrom(MessageQueueMessage* message,
|
||||||
MessageQueueId_t sentFrom, bool ignoreFault) {
|
MessageQueueId_t sentFrom, bool ignoreFault) {
|
||||||
return sendMessageFrom(defaultDestination,message,sentFrom,ignoreFault);
|
return sendMessageFrom(defaultDestination,message,sentFrom,ignoreFault);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::reply(MessageQueueMessageIF* message) {
|
ReturnValue_t MessageQueue::reply(MessageQueueMessage* message) {
|
||||||
if (this->lastPartner != 0) {
|
if (this->lastPartner != 0) {
|
||||||
return sendMessageFrom(this->lastPartner, message, this->getId());
|
return sendMessageFrom(this->lastPartner, message, this->getId());
|
||||||
} else {
|
} else {
|
||||||
@ -42,13 +42,13 @@ ReturnValue_t MessageQueue::reply(MessageQueueMessageIF* message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
MessageQueueMessage* message, MessageQueueId_t sentFrom,
|
||||||
bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
return sendMessageFromMessageQueue(sendTo, message, sentFrom,
|
return sendMessageFromMessageQueue(sendTo, message, sentFrom,
|
||||||
ignoreFault);
|
ignoreFault);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message,
|
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessage* message,
|
||||||
MessageQueueId_t* receivedFrom) {
|
MessageQueueId_t* receivedFrom) {
|
||||||
ReturnValue_t status = this->receiveMessage(message);
|
ReturnValue_t status = this->receiveMessage(message);
|
||||||
if(status == HasReturnvaluesIF::RETURN_OK) {
|
if(status == HasReturnvaluesIF::RETURN_OK) {
|
||||||
@ -57,7 +57,7 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) {
|
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessage* message) {
|
||||||
if(messageQueue.empty()) {
|
if(messageQueue.empty()) {
|
||||||
return MessageQueueIF::EMPTY;
|
return MessageQueueIF::EMPTY;
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ bool MessageQueue::isDefaultDestinationSet() const {
|
|||||||
|
|
||||||
// static core function to send messages.
|
// static core function to send messages.
|
||||||
ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
MessageQueueMessage* message, MessageQueueId_t sentFrom,
|
||||||
bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
if(message->getMessageSize() > message->getMaximumMessageSize()) {
|
if(message->getMessageSize() > message->getMaximumMessageSize()) {
|
||||||
// Actually, this should never happen or an error will be emitted
|
// Actually, this should never happen or an error will be emitted
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
* is not incremented if queue is full.
|
* is not incremented if queue is full.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, bool ignoreFault = false) override;
|
MessageQueueMessage* message, bool ignoreFault = false) override;
|
||||||
/**
|
/**
|
||||||
* @brief This operation sends a message to the default destination.
|
* @brief This operation sends a message to the default destination.
|
||||||
* @details As in the sendMessage method, this function uses the
|
* @details As in the sendMessage method, this function uses the
|
||||||
@ -85,7 +85,7 @@ public:
|
|||||||
* queue id as "sentFrom" information.
|
* queue id as "sentFrom" information.
|
||||||
* @param message A pointer to a previously created message, which is sent.
|
* @param message A pointer to a previously created message, which is sent.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t sendToDefault(MessageQueueMessageIF* message) override;
|
ReturnValue_t sendToDefault(MessageQueueMessage* message) override;
|
||||||
/**
|
/**
|
||||||
* @brief This operation sends a message to the last communication partner.
|
* @brief This operation sends a message to the last communication partner.
|
||||||
* @details This operation simplifies answering an incoming message by using
|
* @details This operation simplifies answering an incoming message by using
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
* message received yet (i.e. lastPartner is zero), an error code is returned.
|
* message received yet (i.e. lastPartner is zero), an error code is returned.
|
||||||
* @param message A pointer to a previously created message, which is sent.
|
* @param message A pointer to a previously created message, which is sent.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t reply(MessageQueueMessageIF* message) override;
|
ReturnValue_t reply(MessageQueueMessage* message) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief With the sendMessage call, a queue message is sent to a
|
* @brief With the sendMessage call, a queue message is sent to a
|
||||||
@ -113,7 +113,7 @@ public:
|
|||||||
* is not incremented if queue is full.
|
* is not incremented if queue is full.
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t sendMessageFrom( MessageQueueId_t sendTo,
|
virtual ReturnValue_t sendMessageFrom( MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, MessageQueueId_t sentFrom = NO_QUEUE,
|
MessageQueueMessage* message, MessageQueueId_t sentFrom = NO_QUEUE,
|
||||||
bool ignoreFault = false) override;
|
bool ignoreFault = false) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,7 +127,7 @@ public:
|
|||||||
* sender's queue id into the message. This variable is set to zero by
|
* sender's queue id into the message. This variable is set to zero by
|
||||||
* default.
|
* default.
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t sendToDefaultFrom( MessageQueueMessageIF* message,
|
virtual ReturnValue_t sendToDefaultFrom( MessageQueueMessage* message,
|
||||||
MessageQueueId_t sentFrom = NO_QUEUE,
|
MessageQueueId_t sentFrom = NO_QUEUE,
|
||||||
bool ignoreFault = false) override;
|
bool ignoreFault = false) override;
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ public:
|
|||||||
* @param message A pointer to a message in which the received data is stored.
|
* @param message A pointer to a message in which the received data is stored.
|
||||||
* @param receivedFrom A pointer to a queue id in which the sender's id is stored.
|
* @param receivedFrom A pointer to a queue id in which the sender's id is stored.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t receiveMessage(MessageQueueMessageIF* message,
|
ReturnValue_t receiveMessage(MessageQueueMessage* message,
|
||||||
MessageQueueId_t *receivedFrom) override;
|
MessageQueueId_t *receivedFrom) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
* function returns immediately.
|
* function returns immediately.
|
||||||
* @param message A pointer to a message in which the received data is stored.
|
* @param message A pointer to a message in which the received data is stored.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t receiveMessage(MessageQueueMessageIF* message) override;
|
ReturnValue_t receiveMessage(MessageQueueMessage* message) override;
|
||||||
/**
|
/**
|
||||||
* Deletes all pending messages in the queue.
|
* Deletes all pending messages in the queue.
|
||||||
* @param count The number of flushed messages.
|
* @param count The number of flushed messages.
|
||||||
@ -206,7 +206,7 @@ protected:
|
|||||||
* @param context Specify whether call is made from task or from an ISR.
|
* @param context Specify whether call is made from task or from an ISR.
|
||||||
*/
|
*/
|
||||||
static ReturnValue_t sendMessageFromMessageQueue(MessageQueueId_t sendTo,
|
static ReturnValue_t sendMessageFromMessageQueue(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, MessageQueueId_t sentFrom = NO_QUEUE,
|
MessageQueueMessage* message, MessageQueueId_t sentFrom = NO_QUEUE,
|
||||||
bool ignoreFault=false);
|
bool ignoreFault=false);
|
||||||
|
|
||||||
//static ReturnValue_t handleSendResult(BaseType_t result, bool ignoreFault);
|
//static ReturnValue_t handleSendResult(BaseType_t result, bool ignoreFault);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "../../ipc/QueueFactory.h"
|
#include "../../ipc/QueueFactory.h"
|
||||||
|
#include "../../ipc/MessageQueueSenderIF.h"
|
||||||
#include "../../osal/host/MessageQueue.h"
|
#include "../../osal/host/MessageQueue.h"
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -7,11 +8,10 @@ QueueFactory* QueueFactory::factoryInstance = nullptr;
|
|||||||
|
|
||||||
|
|
||||||
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
MessageQueueMessage* message, MessageQueueId_t sentFrom,
|
||||||
bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
return MessageQueue::sendMessageFromMessageQueue(sendTo,message,
|
return MessageQueue::sendMessageFromMessageQueue(sendTo,message,
|
||||||
sentFrom,ignoreFault);
|
sentFrom,ignoreFault);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QueueFactory* QueueFactory::instance() {
|
QueueFactory* QueueFactory::instance() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user