Class that represents a message that was sent by a sensor. (Event message) More...
#include <SopasBase.hpp>
Public Member Functions | |
std::string | getCommandString () const |
SopasBase::SopasEncoding | getEncodingType () const |
SopasBase::SopasMessageType | getMessageType () const |
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... | |
SopasBase::SopasProtocol | getProtocolType () const |
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, SopasBase::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 |
SopasBase::SopasEncoding | m_encoding |
UINT32 | m_frameLength |
SopasBase::SopasMessageType | m_messageType |
SopasBase::SopasProtocol | m_protocol |
Class that represents a message that was sent by a sensor. (Event message)
Definition at line 416 of file SopasBase.hpp.
SopasEventMessage::SopasEventMessage | ( | ) |
Default constructor.
Definition at line 2156 of file SopasBase.cpp.
|
inline |
Destructor.
Definition at line 423 of file SopasBase.hpp.
SopasEventMessage::SopasEventMessage | ( | BYTE * | buffer, |
SopasBase::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 2163 of file SopasBase.cpp.
|
private |
Definition at line 2299 of file SopasBase.cpp.
|
private |
Definition at line 2311 of file SopasBase.cpp.
std::string SopasEventMessage::getCommandString | ( | ) | const |
Definition at line 2190 of file SopasBase.cpp.
|
inline |
Definition at line 439 of file SopasBase.hpp.
|
inline |
Definition at line 444 of file SopasBase.hpp.
BYTE * SopasEventMessage::getPayLoad | ( | ) |
contains 's' + command string(2 byte) + content(payload length - 3)
Definition at line 2212 of file SopasBase.cpp.
UINT32 SopasEventMessage::getPayLoadLength | ( | ) | const |
contains 's' + command string(2 byte) + content(payload length - 3)
Definition at line 2172 of file SopasBase.cpp.
|
inline |
Definition at line 434 of file SopasBase.hpp.
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 2231 of file SopasBase.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.
Definition at line 2261 of file SopasBase.cpp.
|
inline |
Definition at line 468 of file SopasBase.hpp.
|
inline |
Definition at line 449 of file SopasBase.hpp.
|
private |
Definition at line 476 of file SopasBase.hpp.
|
private |
Definition at line 479 of file SopasBase.hpp.
|
private |
Definition at line 478 of file SopasBase.hpp.
|
private |
Definition at line 480 of file SopasBase.hpp.
|
private |
Definition at line 477 of file SopasBase.hpp.