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... | |
| BYTE * | getPayLoad () |
| 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 |
| BYTE * | getRawData () |
| 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 | |
| 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 130 of file sick_scan_common_nw.h.
| SopasEventMessage::SopasEventMessage | ( | ) |
Default constructor.
Definition at line 512 of file sick_scan_common_nw.cpp.
|
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.
| buffer | byte buffer with the message (Sopas frame) |
| protocol | type of protocol (Cola-A, Cola-B) |
| frameLength | length of the frame |
Definition at line 518 of file sick_scan_common_nw.cpp.
|
private |
|
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 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 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.
|
inline |
Definition at line 149 of file sick_scan_common_nw.h.
| BYTE * SopasEventMessage::getRawData | ( | ) |
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 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.
|
inline |
Definition at line 176 of file sick_scan_common_nw.h.
|
inline |
Definition at line 155 of file sick_scan_common_nw.h.
|
private |
Definition at line 185 of file sick_scan_common_nw.h.
|
private |
Definition at line 187 of file sick_scan_common_nw.h.
|
private |
Definition at line 186 of file sick_scan_common_nw.h.