![]() |
BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
Represents an acknowledgement, that a response of the given id and status has been really delivered. It is intended to handle unreliable network connections. More...
#include <GWAck.h>
Public Types | |
typedef Poco::SharedPtr< GWAck > | Ptr |
![]() | |
typedef Poco::SharedPtr < GWMessage > | Ptr |
Public Member Functions | |
GWAck (const Poco::JSON::Object::Ptr object) | |
void | setStatus (GWResponse::Status status) |
Set a status intended to match a proper response. | |
GWResponse::Status | status () const |
Returns a status intended to match a proper response. | |
![]() | |
void | setID (const GlobalID &id) |
Set unique identifier intended to match request message with its response. | |
GlobalID | id () const |
Return unique identifier intended to match request message with its response. | |
GWMessageType | type () const |
Returns the type of the message. | |
std::string | toString () const |
Returns the string representation of the message. | |
std::string | toBriefString () const |
Protected Member Functions | |
GWAck (const GWMessageTypeEnum::Raw &type) | |
![]() | |
GWMessage (const GWMessageType::Raw &type) | |
Constructs a GWMessage depending on the given type. More... | |
GWMessage (const Poco::JSON::Object::Ptr object) | |
Constructs a GWMessage from the JSON::Object. | |
Poco::JSON::Object::Ptr | json () const |
Additional Inherited Members | |
![]() | |
static GWMessage::Ptr | fromJSON (const std::string &json) |
Factory method for creating subclasses of the GWMessage from the json string. More... | |
static GWMessage::Ptr | fromJSON (Poco::JSON::Object::Ptr object) |
Factory method for creating subclasses of the GWMessage from the JSON::Object. More... | |
Represents an acknowledgement, that a response of the given id and status has been really delivered. It is intended to handle unreliable network connections.
There can be more responses with the same id, so status is also needed to identify and confirm proper response.
An example of an ack message:
{ "message_type": "generic_ack", "id": "4c42288f-d592-4d6a-b401-0c2ef47c6d6d", "status": 0 }