DUNE: Uniform Navigational Environment  2016.05.0
Sensors::Edgetech2205::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onResourceRelease (void)
 
void onResourceInitialization (void)
 
void queueState (StateMachineStates state)
 
bool hasQueuedStates (void) const
 
StateMachineStates getCurrentState (void) const
 
StateMachineStates dequeueState (void)
 
void onRequestActivation (void)
 
bool connect (void)
 
void failActivation (const std::string &message)
 
void onRequestDeactivation (void)
 
void disconnect (void)
 
void onDeactivation (void)
 
void onActivation (void)
 
void requestLogName (void)
 
void consume (const IMC::PowerChannelState *msg)
 
void consume (const IMC::EstimatedState *msg)
 
void consume (const IMC::LoggingControl *msg)
 
void setPingAutoSelectMode (void)
 
void setTriggerCoupling (void)
 
void initConfig (void)
 
void setDataActive (SubsystemId subsys, const std::string &channels)
 
void setPing (SubsystemId subsys, const std::string &channels)
 
int getSubsysIndex (int subsys)
 
void dispatchDebugData (const std::string &text)
 
void handleSonarData (void)
 
void writeSubsystemData (SubsystemData *data)
 
void updateSubsystemData (SubsystemData *data)
 
void handlePacket (void)
 
bool readData (void)
 
void estimateTimeDelta (Counter< double > &reference_timer)
 
void openLog (const Path &path)
 
void logPacket (void)
 
void closeLog (void)
 
void controlPower (IMC::PowerChannelControl::OperationEnum op)
 
void turnPowerOn (void)
 
void turnPowerOff (void)
 
bool isPowered (void)
 
void updateStateMachine (void)
 
void onMain (void)
 

Public Attributes

TCPSocket * m_sock_dat
 
std::vector< uint8_t > m_bfr
 
Parser m_parser
 
CommandLinkm_cmd
 
Logm_log
 
Counter< double > m_wdog
 
Counter< double > m_time_delta_timer
 
SubsystemData m_subsys_data [c_subsys_count]
 
StateMachineStates m_sm_state
 
std::queue< StateMachineStatesm_sm_state_queue
 
bool m_powered
 
Packetm_packet
 
Arguments m_args
 

Static Public Attributes

static const unsigned c_buffer_size
 

Constructor & Destructor Documentation

Member Function Documentation

void Sensors::Edgetech2205::Task::closeLog ( void  )
inline
bool Sensors::Edgetech2205::Task::connect ( void  )
inline
void Sensors::Edgetech2205::Task::consume ( const IMC::PowerChannelState *  msg)
inline
void Sensors::Edgetech2205::Task::consume ( const IMC::EstimatedState *  msg)
inline
void Sensors::Edgetech2205::Task::consume ( const IMC::LoggingControl *  msg)
inline
void Sensors::Edgetech2205::Task::controlPower ( IMC::PowerChannelControl::OperationEnum  op)
inline
StateMachineStates Sensors::Edgetech2205::Task::dequeueState ( void  )
inline
void Sensors::Edgetech2205::Task::dispatchDebugData ( const std::string &  text)
inline
void Sensors::Edgetech2205::Task::failActivation ( const std::string &  message)
inline

References controlPower().

Referenced by updateStateMachine().

StateMachineStates Sensors::Edgetech2205::Task::getCurrentState ( void  ) const
inline

References m_sm_state.

Referenced by consume().

int Sensors::Edgetech2205::Task::getSubsysIndex ( int  subsys)
inline
void Sensors::Edgetech2205::Task::handlePacket ( void  )
inline
bool Sensors::Edgetech2205::Task::hasQueuedStates ( void  ) const
inline

Test if state queue has pending state transitions.

Returns
true if state queue has pending states, false otherwise.

References m_sm_state_queue.

Referenced by dequeueState(), and onMain().

bool Sensors::Edgetech2205::Task::isPowered ( void  )
inline

Test if power channel is on.

Returns
true if power channel is on, false otherwise.

References m_powered.

Referenced by updateStateMachine().

void Sensors::Edgetech2205::Task::logPacket ( void  )
inline
void Sensors::Edgetech2205::Task::onDeactivation ( void  )
inline
void Sensors::Edgetech2205::Task::onMain ( void  )
inline
void Sensors::Edgetech2205::Task::onRequestActivation ( void  )
inline
void Sensors::Edgetech2205::Task::onRequestDeactivation ( void  )
inline
void Sensors::Edgetech2205::Task::onResourceInitialization ( void  )
inline
void Sensors::Edgetech2205::Task::onResourceRelease ( void  )
inline

References closeLog().

void Sensors::Edgetech2205::Task::openLog ( const Path &  path)
inline
void Sensors::Edgetech2205::Task::queueState ( StateMachineStates  state)
inline

Push a new state to the state queue.

Parameters
[in]statestate machine state.

References m_sm_state_queue.

Referenced by onRequestActivation(), onRequestDeactivation(), and updateStateMachine().

bool Sensors::Edgetech2205::Task::readData ( void  )
inline
void Sensors::Edgetech2205::Task::requestLogName ( void  )
inline

Referenced by updateStateMachine().

void Sensors::Edgetech2205::Task::setDataActive ( SubsystemId  subsys,
const std::string &  channels 
)
inline
void Sensors::Edgetech2205::Task::setPing ( SubsystemId  subsys,
const std::string &  channels 
)
inline
void Sensors::Edgetech2205::Task::turnPowerOff ( void  )
inline

References controlPower().

Referenced by updateStateMachine().

void Sensors::Edgetech2205::Task::turnPowerOn ( void  )
inline

References controlPower().

Referenced by updateStateMachine().

void Sensors::Edgetech2205::Task::writeSubsystemData ( SubsystemData data)
inline

References Sensors::Edgetech2205::SubsystemData::altitude, Sensors::Edgetech2205::SubsystemData::course, Sensors::Edgetech2205::SubsystemData::depth, Sensors::Edgetech2205::Packet::getMessageData(), Sensors::Edgetech2205::SubsystemData::heading, Sensors::Edgetech2205::SubsystemData::latitude, Sensors::Edgetech2205::SubsystemData::latitude_rad, Sensors::Edgetech2205::SubsystemData::longitude, Sensors::Edgetech2205::SubsystemData::longitude_rad, m_packet, Sensors::Edgetech2205::SubsystemData::pitch, Sensors::Edgetech2205::SubsystemData::roll, Sensors::Edgetech2205::SDATA_IDX_ALTITUDE, Sensors::Edgetech2205::SDATA_IDX_ANNOTATION_STRING, Sensors::Edgetech2205::SDATA_IDX_COORDINATE_UNITS, Sensors::Edgetech2205::SDATA_IDX_COURSE, Sensors::Edgetech2205::SDATA_IDX_CPU_DAY, Sensors::Edgetech2205::SDATA_IDX_CPU_HOUR, Sensors::Edgetech2205::SDATA_IDX_CPU_MINUTES, Sensors::Edgetech2205::SDATA_IDX_CPU_SECONDS, Sensors::Edgetech2205::SDATA_IDX_CPU_TIME_BASIS, Sensors::Edgetech2205::SDATA_IDX_CPU_YEAR, Sensors::Edgetech2205::SDATA_IDX_DEPTH, Sensors::Edgetech2205::SDATA_IDX_HEADING, Sensors::Edgetech2205::SDATA_IDX_LATITUDE, Sensors::Edgetech2205::SDATA_IDX_LONGITUDE, Sensors::Edgetech2205::SDATA_IDX_MILLISECOND_TODAY, Sensors::Edgetech2205::SDATA_IDX_NMEA_HOUR, Sensors::Edgetech2205::SDATA_IDX_NMEA_MINUTES, Sensors::Edgetech2205::SDATA_IDX_NMEA_SECONDS, Sensors::Edgetech2205::SDATA_IDX_PITCH, Sensors::Edgetech2205::SDATA_IDX_ROLL, Sensors::Edgetech2205::SDATA_IDX_SPEED, Sensors::Edgetech2205::SDATA_IDX_TIME, Sensors::Edgetech2205::SDATA_IDX_VALIDITY, Sensors::Edgetech2205::Packet::set(), Sensors::Edgetech2205::SubsystemData::speed, Sensors::Edgetech2205::SubsystemData::time_bdt, Sensors::Edgetech2205::SubsystemData::time_epoch, Sensors::Edgetech2205::SubsystemData::time_msec_today, and Sensors::Edgetech2205::SubsystemData::validity.

Referenced by handleSonarData().

Member Data Documentation

const unsigned Sensors::Edgetech2205::Task::c_buffer_size
static

Buffer size.

Referenced by Task().

std::vector<uint8_t> Sensors::Edgetech2205::Task::m_bfr

Read buffer.

Referenced by readData(), and Task().

Log* Sensors::Edgetech2205::Task::m_log
Packet* Sensors::Edgetech2205::Task::m_packet
Parser Sensors::Edgetech2205::Task::m_parser

Parser.

Referenced by readData().

bool Sensors::Edgetech2205::Task::m_powered

True if device is powered on.

Referenced by consume(), isPowered(), and onUpdateParameters().

StateMachineStates Sensors::Edgetech2205::Task::m_sm_state

Current state machine state.

Referenced by dequeueState(), and getCurrentState().

std::queue<StateMachineStates> Sensors::Edgetech2205::Task::m_sm_state_queue

State machine state queue.

Referenced by dequeueState(), hasQueuedStates(), and queueState().

TCPSocket* Sensors::Edgetech2205::Task::m_sock_dat

Data socket.

Referenced by disconnect(), onActivation(), and readData().

SubsystemData Sensors::Edgetech2205::Task::m_subsys_data[c_subsys_count]

Subsystem specific data.

Referenced by consume(), handleSonarData(), onActivation(), and setPing().

Counter<double> Sensors::Edgetech2205::Task::m_time_delta_timer

Timer for time delta estimation.

Referenced by updateStateMachine().

Counter<double> Sensors::Edgetech2205::Task::m_wdog

Watchdog timer.

Referenced by onActivation(), and updateStateMachine().

Collaboration diagram for Sensors::Edgetech2205::Task:
Collaboration graph