Beispiel #1
0
 //! 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);
 }
Beispiel #2
0
    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;
    }
Beispiel #3
0
    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;
    }