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

Public Member Functions

 Packet (size_t size=c_max_packet_size)
 
void setCommand (uint32_t command)
 
uint32_t getCommand (void) const
 
void setSize (uint32_t size)
 
uint32_t getSize (void) const
 
void setByte (size_t index, uint8_t byte)
 
template<typename T >
void set (size_t index, const T &value)
 
template<typename T >
void get (unsigned index, T &value) const
 
template<typename T >
void getNoHandle (unsigned index, T &value) const
 
uint8_t * getData (void)
 
const uint8_t * getData (void) const
 
void dump (void) const
 
uint64_t getTimeStamp (void) const
 
void setTimeStamp (uint64_t time_stamp)
 

Constructor & Destructor Documentation

Sensors::Klein3500::Packet::Packet ( size_t  size = c_max_packet_size)
inline

Member Function Documentation

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

References getSize().

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

References getData().

uint32_t Sensors::Klein3500::Packet::getCommand ( void  ) const
inline

Retrieve command type.

Returns
command type.
const uint8_t* Sensors::Klein3500::Packet::getData ( void  ) const
inline
template<typename T >
void Sensors::Klein3500::Packet::getNoHandle ( unsigned  index,
T &  value 
) const
inline

References getData().

uint32_t Sensors::Klein3500::Packet::getSize ( void  ) const
inline

Retrieve message size.

Returns
message size.

References getData().

Referenced by dump(), and Sensors::Klein3500::Parser::parse().

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

Get packet's time of reception.

Returns
milliseconds since Unix Epoch.
template<typename T >
void Sensors::Klein3500::Packet::set ( size_t  index,
const T &  value 
)
inline

References getData().

void Sensors::Klein3500::Packet::setByte ( size_t  index,
uint8_t  byte 
)
inline
void Sensors::Klein3500::Packet::setCommand ( uint32_t  command)
inline

Set command type.

Parameters
[in]typecommand type.

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

void Sensors::Klein3500::Packet::setSize ( uint32_t  size)
inline

Set packet size.

Parameters
[in]sizemessage size.

References getData().

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

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

Set packet's time of reception.

Parameters
[in]time_stampmilliseconds since Unix Epoch.
Collaboration diagram for Sensors::Klein3500::Packet:
Collaboration graph