Class SopasEventMessage

Class Documentation

class SopasEventMessage

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

Public Functions

SopasEventMessage()

Default constructor.

inline ~SopasEventMessage()

Destructor.

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.

Parameters:
  • buffer – byte buffer with the message (Sopas frame)

  • protocol – type of protocol (Cola-A, Cola-B)

  • frameLength – length of the frame

inline SopasBase::SopasProtocol getProtocolType() const
inline SopasBase::SopasEncoding getEncodingType() const
inline SopasBase::SopasMessageType getMessageType() const
inline UINT32 size() const
UINT32 getPayLoadLength() const

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

std::string getCommandString() const
BYTE *getPayLoad()

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

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.

inline bool isValid() const