Provides an abstract parent for all Sick messages. More...
#include <SickMessage.hh>
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 |
Provides an abstract parent for all Sick messages.
Definition at line 32 of file SickMessage.hh.
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::SickMessage | ( | ) |
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::~SickMessage | ( | ) | [virtual] |
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
*payload_buffer | The payload of the message as an array of bytes |
payload_length | The length of the payload in bytes |
Reimplemented in SickToolbox::SickLMS1xxMessage, and SickToolbox::SickLDMessage.
Definition at line 111 of file SickMessage.hh.
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.
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
*message_buffer | Destination buffer for message contents |
Definition at line 147 of file SickMessage.hh.
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.
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
*payload_buffer | Destination buffer for message payload contents |
Definition at line 156 of file SickMessage.hh.
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.
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.
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
*payload_sub_buffer | Destination buffer for message payload contents |
*start_idx | The 0-indexed starting location for copying |
*stop_idx | The 0-indexed stopping location for copying |
Definition at line 174 of file SickMessage.hh.
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.
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
*message_buffer | A 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.