Public Member Functions | Private Attributes | List of all members
SickToolbox::SickLMS1xxMessage Class Reference

A class to represent all messages sent to and from the Sick LMS 1xx unit. More...

#include <SickLMS1xxMessage.hh>

Inheritance diagram for SickToolbox::SickLMS1xxMessage:
Inheritance graph
[legend]

Public Member Functions

void BuildMessage (const uint8_t *const payload_buffer, const unsigned int payload_length)
 Constructs a well-formed Sick LMS 1xx message. More...
 
void Clear ()
 Reset all internal fields and buffers associated with the object. More...
 
std::string GetCommand () const
 
std::string GetCommandType () const
 
void ParseMessage (const uint8_t *const message_buffer) throw ( SickIOException )
 Parses a sequence of bytes into a SickLMS1xxMessage object. More...
 
void Print () const
 Print the message contents. More...
 
 SickLMS1xxMessage ()
 A default constructor. More...
 
 SickLMS1xxMessage (const uint8_t *const payload_buffer, const unsigned int payload_length)
 Another constructor. More...
 
 SickLMS1xxMessage (const uint8_t *const message_buffer)
 Another constructor. More...
 
 ~SickLMS1xxMessage ()
 
- Public Member Functions inherited from SickToolbox::SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN >
void BuildMessage (const uint8_t *const payload_buffer, const unsigned int payload_length)
 Constructs a Sick message given the parameter values. More...
 
void GetMessage (uint8_t *const message_buffer) const
 Get the message as a sequence of well-formed bytes. More...
 
unsigned int GetMessageLength () const
 
void GetPayload (uint8_t *const payload_buffer) const
 Get the payload contents as a sequence of well-formed bytes. More...
 
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. More...
 
bool IsPopulated () const
 
 SickMessage ()
 A default constructor. More...
 
virtual ~SickMessage ()
 A destructor. More...
 

Private Attributes

std::string _command
 
std::string _command_type
 

Additional Inherited Members

- Static Public Attributes inherited from SickToolbox::SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN >
static const unsigned int MESSAGE_HEADER_LENGTH
 
static const unsigned int MESSAGE_MAX_LENGTH
 
static const unsigned int MESSAGE_PAYLOAD_MAX_LENGTH
 
static const unsigned int MESSAGE_TRAILER_LENGTH
 
- Protected Attributes inherited from SickToolbox::SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN >
uint8_t _message_buffer [MESSAGE_MAX_LENGTH]
 
unsigned int _message_length
 
unsigned int _payload_length
 
bool _populated
 

Detailed Description

A class to represent all messages sent to and from the Sick LMS 1xx unit.

Definition at line 37 of file SickLMS1xxMessage.hh.

Constructor & Destructor Documentation

SickToolbox::SickLMS1xxMessage::SickLMS1xxMessage ( )

A default constructor.

A standard constructor

Definition at line 33 of file SickLMS1xxMessage.cc.

SickToolbox::SickLMS1xxMessage::SickLMS1xxMessage ( const uint8_t *const  payload_buffer,
const unsigned int  payload_length 
)

Another constructor.

Constructs a packet by using BuildMessage

Parameters
*payload_bufferThe payload for the packet as an array of bytes (including the header)
payload_lengthThe length of the payload array in bytes

Definition at line 49 of file SickLMS1xxMessage.cc.

SickToolbox::SickLMS1xxMessage::SickLMS1xxMessage ( const uint8_t *const  message_buffer)

Another constructor.

Constructs a packet using ParseMessage()

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

Definition at line 64 of file SickLMS1xxMessage.cc.

SickToolbox::SickLMS1xxMessage::~SickLMS1xxMessage ( )

Destructor

Definition at line 199 of file SickLMS1xxMessage.cc.

Member Function Documentation

void SickToolbox::SickLMS1xxMessage::BuildMessage ( const uint8_t *const  payload_buffer,
const unsigned int  payload_length 
)

Constructs a well-formed Sick LMS 1xx message.

Construct a well-formed raw packet

Parameters
*payload_bufferAn address of the first byte to be copied into the message's payload
payload_lengthThe number of bytes to be copied into the message buffer

Definition at line 80 of file SickLMS1xxMessage.cc.

void SickToolbox::SickLMS1xxMessage::Clear ( )
virtual

Reset all internal fields and buffers associated with the object.

Reset the data associated with this message (for initialization purposes)

Reimplemented from SickToolbox::SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN >.

Definition at line 173 of file SickLMS1xxMessage.cc.

std::string SickToolbox::SickLMS1xxMessage::GetCommand ( ) const
inline

Get the service sub-code associated with the message

Definition at line 60 of file SickLMS1xxMessage.hh.

std::string SickToolbox::SickLMS1xxMessage::GetCommandType ( ) const
inline

Get the length of the service code associated with the message

Definition at line 57 of file SickLMS1xxMessage.hh.

void SickToolbox::SickLMS1xxMessage::ParseMessage ( const uint8_t *const  message_buffer)
throw (SickIOException
)
virtual

Parses a sequence of bytes into a SickLMS1xxMessage object.

Populates fields from a (well-formed) raw packet

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

Implements SickToolbox::SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN >.

Definition at line 122 of file SickLMS1xxMessage.cc.

void SickToolbox::SickLMS1xxMessage::Print ( ) const
virtual

Print the message contents.

A debugging function that prints the contents of the frame.

Reimplemented from SickToolbox::SickMessage< SICK_LMS_1XX_MSG_HEADER_LEN, SICK_LMS_1XX_MSG_PAYLOAD_MAX_LEN, SICK_LMS_1XX_MSG_TRAILER_LEN >.

Definition at line 187 of file SickLMS1xxMessage.cc.

Member Data Documentation

std::string SickToolbox::SickLMS1xxMessage::_command
private

Command associated w/ message

Definition at line 77 of file SickLMS1xxMessage.hh.

std::string SickToolbox::SickLMS1xxMessage::_command_type
private

Command type associated w/ message

Definition at line 74 of file SickLMS1xxMessage.hh.


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


sicktoolbox
Author(s): Jason Derenick , Thomas Miller
autogenerated on Tue Sep 10 2019 03:37:34