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() [1/2]

SopasEventMessage::SopasEventMessage ( )

Default constructor.

Definition at line 512 of file sick_scan_common_nw.cpp.

◆ ~SopasEventMessage()

SopasEventMessage::~SopasEventMessage ( )
inline

Destructor.

Definition at line 137 of file sick_scan_common_nw.h.

◆ SopasEventMessage() [2/2]

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

◆ detectEncoding()

void SopasEventMessage::detectEncoding ( )
private

◆ detectMessageType()

void SopasEventMessage::detectMessageType ( )
private

◆ getCommandString()

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.

◆ getPayLoad()

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.

◆ getPayLoadLength()

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.

◆ getProtocolType()

SopasProtocol SopasEventMessage::getProtocolType ( ) const
inline

Definition at line 149 of file sick_scan_common_nw.h.

◆ getRawData()

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.

◆ getVariableIndex()

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.

◆ getVariableName()

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.

◆ isValid()

bool SopasEventMessage::isValid ( ) const
inline

Definition at line 176 of file sick_scan_common_nw.h.

◆ size()

UINT32 SopasEventMessage::size ( ) const
inline

Definition at line 155 of file sick_scan_common_nw.h.

Member Data Documentation

◆ m_buffer

BYTE* SopasEventMessage::m_buffer
private

Definition at line 185 of file sick_scan_common_nw.h.

◆ m_frameLength

UINT32 SopasEventMessage::m_frameLength
private

Definition at line 187 of file sick_scan_common_nw.h.

◆ m_protocol

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 Thu Sep 8 2022 02:30:19