Public Member Functions | Static Public Attributes | Protected Attributes
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH > Class Template Reference

Provides an abstract parent for all Sick messages. More...

#include <SickMessage.hh>

List of all members.

Public Member Functions

void BuildMessage (const uint8_t *const payload_buffer, const unsigned int payload_length)
 Constructs a Sick message given the parameter values.
virtual void Clear ()
 Reset all internal fields and buffers.
void GetMessage (uint8_t *const message_buffer) const
 Get the message as a sequence of well-formed bytes.
unsigned int GetMessageLength () const
void GetPayload (uint8_t *const payload_buffer) const
 Get the payload contents as a sequence of well-formed bytes.
void GetPayloadAsCStr (char *const payload_str) const
unsigned int GetPayloadLength () const
void GetPayloadSubregion (uint8_t *const payload_sub_buffer, const unsigned int start_idx, const unsigned int stop_idx) const
 Get a specified sub-region of the payload buffer.
bool IsPopulated () const
virtual void ParseMessage (const uint8_t *const message_buffer)=0
 Parses a sequence of bytes into a Sick message.
virtual void Print () const
 Print data about this object.
 SickMessage ()
 A default constructor.
virtual ~SickMessage ()
 A destructor.

Static Public Attributes

static const unsigned int MESSAGE_HEADER_LENGTH = MSG_HEADER_LENGTH
static const unsigned int MESSAGE_MAX_LENGTH = MESSAGE_HEADER_LENGTH + MESSAGE_PAYLOAD_MAX_LENGTH + MESSAGE_TRAILER_LENGTH
static const unsigned int MESSAGE_PAYLOAD_MAX_LENGTH = MSG_PAYLOAD_MAX_LENGTH
static const unsigned int MESSAGE_TRAILER_LENGTH = MSG_TRAILER_LENGTH

Protected Attributes

uint8_t _message_buffer [MESSAGE_MAX_LENGTH]
unsigned int _message_length
unsigned int _payload_length
bool _populated

Detailed Description

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
class SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >

Provides an abstract parent for all Sick messages.

Definition at line 32 of file SickMessage.hh.


Constructor & Destructor Documentation

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::SickMessage ( )

A default constructor.

A standard constructor

Definition at line 103 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::~SickMessage ( ) [virtual]

A destructor.

A virtual destructor

Definition at line 226 of file SickMessage.hh.


Member Function Documentation

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::BuildMessage ( const uint8_t *const  payload_buffer,
const unsigned int  payload_length 
)

Constructs a Sick message given the parameter values.

Construct a well-formed Sick message

Parameters:
*payload_bufferThe payload of the message as an array of bytes
payload_lengthThe length of the payload in bytes

Reimplemented in SickToolbox::SickLMS1xxMessage, and SickToolbox::SickLDMessage.

Definition at line 111 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::Clear ( ) [virtual]

Reset all internal fields and buffers.

Clear the contents of the message container/object

Reimplemented in SickToolbox::SickLMS2xxMessage, and SickToolbox::SickLMS1xxMessage.

Definition at line 185 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetMessage ( uint8_t *const  message_buffer) const

Get the message as a sequence of well-formed bytes.

Returns a copy of the raw message buffer

Parameters:
*message_bufferDestination buffer for message contents

Definition at line 147 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetMessageLength ( ) const [inline]

Resturns the total message length in bytes

Definition at line 55 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetPayload ( uint8_t *const  payload_buffer) const

Get the payload contents as a sequence of well-formed bytes.

Returns a copy of the raw message payload

Parameters:
*payload_bufferDestination buffer for message payload contents

Definition at line 156 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetPayloadAsCStr ( char *const  payload_buffer) const

Returns a copy of the payload as a C String

Definition at line 162 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetPayloadLength ( ) const [inline]

Returns the total payload length in bytes

Definition at line 68 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetPayloadSubregion ( uint8_t *const  payload_sub_buffer,
const unsigned int  start_idx,
const unsigned int  stop_idx 
) const

Get a specified sub-region of the payload buffer.

Returns a subregion of the payload specified by indices

Parameters:
*payload_sub_bufferDestination buffer for message payload contents
*start_idxThe 0-indexed starting location for copying
*stop_idxThe 0-indexed stopping location for copying

Definition at line 174 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
bool SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::IsPopulated ( ) const [inline]

Indicates whether the message container is populated

Definition at line 71 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::ParseMessage ( const uint8_t *const  message_buffer) [pure virtual]

Parses a sequence of bytes into a Sick message.

Populates fields given a sequence of bytes representing a raw message

Parameters:
*message_bufferA well-formed message to be parsed into the class' fields

Implemented in SickToolbox::SickLMS2xxMessage, SickToolbox::SickLMS1xxMessage, and SickToolbox::SickLDMessage.

Definition at line 133 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
void SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::Print ( ) const [virtual]

Print data about this object.

Print the contents of the message

Reimplemented in SickToolbox::SickLMS2xxMessage, SickToolbox::SickLMS1xxMessage, and SickToolbox::SickLDMessage.

Definition at line 201 of file SickMessage.hh.


Member Data Documentation

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
uint8_t SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::_message_buffer[MESSAGE_MAX_LENGTH] [protected]

The message as a raw sequence of bytes

Definition at line 91 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::_message_length [protected]

The length of the message in bytes

Definition at line 88 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::_payload_length [protected]

The length of the message payload in bytes

Definition at line 85 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
bool SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::_populated [protected]

Indicates whether the message container/object is populated

Definition at line 94 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
const unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::MESSAGE_HEADER_LENGTH = MSG_HEADER_LENGTH [static]

Some constants to make things more manageable

Definition at line 37 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
const unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::MESSAGE_MAX_LENGTH = MESSAGE_HEADER_LENGTH + MESSAGE_PAYLOAD_MAX_LENGTH + MESSAGE_TRAILER_LENGTH [static]

Definition at line 40 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
const unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::MESSAGE_PAYLOAD_MAX_LENGTH = MSG_PAYLOAD_MAX_LENGTH [static]

Definition at line 39 of file SickMessage.hh.

template<unsigned int MSG_HEADER_LENGTH, unsigned int MSG_PAYLOAD_MAX_LENGTH, unsigned int MSG_TRAILER_LENGTH>
const unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::MESSAGE_TRAILER_LENGTH = MSG_TRAILER_LENGTH [static]

Definition at line 38 of file SickMessage.hh.


The documentation for this class was generated from the following file:


sicktoolbox
Author(s): Jason Derenick , Thomas Miller
autogenerated on Sun May 5 2019 02:28:23