diff --git a/ipc/CommandMessage.cpp b/ipc/CommandMessage.cpp index e1d4dfae..0aeaa79a 100644 --- a/ipc/CommandMessage.cpp +++ b/ipc/CommandMessage.cpp @@ -84,9 +84,8 @@ void CommandMessage::setToUnknownCommand() { void CommandMessage::setReplyRejected(ReturnValue_t reason, Command_t initialCommand) { - std::memcpy(getData(), &reason, sizeof(reason)); - std::memcpy(getData() + sizeof(reason), &initialCommand, - sizeof(initialCommand)); + setParameter(reason); + setParameter2(initialCommand); } ReturnValue_t CommandMessage::getReplyRejectedReason( diff --git a/osal/host/FixedTimeslotTask.cpp b/osal/host/FixedTimeslotTask.cpp index 48d11843..dac399f6 100644 --- a/osal/host/FixedTimeslotTask.cpp +++ b/osal/host/FixedTimeslotTask.cpp @@ -92,7 +92,7 @@ ReturnValue_t FixedTimeslotTask::sleepFor(uint32_t ms) { void FixedTimeslotTask::taskFunctionality() { // A local iterator for the Polling Sequence Table is created to // find the start time for the first entry. - SlotListIter slotListIter = pollingSeqTable.current; + FixedSlotSequence::SlotListIter slotListIter = pollingSeqTable.current; // Get start time for first entry. chron_ms interval(slotListIter->pollingTimeMs); auto currentStartTime { diff --git a/osal/host/QueueMapManager.h b/osal/host/QueueMapManager.h index 34f0fc95..499b1622 100644 --- a/osal/host/QueueMapManager.h +++ b/osal/host/QueueMapManager.h @@ -36,7 +36,7 @@ public: private: //! External instantiation is forbidden. QueueMapManager(); - std::atomic queueCounter = MessageQueueIF::NO_QUEUE + 1; + std::atomic queueCounter = 1; MutexIF* mapLock; QueueMap queueMap; static QueueMapManager* mqManagerInstance; diff --git a/tasks/ExecutableObjectIF.h b/tasks/ExecutableObjectIF.h index 516b4084..f66b53da 100644 --- a/tasks/ExecutableObjectIF.h +++ b/tasks/ExecutableObjectIF.h @@ -43,9 +43,18 @@ public: * a reference to the executing task * @param task_ Pointer to the taskIF of this task */ - virtual void setTaskIF(PeriodicTaskIF* task_) { + virtual void setTaskIF(PeriodicTaskIF* task_) {}; - } + /** + * This function will be called after the object was assigned to a specific + * task. + * + * Example: Can be used to get task execution frequency. + * The task is created after initialize() and the object ctors have been + * called so the execution frequency can't be cached in initialize() + * @return + */ + //virtual ReturnValue_t initializeAfterTaskCreation() = 0; }; #endif /* EXECUTABLEOBJECTIF_H_ */ diff --git a/tasks/FixedSequenceSlot.cpp b/tasks/FixedSequenceSlot.cpp index c46b4fc0..430ce019 100644 --- a/tasks/FixedSequenceSlot.cpp +++ b/tasks/FixedSequenceSlot.cpp @@ -9,6 +9,7 @@ FixedSequenceSlot::FixedSequenceSlot(object_id_t handlerId, uint32_t setTime, if(executingTask != nullptr) { handler->setTaskIF(executingTask); } + //handler->initializeAfterTaskCreation(); } FixedSequenceSlot::~FixedSequenceSlot() {} diff --git a/tmtcservices/CommandingServiceBase.cpp b/tmtcservices/CommandingServiceBase.cpp index acf66389..5a48bd63 100644 --- a/tmtcservices/CommandingServiceBase.cpp +++ b/tmtcservices/CommandingServiceBase.cpp @@ -109,8 +109,8 @@ void CommandingServiceBase::handleCommandMessage(CommandMessage* reply) { * command as failure parameter 1 */ if(reply->getCommand() == CommandMessage::REPLY_REJECTED and result == RETURN_FAILED) { - result = reply->getReplyRejectedReason( - reinterpret_cast(&failureParameter1)); + result = reply->getReplyRejectedReason(); + failureParameter1 = iter->command; } switch (result) {