//! Dispatch message to the message bus in reply to another //! message. //! @param[in] original original message. //! @param[in] msg message reference. //! @param[in] flags bitfield with flags (see Tasks::DispatchFlags). void dispatchReply(const IMC::Message& original, IMC::Message& msg, unsigned int flags = 0) { msg.setDestination(original.getSource()); msg.setDestinationEntity(original.getSourceEntity()); dispatch(msg, flags); }
void MessageMonitor::updateMessage(const IMC::Message* msg) { ScopedMutex l(m_mutex); IMC::Message* tmsg = msg->clone(); unsigned key = tmsg->getId() << 24 | tmsg->getSubId() << 8 | tmsg->getSourceEntity(); if (m_msgs[key]) delete m_msgs[key]; m_msgs[key] = tmsg; }
void MessageMonitor::updateMessage(const IMC::Message* msg) { ScopedMutex l(m_mutex); if (msg->getId() == DUNE_IMC_POWERCHANNELSTATE) updatePowerChannel(static_cast<const IMC::PowerChannelState*>(msg)); IMC::Message* tmsg = msg->clone(); unsigned key = tmsg->getId() << 24 | tmsg->getSubId() << 8 | tmsg->getSourceEntity(); if (m_msgs[key]) delete m_msgs[key]; m_msgs[key] = tmsg; }