update event mngr printout

This commit is contained in:
Robin Müller 2022-02-18 13:39:42 +01:00
parent bd05afbddd
commit a12e98d948
5 changed files with 27 additions and 8 deletions

View File

@ -52,10 +52,12 @@ void EventManager::notifyListeners(EventMessage* message) {
MessageQueueSenderIF::sendMessage(listener.first, message, message->getSender());
if (result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Sending message to listener failed with result " << std::hex << std::setw(4)
<< result << std::endl;
sif::error << std::hex << "EventManager::notifyListeners: MSG to " << std::setw(8)
<< std::setfill('0') << "0x" << listener.first << " failed with result "
<< std::setw(4) << "0x" << result << std::setfill(' ') << std::endl;
#else
sif::printError("Sending message to listener failed with result %04x\n", result);
sif::printError("Sending message to listener 0x%08x failed with result %04x\n",
listener.first, result);
#endif
}
}
@ -198,4 +200,19 @@ void EventManager::printUtility(sif::OutputTypes printType, EventMessage* messag
}
}
void EventManager::printListeners() {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Event manager listener MQ IDs:" << std::endl;
for (auto& listener : listenerList) {
sif::info << std::hex << std::setw(8) << std::setfill('0') << "0x" << listener.first << std::dec
<< std::setfill(' ') << std::endl;
}
#else
sif::printInfo("Event manager listener MQ IDs:\n");
for (auto& listener : listenerList) {
sif::printInfo("0x%08x\n", listener.first);
}
#endif
}
#endif /* FSFW_OBJ_EVENT_TRANSLATION == 1 */

View File

@ -42,6 +42,7 @@ class EventManager : public EventManagerIF, public ExecutableObjectIF, public Sy
object_id_t reporterFrom = 0, object_id_t reporterTo = 0,
bool reporterInverted = false);
ReturnValue_t performOperation(uint8_t opCode);
void printListeners();
protected:
MessageQueueIF* eventReportQueue = nullptr;

View File

@ -240,9 +240,9 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
bool ignoreFault) {
if (message == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "MessageQueue::sendMessageFromMessageQueue: Message is nullptr!" << std::endl;
sif::error << "MessageQueue::sendMessageFromMessageQueue: Message is nullptr" << std::endl;
#else
sif::printError("MessageQueue::sendMessageFromMessageQueue: Message is nullptr!\n");
sif::printError("MessageQueue::sendMessageFromMessageQueue: Message is nullptr\n");
#endif
return HasReturnvaluesIF::RETURN_FAILED;
}

View File

@ -13,6 +13,7 @@ Service5EventReporting::Service5EventReporting(object_id_t objectId, uint16_t ap
: PusServiceBase(objectId, apid, serviceId),
maxNumberReportsPerCycle(maxNumberReportsPerCycle) {
eventQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
sif::info << eventQueue->getId() << std::endl;
}
Service5EventReporting::~Service5EventReporting() {

View File

@ -77,9 +77,9 @@ class RMAPChannelIF {
* command; command was not sent
* - @c COMMAND_BUFFER_FULL no receiver buffer available for
* expected len; command was not sent
* - @c COMMAND_TOO_BIG the data that was to be sent was too long for
* the hw to handle (write command) or the expected len was bigger than maximal expected len (read
* command) command was not sent
* - @c COMMAND_TOO_BIG the data that was to be sent was too
* long for the hw to handle (write command) or the expected len was bigger than maximal expected
* len (read command) command was not sent
* - @c COMMAND_CHANNEL_DEACTIVATED the channel has no port set
* - @c NOT_SUPPORTED if you dont feel like
* implementing something...