reverted some changes
This commit is contained in:
parent
56455a5fa2
commit
905c1a92e3
@ -101,8 +101,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo,
|
|||||||
|
|
||||||
//TODO Service Implementation sucks at the moment
|
//TODO Service Implementation sucks at the moment
|
||||||
if (hideSender){
|
if (hideSender){
|
||||||
result = MessageQueueSenderIF::sendMessage(reportTo, &reply,
|
result = MessageQueueSenderIF::sendMessage(reportTo, &reply);
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE);
|
|
||||||
} else {
|
} else {
|
||||||
result = queueToUse->sendMessage(reportTo, &reply);
|
result = queueToUse->sendMessage(reportTo, &reply);
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,7 @@ ReturnValue_t MapPacketExtraction::sendCompletePacket(uint8_t* data,
|
|||||||
ReturnValue_t status = this->packetStore->addData(&store_id, data, size);
|
ReturnValue_t status = this->packetStore->addData(&store_id, data, size);
|
||||||
if (status == RETURN_OK) {
|
if (status == RETURN_OK) {
|
||||||
TmTcMessage message(store_id);
|
TmTcMessage message(store_id);
|
||||||
status = MessageQueueSenderIF::sendMessage(tcQueueId,&message,
|
status = MessageQueueSenderIF::sendMessage(tcQueueId,&message);
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE);
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ void EventManager::notifyListeners(EventMessage* message) {
|
|||||||
for (auto iter = listenerList.begin(); iter != listenerList.end(); ++iter) {
|
for (auto iter = listenerList.begin(); iter != listenerList.end(); ++iter) {
|
||||||
if (iter->second.match(message)) {
|
if (iter->second.match(message)) {
|
||||||
MessageQueueSenderIF::sendMessage(iter->first, message,
|
MessageQueueSenderIF::sendMessage(iter->first, message,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE,
|
|
||||||
message->getSender());
|
message->getSender());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,7 @@ public:
|
|||||||
eventmanagerQueue = eventmanager->getEventReportQueue();
|
eventmanagerQueue = eventmanager->getEventReportQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MessageQueueSenderIF::sendMessage(eventmanagerQueue, message,
|
MessageQueueSenderIF::sendMessage(eventmanagerQueue, message, sentFrom);
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE, sentFrom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -70,7 +70,6 @@ void HealthHelper::informParent(HasHealthIF::HealthState health,
|
|||||||
HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO,
|
HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO,
|
||||||
health, oldHealth);
|
health, oldHealth);
|
||||||
if (MessageQueueSenderIF::sendMessage(parentQueue, &information,
|
if (MessageQueueSenderIF::sendMessage(parentQueue, &information,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE,
|
|
||||||
owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) {
|
owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "HealthHelper::informParent: sending health reply failed."
|
sif::debug << "HealthHelper::informParent: sending health reply failed."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -91,7 +90,6 @@ void HealthHelper::handleSetHealthCommand(CommandMessage* command) {
|
|||||||
reply.setReplyRejected(result, command->getCommand());
|
reply.setReplyRejected(result, command->getCommand());
|
||||||
}
|
}
|
||||||
if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE,
|
|
||||||
owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) {
|
owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::debug << "HealthHelper::handleHealthCommand: sending health "
|
sif::debug << "HealthHelper::handleHealthCommand: sending health "
|
||||||
"reply failed." << std::endl;
|
"reply failed." << std::endl;
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
HousekeepingMessage::HousekeepingMessage(MessageQueueMessageIF* message):
|
HousekeepingMessage::HousekeepingMessage(MessageQueueMessageIF* message):
|
||||||
CommandMessageBase(message) {
|
CommandMessageBase(message) {
|
||||||
if(message->getMaximumMessageSize() < HK_MESSAGE_SIZE) {
|
if(message->getMessageSize() < HK_MESSAGE_SIZE) {
|
||||||
sif::error << "HousekeepingMessage::HousekeepingMessage: Passed "
|
sif::error << "HousekeepingMessage::HousekeepingMessage: Passed "
|
||||||
"message buffer can not hold minimum " << HK_MESSAGE_SIZE
|
"message buffer can not hold minimum " << HK_MESSAGE_SIZE
|
||||||
<< " bytes!" << std::endl;
|
<< " bytes!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
message->setMessageSize(HK_MESSAGE_SIZE);
|
//message->setMessageSize(HK_MESSAGE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
HousekeepingMessage::~HousekeepingMessage() {}
|
HousekeepingMessage::~HousekeepingMessage() {}
|
||||||
@ -38,9 +38,9 @@ void HousekeepingMessage::setHkDiagnosticsMessage(sid_t sid,
|
|||||||
setParameter(storeId.raw);
|
setParameter(storeId.raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t HousekeepingMessage::getMinimumMessageSize() const {
|
//size_t HousekeepingMessage::getMinimumMessageSize() const {
|
||||||
return HK_MESSAGE_SIZE;
|
// return HK_MESSAGE_SIZE;
|
||||||
}
|
//}
|
||||||
|
|
||||||
sid_t HousekeepingMessage::getSid() const {
|
sid_t HousekeepingMessage::getSid() const {
|
||||||
sid_t sid;
|
sid_t sid;
|
||||||
|
@ -104,7 +104,7 @@ public:
|
|||||||
//! to distinguish between diagnostics and regular HK packets
|
//! to distinguish between diagnostics and regular HK packets
|
||||||
sid_t getHkReportMessage(store_address_t * storeIdToSet) const;
|
sid_t getHkReportMessage(store_address_t * storeIdToSet) const;
|
||||||
|
|
||||||
virtual size_t getMinimumMessageSize() const override;
|
//virtual size_t getMinimumMessageSize() const override;
|
||||||
virtual void clear() override;
|
virtual void clear() override;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -9,14 +9,14 @@ CommandMessage::CommandMessage(MessageQueueMessageIF* receiverMessage):
|
|||||||
" message!" << std::endl;
|
" message!" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(receiverMessage->getMaximumMessageSize() <
|
// if(receiverMessage->getMessageSize() <
|
||||||
getMinimumMessageSize()) {
|
// getMinimumMessageSize()) {
|
||||||
sif::error << "CommandMessage::ComandMessage: Passed message buffer"
|
// sif::error << "CommandMessage::ComandMessage: Passed message buffer"
|
||||||
" can not hold minimum "<< getMinimumMessageSize()
|
// " can not hold minimum "<< getMinimumMessageSize()
|
||||||
<< " bytes!" << std::endl;
|
// << " bytes!" << std::endl;
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
internalMessage->setMessageSize(getMinimumMessageSize());
|
// internalMessage->setMessageSize(getMinimumMessageSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandMessage::CommandMessage(MessageQueueMessageIF* messageToSet,
|
CommandMessage::CommandMessage(MessageQueueMessageIF* messageToSet,
|
||||||
@ -49,9 +49,9 @@ void CommandMessage::setParameter2(uint32_t parameter2) {
|
|||||||
sizeof(parameter2));
|
sizeof(parameter2));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CommandMessage::getMinimumMessageSize() const {
|
//size_t CommandMessage::getMinimumMessageSize() const {
|
||||||
return MINIMUM_COMMAND_MESSAGE_SIZE;
|
// return MINIMUM_COMMAND_MESSAGE_SIZE;
|
||||||
}
|
//}
|
||||||
|
|
||||||
bool CommandMessage::isClearedCommandMessage() {
|
bool CommandMessage::isClearedCommandMessage() {
|
||||||
return getCommand() == CMD_NONE;
|
return getCommand() == CMD_NONE;
|
||||||
|
@ -54,7 +54,7 @@ public:
|
|||||||
virtual ~CommandMessage() {}
|
virtual ~CommandMessage() {}
|
||||||
|
|
||||||
/** MessageQueueMessageIF functions used for minimum size check. */
|
/** MessageQueueMessageIF functions used for minimum size check. */
|
||||||
size_t getMinimumMessageSize() const override;
|
//size_t getMinimumMessageSize() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the first parameter of the message
|
* Get the first parameter of the message
|
||||||
|
@ -47,25 +47,21 @@ const uint8_t* CommandMessageBase::getData() const {
|
|||||||
return internalMessage->getData() + sizeof(Command_t);
|
return internalMessage->getData() + sizeof(Command_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandMessageBase::setMessageSize(size_t messageSize) {
|
//void CommandMessageBase::setMessageSize(size_t messageSize) {
|
||||||
internalMessage->setMessageSize(messageSize);
|
// //internalMessage->setMessageSize(messageSize);
|
||||||
}
|
//}
|
||||||
|
|
||||||
size_t CommandMessageBase::getMessageSize() const {
|
size_t CommandMessageBase::getMessageSize() const {
|
||||||
return internalMessage->getMessageSize();
|
return internalMessage->getMessageSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CommandMessageBase::getMaximumMessageSize() const {
|
|
||||||
return internalMessage->getMaximumMessageSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageQueueMessageIF* CommandMessageBase::getInternalMessage() const {
|
MessageQueueMessageIF* CommandMessageBase::getInternalMessage() const {
|
||||||
return internalMessage;
|
return internalMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CommandMessageBase::getMinimumMessageSize() const {
|
//size_t CommandMessageBase::getMinimumMessageSize() const {
|
||||||
return MINIMUM_COMMAND_MESSAGE_BASE_SIZE;
|
// return MINIMUM_COMMAND_MESSAGE_BASE_SIZE;
|
||||||
}
|
//}
|
||||||
|
|
||||||
void CommandMessageBase::setReplyRejected(ReturnValue_t reason,
|
void CommandMessageBase::setReplyRejected(ReturnValue_t reason,
|
||||||
Command_t initialCommand) {
|
Command_t initialCommand) {
|
||||||
|
@ -63,15 +63,8 @@ public:
|
|||||||
virtual MessageQueueId_t getSender() const override;
|
virtual MessageQueueId_t getSender() const override;
|
||||||
virtual uint8_t * getData() override;
|
virtual uint8_t * getData() override;
|
||||||
virtual const uint8_t* getData() const override;
|
virtual const uint8_t* getData() const override;
|
||||||
virtual void setMessageSize(size_t messageSize) override;
|
|
||||||
virtual size_t getMessageSize() const override;
|
virtual size_t getMessageSize() const override;
|
||||||
|
|
||||||
//! This depends on the maximum message size of the passed internal message.
|
|
||||||
virtual size_t getMaximumMessageSize() const override;
|
|
||||||
|
|
||||||
//! Return the constant minimum message size.
|
|
||||||
virtual size_t getMinimumMessageSize() const override;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command message can be rejected and needs to offer a function
|
* A command message can be rejected and needs to offer a function
|
||||||
* to set a rejected reply
|
* to set a rejected reply
|
||||||
|
@ -51,9 +51,9 @@ void MessageQueueMessage::setSender(MessageQueueId_t setId) {
|
|||||||
memcpy(this->internalBuffer, &setId, sizeof(MessageQueueId_t));
|
memcpy(this->internalBuffer, &setId, sizeof(MessageQueueId_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t MessageQueueMessage::getMinimumMessageSize() const {
|
//size_t MessageQueueMessage::getMinimumMessageSize() const {
|
||||||
return this->HEADER_SIZE;
|
// return this->HEADER_SIZE;
|
||||||
}
|
//}
|
||||||
|
|
||||||
void MessageQueueMessage::print() {
|
void MessageQueueMessage::print() {
|
||||||
sif::debug << "MessageQueueMessage has size: " << this->messageSize <<
|
sif::debug << "MessageQueueMessage has size: " << this->messageSize <<
|
||||||
@ -69,13 +69,9 @@ void MessageQueueMessage::clear() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t MessageQueueMessage::getMessageSize() const {
|
size_t MessageQueueMessage::getMessageSize() const {
|
||||||
return this->messageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t MessageQueueMessage::getMaximumMessageSize() const {
|
|
||||||
return this->MAX_MESSAGE_SIZE;
|
return this->MAX_MESSAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageQueueMessage::setMessageSize(size_t messageSize) {
|
//void MessageQueueMessage::setMessageSize(size_t messageSize) {
|
||||||
this->messageSize = messageSize;
|
// this->messageSize = messageSize;
|
||||||
}
|
//}
|
||||||
|
@ -139,20 +139,8 @@ public:
|
|||||||
* The message queue id that identifies the sending message queue.
|
* The message queue id that identifies the sending message queue.
|
||||||
*/
|
*/
|
||||||
void setSender(MessageQueueId_t setId) override;
|
void setSender(MessageQueueId_t setId) override;
|
||||||
/**
|
|
||||||
* @brief This helper function is used by the MessageQueue class to check
|
|
||||||
* the size of an incoming message.
|
|
||||||
* @details
|
|
||||||
* The method must be overwritten by child classes if size
|
|
||||||
* checks shall be more strict.
|
|
||||||
* @return The default implementation returns HEADER_SIZE.
|
|
||||||
*/
|
|
||||||
virtual size_t getMinimumMessageSize() const override;
|
|
||||||
|
|
||||||
virtual size_t getMessageSize() const override;
|
virtual size_t getMessageSize() const override;
|
||||||
virtual void setMessageSize(size_t messageSize) override;
|
|
||||||
|
|
||||||
virtual size_t getMaximumMessageSize() const override;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is a debug method that prints the content
|
* @brief This is a debug method that prints the content
|
||||||
|
@ -68,23 +68,11 @@ public:
|
|||||||
virtual uint8_t* getData() = 0;
|
virtual uint8_t* getData() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This helper function is used by the MessageQueue class to
|
* Get constant message size of current message implementation.
|
||||||
* check the size of an incoming message.
|
|
||||||
*/
|
|
||||||
virtual size_t getMinimumMessageSize() const = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get message size of current message implementation.
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual size_t getMessageSize() const = 0;
|
virtual size_t getMessageSize() const = 0;
|
||||||
virtual void setMessageSize(size_t messageSize) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get maximum allowed size of current message implementation.
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
virtual size_t getMaximumMessageSize() const = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,17 +10,16 @@ public:
|
|||||||
virtual ~MessageQueueSenderIF() {}
|
virtual ~MessageQueueSenderIF() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows sending messages without actually "owing" a message queue.
|
* Allows sending messages without actually "owning" a message queue.
|
||||||
* Not sure whether this is actually a good idea.
|
* Not sure whether this is actually a good idea.
|
||||||
*/
|
*/
|
||||||
static ReturnValue_t sendMessage(MessageQueueId_t sendTo,
|
static ReturnValue_t sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, size_t maxMessageSize,
|
MessageQueueMessageIF* message,
|
||||||
MessageQueueId_t sentFrom = MessageQueueMessageIF::NO_QUEUE,
|
MessageQueueId_t sentFrom = MessageQueueMessageIF::NO_QUEUE,
|
||||||
bool ignoreFault=false);
|
bool ignoreFault = false);
|
||||||
private:
|
private:
|
||||||
MessageQueueSenderIF() {}
|
MessageQueueSenderIF() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* FRAMEWORK_IPC_MESSAGEQUEUESENDERIF_H_ */
|
#endif /* FRAMEWORK_IPC_MESSAGEQUEUESENDERIF_H_ */
|
||||||
|
@ -28,7 +28,6 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* command) {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
ModeMessage::cantReachMode(&reply, result);
|
ModeMessage::cantReachMode(&reply, result);
|
||||||
MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE,
|
|
||||||
owner->getCommandQueue());
|
owner->getCommandQueue());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -51,7 +50,6 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* command) {
|
|||||||
ModeMessage::setModeMessage(&reply, ModeMessage::REPLY_MODE_REPLY, mode,
|
ModeMessage::setModeMessage(&reply, ModeMessage::REPLY_MODE_REPLY, mode,
|
||||||
submode);
|
submode);
|
||||||
MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE,
|
|
||||||
owner->getCommandQueue());
|
owner->getCommandQueue());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -97,7 +95,7 @@ void ModeHelper::sendModeReplyMessage(Mode_t ownerMode,
|
|||||||
ownerMode, ownerSubmode);
|
ownerMode, ownerSubmode);
|
||||||
}
|
}
|
||||||
MessageQueueSenderIF::sendMessage(theOneWhoCommandedAMode, &reply,
|
MessageQueueSenderIF::sendMessage(theOneWhoCommandedAMode, &reply,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE, owner->getCommandQueue());
|
owner->getCommandQueue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +109,6 @@ void ModeHelper::sendModeInfoMessage(Mode_t ownerMode,
|
|||||||
ModeMessage::setModeMessage(&reply, ModeMessage::REPLY_MODE_INFO,
|
ModeMessage::setModeMessage(&reply, ModeMessage::REPLY_MODE_INFO,
|
||||||
ownerMode, ownerSubmode);
|
ownerMode, ownerSubmode);
|
||||||
MessageQueueSenderIF::sendMessage(parentQueueId, &reply,
|
MessageQueueSenderIF::sendMessage(parentQueueId, &reply,
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE,
|
|
||||||
owner->getCommandQueue());
|
owner->getCommandQueue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,7 @@ ReturnValue_t LimitViolationReporter::sendLimitViolationReport(const SerializeIF
|
|||||||
MessageQueueMessage message;
|
MessageQueueMessage message;
|
||||||
CommandMessage report(&message);
|
CommandMessage report(&message);
|
||||||
MonitoringMessage::setLimitViolationReport(&report, storeId);
|
MonitoringMessage::setLimitViolationReport(&report, storeId);
|
||||||
return MessageQueueSenderIF::sendMessage(reportQueue, &report,
|
return MessageQueueSenderIF::sendMessage(reportQueue, &report);
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t LimitViolationReporter::checkClassLoaded() {
|
ReturnValue_t LimitViolationReporter::checkClassLoaded() {
|
||||||
|
@ -50,8 +50,8 @@ 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,
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
||||||
bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
return sendMessageFromMessageQueue(sendTo, message, maxMessageSize, sentFrom,
|
return sendMessageFromMessageQueue(sendTo, message, sentFrom, ignoreFault,
|
||||||
ignoreFault, callContext);
|
callContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,9 +80,9 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) {
|
ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) {
|
||||||
if(message->getMaximumMessageSize() < maxMessageSize) {
|
if(message->getMessageSize() < maxMessageSize) {
|
||||||
sif::error << "MessageQueue::receiveMessage: Message size "
|
sif::error << "MessageQueue::receiveMessage: Message size "
|
||||||
<< message->getMaximumMessageSize() <<
|
<< message->getMessageSize() <<
|
||||||
" too small to receive data!" << std::endl;
|
" too small to receive data!" << std::endl;
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
@ -127,17 +127,10 @@ 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, size_t maxSize,
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
||||||
MessageQueueId_t sentFrom, bool ignoreFault, CallContext callContext) {
|
bool ignoreFault, CallContext callContext) {
|
||||||
message->setSender(sentFrom);
|
message->setSender(sentFrom);
|
||||||
BaseType_t result;
|
BaseType_t result;
|
||||||
if(message->getMaximumMessageSize() > maxSize) {
|
|
||||||
sif::error << "MessageQueue::sendMessageFromMessageQueue: Message size "
|
|
||||||
<< message->getMaximumMessageSize() << " too large for queue"
|
|
||||||
" with max. message size " << maxSize << "!"
|
|
||||||
<< std::endl;
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(callContext == CallContext::TASK) {
|
if(callContext == CallContext::TASK) {
|
||||||
result = xQueueSendToBack(reinterpret_cast<QueueHandle_t>(sendTo),
|
result = xQueueSendToBack(reinterpret_cast<QueueHandle_t>(sendTo),
|
||||||
|
@ -194,9 +194,8 @@ 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, size_t maxSize,
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom = NO_QUEUE,
|
||||||
MessageQueueId_t sentFrom = NO_QUEUE, bool ignoreFault=false,
|
bool ignoreFault=false, CallContext callContext = CallContext::TASK);
|
||||||
CallContext callContext = CallContext::TASK);
|
|
||||||
|
|
||||||
static ReturnValue_t handleSendResult(BaseType_t result, bool ignoreFault);
|
static ReturnValue_t handleSendResult(BaseType_t result, bool ignoreFault);
|
||||||
|
|
||||||
|
@ -7,14 +7,9 @@ QueueFactory* QueueFactory::factoryInstance = nullptr;
|
|||||||
|
|
||||||
|
|
||||||
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
||||||
MessageQueueMessageIF* message, size_t maxSize,
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
||||||
MessageQueueId_t sentFrom, bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
if(maxSize == 0) {
|
return MessageQueue::sendMessageFromMessageQueue(sendTo,message,
|
||||||
sif::error << "MessageQueueSenderIF::sendMessage: Max Size is 0!"
|
|
||||||
<< std::endl;
|
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
}
|
|
||||||
return MessageQueue::sendMessageFromMessageQueue(sendTo,message, maxSize,
|
|
||||||
sentFrom,ignoreFault);
|
sentFrom,ignoreFault);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +107,7 @@ ReturnValue_t ParameterHelper::sendParameter(MessageQueueId_t to, uint32_t id,
|
|||||||
|
|
||||||
ParameterMessage::setParameterDumpReply(&reply, id, address);
|
ParameterMessage::setParameterDumpReply(&reply, id, address);
|
||||||
|
|
||||||
MessageQueueSenderIF::sendMessage(to, &reply,
|
MessageQueueSenderIF::sendMessage(to, &reply, ownerQueueId);
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE, ownerQueueId);
|
|
||||||
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
@ -130,6 +129,5 @@ void ParameterHelper::rejectCommand(MessageQueueId_t to, ReturnValue_t reason,
|
|||||||
MessageQueueMessage message;
|
MessageQueueMessage message;
|
||||||
CommandMessage reply(&message);
|
CommandMessage reply(&message);
|
||||||
reply.setReplyRejected(reason, initialCommand);
|
reply.setReplyRejected(reason, initialCommand);
|
||||||
MessageQueueSenderIF::sendMessage(to, &reply,
|
MessageQueueSenderIF::sendMessage(to, &reply, ownerQueueId);
|
||||||
MessageQueueMessage::MAX_MESSAGE_SIZE, ownerQueueId);
|
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ ReturnValue_t TmPacketStored::sendPacket(MessageQueueId_t destination,
|
|||||||
}
|
}
|
||||||
TmTcMessage tmMessage(getStoreAddress());
|
TmTcMessage tmMessage(getStoreAddress());
|
||||||
ReturnValue_t result = MessageQueueSenderIF::sendMessage(destination,
|
ReturnValue_t result = MessageQueueSenderIF::sendMessage(destination,
|
||||||
&tmMessage, MessageQueueMessage::MAX_MESSAGE_SIZE, sentFrom);
|
&tmMessage, sentFrom);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
deletePacket();
|
deletePacket();
|
||||||
if (doErrorReporting) {
|
if (doErrorReporting) {
|
||||||
|
@ -23,7 +23,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
|||||||
current_packet->getPacketId(),
|
current_packet->getPacketId(),
|
||||||
current_packet->getPacketSequenceControl(), 0, set_step);
|
current_packet->getPacketSequenceControl(), 0, set_step);
|
||||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||||
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
&message);
|
||||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "VerificationReporter::sendSuccessReport: Error writing "
|
sif::error << "VerificationReporter::sendSuccessReport: Error writing "
|
||||||
"to queue. Code: " << std::hex << (uint16_t) status << std::endl;
|
"to queue. Code: " << std::hex << (uint16_t) status << std::endl;
|
||||||
@ -39,7 +39,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
|
|||||||
PusVerificationMessage message(set_report_id, ackFlags, tcPacketId,
|
PusVerificationMessage message(set_report_id, ackFlags, tcPacketId,
|
||||||
tcSequenceControl, 0, set_step);
|
tcSequenceControl, 0, set_step);
|
||||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||||
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
&message);
|
||||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error << "VerificationReporter::sendSuccessReport: Error writing "
|
sif::error << "VerificationReporter::sendSuccessReport: Error writing "
|
||||||
"to queue. Code: " << std::hex << (uint16_t) status << std::endl;
|
"to queue. Code: " << std::hex << (uint16_t) status << std::endl;
|
||||||
@ -58,7 +58,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id,
|
|||||||
current_packet->getPacketSequenceControl(), error_code, step,
|
current_packet->getPacketSequenceControl(), error_code, step,
|
||||||
parameter1, parameter2);
|
parameter1, parameter2);
|
||||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||||
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
&message);
|
||||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error
|
sif::error
|
||||||
<< "VerificationReporter::sendFailureReport Error writing to queue. Code: "
|
<< "VerificationReporter::sendFailureReport Error writing to queue. Code: "
|
||||||
@ -76,7 +76,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id,
|
|||||||
PusVerificationMessage message(report_id, ackFlags, tcPacketId,
|
PusVerificationMessage message(report_id, ackFlags, tcPacketId,
|
||||||
tcSequenceControl, error_code, step, parameter1, parameter2);
|
tcSequenceControl, error_code, step, parameter1, parameter2);
|
||||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
|
||||||
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
&message);
|
||||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||||
sif::error
|
sif::error
|
||||||
<< "VerificationReporter::sendFailureReport Error writing to queue. Code: "
|
<< "VerificationReporter::sendFailureReport Error writing to queue. Code: "
|
||||||
|
Loading…
Reference in New Issue
Block a user