Public Member Functions | Private Member Functions | Private Attributes | List of all members
SopasEventMessage Class Reference

Class that represents a message that was sent by a sensor. (Event message) More...

#include <sick_scan_common_nw.h>

Public Member Functions

std::string getCommandString () const
 Returns two character long command. More...
 
BYTEgetPayLoad ()
 contains 's' + command string(2 byte) + content(payload length - 3) More...
 
UINT32 getPayLoadLength () const
 contains 's' + command string(2 byte) + content(payload length - 3) More...
 
SopasProtocol getProtocolType () const
 
BYTEgetRawData ()
 get SOPAS raw data include header and CRC More...
 
INT32 getVariableIndex ()
 Returns the index of a variable (answer to read variable by index). In case of error a negative value will be returned. More...
 
std::string getVariableName ()
 Returns the name of a variable (answer to read variable by name). In case of error an empty value will be returned. More...
 
bool isValid () const
 
UINT32 size () const
 
 SopasEventMessage ()
 Default constructor. More...
 
 SopasEventMessage (BYTE *buffer, SopasProtocol protocol, UINT32 frameLength)
 Constructor. This class will only store a pointer to the byte buffer. It will not deallocate the memory. Please make sure that the buffer is not deallocated while you are working with this class. More...
 
 ~SopasEventMessage ()
 Destructor. More...
 

Private Member Functions

void detectEncoding ()
 
void detectMessageType ()
 

Private Attributes

BYTEm_buffer
 
UINT32 m_frameLength
 
SopasProtocol m_protocol
 

Detailed Description

Class that represents a message that was sent by a sensor. (Event message)

Definition at line 130 of file sick_scan_common_nw.h.

Constructor & Destructor Documentation

SopasEventMessage::SopasEventMessage ( )

Default constructor.

Definition at line 512 of file sick_scan_common_nw.cpp.

SopasEventMessage::~SopasEventMessage ( )
inline

Destructor.

Definition at line 137 of file sick_scan_common_nw.h.

SopasEventMessage::SopasEventMessage ( BYTE buffer,
SopasProtocol  protocol,
UINT32  frameLength 
)

Constructor. This class will only store a pointer to the byte buffer. It will not deallocate the memory. Please make sure that the buffer is not deallocated while you are working with this class.

Parameters
bufferbyte buffer with the message (Sopas frame)
protocoltype of protocol (Cola-A, Cola-B)
frameLengthlength of the frame

Definition at line 518 of file sick_scan_common_nw.cpp.

Member Function Documentation

void SopasEventMessage::detectEncoding ( )
private
void SopasEventMessage::detectMessageType ( )
private
std::string SopasEventMessage::getCommandString ( ) const

Returns two character long command.

Returns
string container command

Returns the core command of a sopas message (e.g. "WN") for ..sWN <whatever>

Definition at line 549 of file sick_scan_common_nw.cpp.

BYTE * SopasEventMessage::getPayLoad ( )

contains 's' + command string(2 byte) + content(payload length - 3)

Returns a pointer to the first payload byte.

Returns
Pointer to payload part of message

Returns a pointer to the first payload byte. CoLa-A: Points beyond the leading "0x02" to the "s..." data. CoLa-B: Points beyond the magic word and length bytes, to the "s..." data.

Definition at line 573 of file sick_scan_common_nw.cpp.

UINT32 SopasEventMessage::getPayLoadLength ( ) const

contains 's' + command string(2 byte) + content(payload length - 3)

Definition at line 525 of file sick_scan_common_nw.cpp.

SopasProtocol SopasEventMessage::getProtocolType ( void  ) const
inline

Definition at line 149 of file sick_scan_common_nw.h.

BYTE * SopasEventMessage::getRawData ( )

get SOPAS raw data include header and CRC

Returns
Pointer to raw data message

The raw data is stored in m_buffer. This function returns a pointer to this buffer.

Definition at line 597 of file sick_scan_common_nw.cpp.

INT32 SopasEventMessage::getVariableIndex ( )

Returns the index of a variable (answer to read variable by index). In case of error a negative value will be returned.

Definition at line 605 of file sick_scan_common_nw.cpp.

std::string SopasEventMessage::getVariableName ( )

Returns the name of a variable (answer to read variable by name). In case of error an empty value will be returned.

bool SopasEventMessage::isValid ( ) const
inline

Definition at line 176 of file sick_scan_common_nw.h.

UINT32 SopasEventMessage::size ( ) const
inline

Definition at line 155 of file sick_scan_common_nw.h.

Member Data Documentation

BYTE* SopasEventMessage::m_buffer
private

Definition at line 185 of file sick_scan_common_nw.h.

UINT32 SopasEventMessage::m_frameLength
private

Definition at line 187 of file sick_scan_common_nw.h.

SopasProtocol SopasEventMessage::m_protocol
private

Definition at line 186 of file sick_scan_common_nw.h.


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


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Wed May 5 2021 03:05:48