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. | |
BYTE * | getPayLoad () |
contains 's' + command string(2 byte) + content(payload length - 3) | |
UINT32 | getPayLoadLength () const |
contains 's' + command string(2 byte) + content(payload length - 3) | |
SopasProtocol | getProtocolType () const |
BYTE * | getRawData () |
get SOPAS raw data include header and CRC | |
INT32 | getVariableIndex () |
Returns the index of a variable (answer to read variable by index). In case of error a negative value will be returned. | |
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. | |
bool | isValid () const |
UINT32 | size () const |
SopasEventMessage () | |
Default constructor. | |
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. | |
~SopasEventMessage () | |
Destructor. | |
Private Member Functions | |
void | detectEncoding () |
void | detectMessageType () |
Private Attributes | |
BYTE * | m_buffer |
UINT32 | m_frameLength |
SopasProtocol | m_protocol |
Class that represents a message that was sent by a sensor. (Event message)
Definition at line 123 of file sick_scan_common_nw.h.
Default constructor.
Definition at line 509 of file sick_scan_common_nw.cpp.
SopasEventMessage::~SopasEventMessage | ( | ) | [inline] |
Destructor.
Definition at line 130 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.
buffer | byte buffer with the message (Sopas frame) |
protocol | type of protocol (Cola-A, Cola-B) |
frameLength | length of the frame |
Definition at line 516 of file sick_scan_common_nw.cpp.
void SopasEventMessage::detectEncoding | ( | ) | [private] |
void SopasEventMessage::detectMessageType | ( | ) | [private] |
std::string SopasEventMessage::getCommandString | ( | ) | const |
Returns two character long command.
Returns the core command of a sopas message (e.g. "WN") for ..sWN <whatever>
Definition at line 547 of file sick_scan_common_nw.cpp.
contains 's' + command string(2 byte) + content(payload length - 3)
Returns a pointer to the first payload byte.
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 572 of file sick_scan_common_nw.cpp.
UINT32 SopasEventMessage::getPayLoadLength | ( | ) | const |
contains 's' + command string(2 byte) + content(payload length - 3)
Definition at line 524 of file sick_scan_common_nw.cpp.
SopasProtocol SopasEventMessage::getProtocolType | ( | void | ) | const [inline] |
Definition at line 141 of file sick_scan_common_nw.h.
get SOPAS raw data include header and CRC
The raw data is stored in m_buffer. This function returns a pointer to this buffer.
Definition at line 596 of file sick_scan_common_nw.cpp.
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 167 of file sick_scan_common_nw.h.
UINT32 SopasEventMessage::size | ( | ) | const [inline] |
Definition at line 147 of file sick_scan_common_nw.h.
BYTE* SopasEventMessage::m_buffer [private] |
Definition at line 175 of file sick_scan_common_nw.h.
UINT32 SopasEventMessage::m_frameLength [private] |
Definition at line 177 of file sick_scan_common_nw.h.
SopasProtocol SopasEventMessage::m_protocol [private] |
Definition at line 176 of file sick_scan_common_nw.h.