WIP: somethings wrong.. #19

Closed
muellerr wants to merge 808 commits from source/master into master
8 changed files with 25 additions and 17 deletions
Showing only changes of commit 5734a0a0e9 - Show all commits

View File

@ -101,7 +101,8 @@ 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);
} }

View File

@ -117,7 +117,8 @@ 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;
} }

View File

@ -15,7 +15,7 @@ public:
* Must be implemented by a subclass. * Must be implemented by a subclass.
*/ */
static ReturnValue_t sendMessage(MessageQueueId_t sendTo, static ReturnValue_t sendMessage(MessageQueueId_t sendTo,
MessageQueueMessageIF* message, MessageQueueMessageIF* message, size_t maxMessageSize,
MessageQueueId_t sentFrom = MessageQueueMessageIF::NO_QUEUE, MessageQueueId_t sentFrom = MessageQueueMessageIF::NO_QUEUE,
bool ignoreFault=false); bool ignoreFault=false);
private: private:

View File

@ -34,7 +34,8 @@ 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() {

View File

@ -50,7 +50,7 @@ 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, sentFrom, return sendMessageFromMessageQueue(sendTo, message, maxMessageSize, sentFrom,
ignoreFault, callContext); ignoreFault, callContext);
} }
@ -121,11 +121,11 @@ 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, MessageQueueMessageIF* message, size_t maxSize,
bool ignoreFault, CallContext callContext) { MessageQueueId_t sentFrom, bool ignoreFault, CallContext callContext) {
message->setSender(sentFrom); message->setSender(sentFrom);
BaseType_t result; BaseType_t result;
if(message->getMaximumMessageSize() > maxMessageSize) { if(message->getMaximumMessageSize() > maxSize) {
sif::error << "MessageQueue::sendMessageFromMessageQueue: Message size" sif::error << "MessageQueue::sendMessageFromMessageQueue: Message size"
"too large for queue!" << std::endl; "too large for queue!" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;

View File

@ -194,8 +194,9 @@ 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, MessageQueueMessageIF* message, size_t maxSize,
bool ignoreFault=false, CallContext callContext = CallContext::TASK); MessageQueueId_t sentFrom = NO_QUEUE, bool ignoreFault=false,
CallContext callContext = CallContext::TASK);
static ReturnValue_t handleSendResult(BaseType_t result, bool ignoreFault); static ReturnValue_t handleSendResult(BaseType_t result, bool ignoreFault);

View File

@ -7,9 +7,9 @@ QueueFactory* QueueFactory::factoryInstance = nullptr;
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo, ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
MessageQueueMessageIF* message, MessageQueueId_t sentFrom, MessageQueueMessageIF* message, size_t maxSize,
bool ignoreFault) { MessageQueueId_t sentFrom, bool ignoreFault) {
return MessageQueue::sendMessageFromMessageQueue(sendTo,message, return MessageQueue::sendMessageFromMessageQueue(sendTo,message, maxSize,
sentFrom,ignoreFault); sentFrom,ignoreFault);
} }

View File

@ -22,7 +22,8 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id,
current_packet->getAcknowledgeFlags(), current_packet->getAcknowledgeFlags(),
current_packet->getPacketId(), current_packet->getPacketId(),
current_packet->getPacketSequenceControl(), 0, set_step); current_packet->getPacketSequenceControl(), 0, set_step);
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
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;
@ -37,7 +38,8 @@ 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, &message); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
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;
@ -55,7 +57,8 @@ void VerificationReporter::sendFailureReport(uint8_t report_id,
current_packet->getPacketId(), current_packet->getPacketId(),
current_packet->getPacketSequenceControl(), error_code, step, current_packet->getPacketSequenceControl(), error_code, step,
parameter1, parameter2); parameter1, parameter2);
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
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: "
@ -72,7 +75,8 @@ 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, &message); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue,
&message, MessageQueueMessage::MAX_MESSAGE_SIZE);
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: "