DUNE: Uniform Navigational Environment  2016.05.0
Sensors::Edgetech2205::Packet Class Reference

Public Types

enum  HeaderIndices {
  HDR_IDX_MARKER, HDR_IDX_VERSION, HDR_IDX_SESSION, HDR_IDX_MSG_TYPE,
  HDR_IDX_CMD_TYPE, HDR_IDX_SUBSYS, HDR_IDX_CHANNEL, HDR_IDX_SEQUENCE,
  HDR_IDX_MSG_SIZE
}
 

Public Member Functions

 Packet (void)
 
void setProtocolVersion (uint8_t version)
 
uint8_t getProtocolVersion (void) const
 
void setMessageType (uint16_t type)
 
uint16_t getMessageType (void) const
 
void setMessageSize (uint32_t size)
 
uint32_t getMessageSize (void) const
 
uint8_t * getMessageData (void)
 
const uint8_t * getMessageData (void) const
 
void setCommandType (uint8_t type)
 
uint8_t getCommandType (void) const
 
void setChannel (uint8_t channel)
 
uint8_t getChannel (void) const
 
void setSubsystemNumber (uint8_t subsys)
 
uint8_t getSubsystemNumber (void) const
 
void setValue (uint32_t value)
 
uint32_t getValue (void) const
 
void setDataByte (unsigned index, uint8_t byte)
 
void setHeaderByte (unsigned index, uint8_t byte)
 
unsigned getSize (void) const
 
uint8_t * getData (void)
 
const uint8_t * getData (void) const
 
template<typename T >
void set (const T &value, unsigned index)
 
template<typename T >
void get (T &value, unsigned index) const
 
unsigned getMaximumMessageSize (void) const
 
void dump (void) const
 
uint64_t getTimeStamp (void) const
 
void setTimeStamp (uint64_t time_stamp)
 

Member Enumeration Documentation

Enumerator
HDR_IDX_MARKER 
HDR_IDX_VERSION 
HDR_IDX_SESSION 
HDR_IDX_MSG_TYPE 
HDR_IDX_CMD_TYPE 
HDR_IDX_SUBSYS 
HDR_IDX_CHANNEL 
HDR_IDX_SEQUENCE 
HDR_IDX_MSG_SIZE 

Constructor & Destructor Documentation

Sensors::Edgetech2205::Packet::Packet ( void  )
inline

References HDR_IDX_MARKER, and HDR_IDX_VERSION.

Member Function Documentation

void Sensors::Edgetech2205::Packet::dump ( void  ) const
inline

References getSize().

template<typename T >
void Sensors::Edgetech2205::Packet::get ( T &  value,
unsigned  index 
) const
inline
uint8_t Sensors::Edgetech2205::Packet::getChannel ( void  ) const
inline

Retrieve channel.

Returns
channel.

References HDR_IDX_CHANNEL.

uint8_t Sensors::Edgetech2205::Packet::getCommandType ( void  ) const
inline

Retrieve command type.

Returns
command type.

References HDR_IDX_CMD_TYPE.

uint8_t* Sensors::Edgetech2205::Packet::getData ( void  )
inline
const uint8_t* Sensors::Edgetech2205::Packet::getData ( void  ) const
inline
unsigned Sensors::Edgetech2205::Packet::getMaximumMessageSize ( void  ) const
inline
uint8_t* Sensors::Edgetech2205::Packet::getMessageData ( void  )
inline

Retrieve message data.

Returns
message data.

References getData().

Referenced by get(), set(), and Sensors::Edgetech2205::Task::writeSubsystemData().

const uint8_t* Sensors::Edgetech2205::Packet::getMessageData ( void  ) const
inline

Retrieve message data.

Returns
message data.

References getData().

uint32_t Sensors::Edgetech2205::Packet::getMessageSize ( void  ) const
inline

Retrieve message size.

Returns
message size.

References getData(), and HDR_IDX_MSG_SIZE.

Referenced by getSize(), and Sensors::Edgetech2205::Parser::parse().

uint16_t Sensors::Edgetech2205::Packet::getMessageType ( void  ) const
inline

Retrieve message type.

Returns
message type.

References getData(), and HDR_IDX_MSG_TYPE.

Referenced by Sensors::Edgetech2205::Task::handlePacket().

uint8_t Sensors::Edgetech2205::Packet::getProtocolVersion ( void  ) const
inline

Retrieve protocol version.

Returns
protocol version.
unsigned Sensors::Edgetech2205::Packet::getSize ( void  ) const
inline

Retrieve the size of the packet.

Returns
packet size.

References getMessageSize().

Referenced by dump().

uint8_t Sensors::Edgetech2205::Packet::getSubsystemNumber ( void  ) const
inline

Retrieve subsystem number.

Returns
subsystem number.

References HDR_IDX_SUBSYS.

Referenced by Sensors::Edgetech2205::Task::handleSonarData(), and Sensors::Edgetech2205::Task::updateSubsystemData().

uint64_t Sensors::Edgetech2205::Packet::getTimeStamp ( void  ) const
inline

Get packet's time of reception.

Returns
milliseconds since Unix Epoch.

Referenced by Sensors::Edgetech2205::CommandLink::estimateTimeDelta(), and Sensors::Edgetech2205::Task::updateSubsystemData().

uint32_t Sensors::Edgetech2205::Packet::getValue ( void  ) const
inline
template<typename T >
void Sensors::Edgetech2205::Packet::set ( const T &  value,
unsigned  index 
)
inline
void Sensors::Edgetech2205::Packet::setDataByte ( unsigned  index,
uint8_t  byte 
)
inline
void Sensors::Edgetech2205::Packet::setHeaderByte ( unsigned  index,
uint8_t  byte 
)
inline
void Sensors::Edgetech2205::Packet::setMessageSize ( uint32_t  size)
inline

Set message size.

Parameters
[in]sizemessage size.

References getData(), and HDR_IDX_MSG_SIZE.

Referenced by Sensors::Edgetech2205::CommandLink::getPingRange(), Sensors::Edgetech2205::CommandLink::setPingCoupling(), and setValue().

void Sensors::Edgetech2205::Packet::setProtocolVersion ( uint8_t  version)
inline

Set protocol version.

Parameters
[in]versionprotocol version.

Referenced by Sensors::Edgetech2205::Parser::parse().

void Sensors::Edgetech2205::Packet::setTimeStamp ( uint64_t  time_stamp)
inline

Set packet's time of reception.

Parameters
[in]time_stampmilliseconds since Unix Epoch.

Referenced by Sensors::Edgetech2205::Parser::parse().

Collaboration diagram for Sensors::Edgetech2205::Packet:
Collaboration graph