#include <c++/drivers/base/src/SickMessage.hh>
Public Member Functions | |
SickMessage () | |
A default constructor. | |
void | BuildMessage (const uint8_t *const payload_buffer, const unsigned int payload_length) |
Constructs a Sick message given the parameter values. | |
virtual void | ParseMessage (const uint8_t *const message_buffer)=0 |
Parses a sequence of bytes into a Sick message. | |
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 | 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. | |
unsigned int | GetPayloadLength () const |
bool | IsPopulated () const |
virtual void | Clear () |
Reset all internal fields and buffers. | |
virtual void | Print () const |
Print data about this object. | |
virtual | ~SickMessage () |
A destructor. | |
Static Public Attributes | |
static const unsigned int | MESSAGE_HEADER_LENGTH = MSG_HEADER_LENGTH |
static const unsigned int | MESSAGE_TRAILER_LENGTH = MSG_TRAILER_LENGTH |
static const unsigned int | MESSAGE_PAYLOAD_MAX_LENGTH = MSG_PAYLOAD_MAX_LENGTH |
static const unsigned int | MESSAGE_MAX_LENGTH = MESSAGE_HEADER_LENGTH + MESSAGE_PAYLOAD_MAX_LENGTH + MESSAGE_TRAILER_LENGTH |
Protected Attributes | |
unsigned int | _payload_length |
unsigned int | _message_length |
uint8_t | _message_buffer [MESSAGE_MAX_LENGTH] |
bool | _populated |
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::SickMessage | ( | ) |
A default constructor.
A standard constructor
SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::~SickMessage | ( | ) | [virtual] |
A destructor.
A virtual destructor
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
Reimplemented in SickToolbox::SickLDMessage.
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
Implemented in SickToolbox::SickLDMessage, and SickToolbox::SickLMSMessage.
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
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetMessageLength | ( | ) | const [inline] |
Resturns the total message length in bytes
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
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
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::GetPayloadLength | ( | ) | const [inline] |
Returns the total payload length in bytes
bool SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::IsPopulated | ( | ) | const [inline] |
Indicates whether the message container is populated
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::SickLMSMessage.
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::SickLDMessage, and SickToolbox::SickLMSMessage.
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
const unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::MESSAGE_TRAILER_LENGTH = MSG_TRAILER_LENGTH [static] |
const unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::MESSAGE_PAYLOAD_MAX_LENGTH = MSG_PAYLOAD_MAX_LENGTH [static] |
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] |
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
unsigned int SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::_message_length [protected] |
The length of the message in bytes
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
bool SickToolbox::SickMessage< MSG_HEADER_LENGTH, MSG_PAYLOAD_MAX_LENGTH, MSG_TRAILER_LENGTH >::_populated [protected] |
Indicates whether the message container/object is populated