DUNE: Uniform Navigational Environment  2.6.0-rc4
Transports::SUNSET::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onEntityReservation (void)
 
void onEntityResolution (void)
 
void onResourceAcquisition (void)
 
void onResourceInitialization (void)
 
void onResourceRelease (void)
 
void consume (const IMC::IoEvent *msg)
 
void consume (const IMC::VehicleMedium *msg)
 
void consume (const IMC::DevDataText *msg)
 
void consume (const IMC::Aborted *msg)
 
void consume (const IMC::PlanControl *msg)
 
void consume (const IMC::SoundSpeed *msg)
 
void consume (const IMC::Salinity *msg)
 
void consume (const IMC::Temperature *msg)
 
void consume (const IMC::Conductivity *msg)
 
void consume (const IMC::PlanDB *msg)
 
void consume (const IMC::EstimatedState *msg)
 
std::string lookupSystemName (unsigned addr)
 
void handlePlanListGet (const PlanListGet *cmd)
 
void sendPlanList (unsigned destination)
 
void handlePositionGet (const PositionGet *cmd)
 
void sendPosition (unsigned destination)
 
void handlePlanStart (const PlanStart *cmd)
 
void sendPlanStarted (unsigned destination, const std::string &plan_name)
 
void handlePlanStop (const PlanStop *cmd)
 
void handleRange (const Range *cmd)
 
void sendPlanStopped (unsigned destination, const std::string &plan_name)
 
void handleAbort (const Abort *cmd)
 
void sendAborted (unsigned destination)
 
void sendFailure (unsigned destination, FailureType fail)
 
void sendError (unsigned destination, ErrorType error)
 
void sendOk (const std::string &command)
 
void handleSensorListGet (const SensorListGet *cmd)
 
void handleSensorInfoGet (const SensorInfoGet *cmd)
 
void handleSensorSampleGet (const SensorSampleGet *cmd)
 
void sendSensorSample (const std::string &name, unsigned sensor_id, unsigned destination)
 
void handleParam (const Param *cmd)
 
void handleCommand (const std::string &line)
 
void sendCommand (AbstractCommand &cmd)
 
double getLoopDelay (void) const
 
void updateScheduler (void)
 
void requestNodeId (void)
 
void setTxPower (unsigned level)
 
void keepAlive (void)
 
void onMain (void)
 
- Public Member Functions inherited from DUNE::Tasks::Task
 Task (const std::string &name, Context &context)
 
virtual ~Task (void)
 
const char * getName (void) const
 
const char * getSystemName (void) const
 
unsigned int getSystemId (void) const
 
unsigned int getEntityId (void) const
 
unsigned int resolveEntity (const std::string &label) const
 
std::string resolveEntity (unsigned int id) const
 
uint16_t getActivationTime (void) const
 
uint16_t getDeactivationTime (void) const
 
unsigned int resolveSystemName (const std::string &name) const
 
const char * resolveSystemId (unsigned int id) const
 
void loadConfig (void)
 
void setPriority (unsigned int value)
 
unsigned int getPriority (void) const
 
void inf (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void war (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void void err (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void void void cri (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void void void void debug (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void void void void void trace (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void void void void void void spew (const char *format,...) DUNE_PRINTF_FORMAT(2
 
void void void void void void
void void 
dispatch (IMC::Message *msg, unsigned int flags=0)
 
void dispatch (IMC::Message &msg, unsigned int flags=0)
 
void dispatchReply (const IMC::Message &original, IMC::Message &msg, unsigned int flags=0)
 
void receive (const IMC::Message *msg)
 
void reserveEntities (void)
 
void resolveEntities (void)
 
void acquireResources (void)
 
void releaseResources (void)
 
void initializeResources (void)
 
void updateParameters (bool act_deact=true)
 
void writeParamsXML (std::ostream &os) const
 
- Public Member Functions inherited from DUNE::Tasks::AbstractTask
 AbstractTask (void)
 
virtual ~AbstractTask (void)
 
- Public Member Functions inherited from DUNE::Concurrency::Thread
 Thread (void)
 
virtual ~Thread (void)
 
int getProcessorUsage (void)
 
- Public Member Functions inherited from DUNE::Concurrency::Runnable
 Runnable (void)
 
virtual ~Runnable (void)
 
void start (void)
 
void stop (void)
 
void join (void)
 
void stopAndJoin (void)
 
void setPriority (Scheduler::Policy policy, unsigned priority)
 
State getState (void)
 
bool isCreated (void)
 
bool isStopping (void)
 
bool isRunning (void)
 
bool isStarting (void)
 
bool isDead (void)
 

Public Attributes

MapName m_modem_names
 
MapAddr m_modem_addrs
 
std::vector< std::string > m_plan_list
 
unsigned m_addr_local
 
unsigned m_addr_bcast
 
bool m_aborted
 
uint8_t m_bfr [128]
 
std::string m_line
 
Linkm_link
 
Sensorsm_sensors
 
Schedulerm_scheduler
 
Position m_position
 
Counter< double > m_wdog
 
Counter< double > m_kalive
 
IMC::VehicleMedium m_medium
 
Arguments m_args
 

Additional Inherited Members

- Public Types inherited from DUNE::Concurrency::Runnable
enum  State {
  StateStarting, StateRunning, StateStopping, StateDead,
  StateUnknown
}
 
- Protected Member Functions inherited from DUNE::Tasks::Task
const char * getEntityLabel (void) const
 
void setEntityLabel (const std::string &label)
 
void setEntityState (IMC::EntityState::StateEnum state, Status::Code code)
 
void setEntityState (IMC::EntityState::StateEnum state, const std::string &description)
 
IMC::EntityState::StateEnum getEntityState (void) const
 
unsigned int reserveEntity (const std::string &label)
 
bool stopping (void)
 
bool isActive (void) const
 
bool isActivating (void) const
 
bool isDeactivating (void) const
 
void waitForMessages (double timeout)
 
void consumeMessages (void)
 
template<typename T >
Parameterparam (const std::string &name, T &var)
 
template<typename Y , typename T >
Parameterparam (const std::string &name, T &var)
 
template<typename T >
bool paramChanged (T &var)
 
void paramActive (Parameter::Scope def_scope, Parameter::Visibility def_visibility, bool def_value=false)
 
void setParamSectionEditor (const std::string &name)
 
template<typename M , typename T >
void bind (T *task_obj, void(T::*consumer)(const M *)=&T::consume)
 
template<typename T >
void bind (T *task_obj, const std::vector< uint32_t > &list)
 
template<typename T , typename M >
void bind (T *task_obj, const std::vector< uint32_t > &list, void(T::*consumer)(const M *)=&T::consume)
 
template<typename T >
void bind (T *task_obj, const std::vector< std::string > &list)
 
void requestActivation (void)
 
void requestDeactivation (void)
 
void activate (void)
 
void activationFailed (const std::string &reason)
 
void deactivate (void)
 
void deactivationFailed (const std::string &reason)
 
virtual void onReportEntityState (void)
 
virtual void onRequestActivation (void)
 
virtual void onRequestDeactivation (void)
 
virtual void onActivation (void)
 
virtual void onDeactivation (void)
 
- Protected Member Functions inherited from DUNE::Concurrency::Thread
void startImpl (void)
 
void stopImpl (void)
 
void joinImpl (void)
 
void setPriorityImpl (Scheduler::Policy policy, unsigned priority)
 
- Protected Attributes inherited from DUNE::Tasks::Task
Contextm_ctx
 

Constructor & Destructor Documentation

Member Function Documentation

void Transports::SUNSET::Task::consume ( const IMC::IoEvent *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::DevDataText *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::Aborted *  msg)
inline

References m_aborted.

void Transports::SUNSET::Task::consume ( const IMC::PlanControl *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::SoundSpeed *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::Salinity *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::Temperature *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::Conductivity *  msg)
inline
void Transports::SUNSET::Task::consume ( const IMC::PlanDB *  msg)
inline

References m_plan_list.

double Transports::SUNSET::Task::getLoopDelay ( void  ) const
inline
void Transports::SUNSET::Task::handlePlanStart ( const PlanStart cmd)
inline
void Transports::SUNSET::Task::handlePlanStop ( const PlanStop cmd)
inline
void Transports::SUNSET::Task::handlePositionGet ( const PositionGet cmd)
inline
void Transports::SUNSET::Task::handleRange ( const Range cmd)
inline
void Transports::SUNSET::Task::keepAlive ( void  )
inline
std::string Transports::SUNSET::Task::lookupSystemName ( unsigned  addr)
inline

References m_modem_addrs.

Referenced by handleRange().

void Transports::SUNSET::Task::onEntityReservation ( void  )
inlinevirtual

Reserve entity identifiers.

Reimplemented from DUNE::Tasks::Task.

void Transports::SUNSET::Task::onEntityResolution ( void  )
inlinevirtual

Resolve entity names.

Reimplemented from DUNE::Tasks::Task.

void Transports::SUNSET::Task::onMain ( void  )
inlinevirtual
void Transports::SUNSET::Task::onResourceAcquisition ( void  )
inlinevirtual
void Transports::SUNSET::Task::onResourceInitialization ( void  )
inlinevirtual

Initialize resources.

Reimplemented from DUNE::Tasks::Task.

References m_kalive, and DUNE::Time::Counter< T >::setTop().

void Transports::SUNSET::Task::onResourceRelease ( void  )
inlinevirtual

Release resources.

Reimplemented from DUNE::Tasks::Task.

References m_link, m_scheduler, and m_sensors.

void Transports::SUNSET::Task::onUpdateParameters ( void  )
inlinevirtual

Update internal state with new parameter values.

Reimplemented from DUNE::Tasks::Task.

void Transports::SUNSET::Task::requestNodeId ( void  )
inline
void Transports::SUNSET::Task::sendAborted ( unsigned  destination)
inline
void Transports::SUNSET::Task::sendPlanList ( unsigned  destination)
inline
void Transports::SUNSET::Task::sendPlanStarted ( unsigned  destination,
const std::string &  plan_name 
)
inline
void Transports::SUNSET::Task::sendPlanStopped ( unsigned  destination,
const std::string &  plan_name 
)
inline
void Transports::SUNSET::Task::sendPosition ( unsigned  destination)
inline
void Transports::SUNSET::Task::sendSensorSample ( const std::string &  name,
unsigned  sensor_id,
unsigned  destination 
)
inline

Member Data Documentation

bool Transports::SUNSET::Task::m_aborted

True if Aborted message was received.

Referenced by consume(), and handleAbort().

unsigned Transports::SUNSET::Task::m_addr_bcast

Broadcast address.

Referenced by handleParam().

unsigned Transports::SUNSET::Task::m_addr_local
Arguments Transports::SUNSET::Task::m_args

Task arguments.

Referenced by consume(), onResourceAcquisition(), and Task().

uint8_t Transports::SUNSET::Task::m_bfr[128]

Internal buffer.

Counter<double> Transports::SUNSET::Task::m_kalive

Keep-alive timer.

Referenced by handleCommand(), keepAlive(), and onResourceInitialization().

std::string Transports::SUNSET::Task::m_line

Command line being parsed.

Link* Transports::SUNSET::Task::m_link

Command link.

Referenced by onResourceAcquisition(), onResourceRelease(), and sendCommand().

IMC::VehicleMedium Transports::SUNSET::Task::m_medium

Medium.

Referenced by consume(), and Task().

MapAddr Transports::SUNSET::Task::m_modem_addrs

Map of Evologics modems by address.

Referenced by lookupSystemName(), and Task().

MapName Transports::SUNSET::Task::m_modem_names

Map of Evologics modems by name.

Referenced by Task().

std::vector<std::string> Transports::SUNSET::Task::m_plan_list

Plan list.

Referenced by consume(), handlePlanListGet(), and sendPlanList().

Position Transports::SUNSET::Task::m_position

Last position.

Referenced by consume(), and sendPosition().

Scheduler* Transports::SUNSET::Task::m_scheduler
Counter<double> Transports::SUNSET::Task::m_wdog

Watchdog.

Collaboration diagram for Transports::SUNSET::Task:
Collaboration graph