BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Protected Member Functions
BeeeOn::GWSCommandHandler Class Reference

Handle requests to the remote server: More...

#include <GWSCommandHandler.h>

Inheritance diagram for BeeeOn::GWSCommandHandler:
BeeeOn::CommandHandler BeeeOn::GWSListener BeeeOn::Loggable

Public Types

typedef Poco::SharedPtr
< GWSCommandHandler
Ptr
 
- Public Types inherited from BeeeOn::GWSListener
typedef Poco::SharedPtr
< GWSListener
Ptr
 

Public Member Functions

void setConnector (GWSConnector::Ptr connector)
 
bool accept (const Command::Ptr cmd) override
 
void handle (Command::Ptr cmd, Answer::Ptr answer) override
 
void onResponse (const GWResponse::Ptr response) override
 Check whether the responses associated with a pending command. If it is, update its result according to the response contents.
 
- Public Member Functions inherited from BeeeOn::GWSListener
virtual void onConnected (const Address &address)
 Fired when the connection to the remote server is successfully created and it is possible to exchange messages.
 
virtual void onDisconnected (const Address &address)
 Fired when the connection to the remote server is considered broken or when it is disconnected on a request.
 
virtual void onRequest (const GWRequest::Ptr request)
 When a request is received, this event is fired.
 
virtual void onAck (const GWAck::Ptr ack)
 When an ack is received, this event is fired.
 
virtual void onOther (const GWMessage::Ptr other)
 When a message other then request, response or ack is received, this event is fired.
 
virtual void onTrySend (const GWMessage::Ptr message)
 Fire when a message is about to be sent to the server. After the send is successful (no network failure), the GWSListener::onSend() event would be generated as well.
 
virtual void onSent (const GWMessage::Ptr message)
 Fire when a message is being sent to the server. There might be a delay between putting a messing into an output queue and the actual sending process. This event allows to track such delay.
 

Protected Member Functions

void handleNewDevice (NewDeviceCommand::Ptr cmd, Answer::Ptr answer)
 
void handleDeviceList (ServerDeviceListCommand::Ptr cmd, Answer::Ptr answer)
 
void handleLastValue (ServerLastValueCommand::Ptr cmd, Answer::Ptr answer)
 
void sendRequest (GWRequest::Ptr request, Result::Ptr answer)
 
void sendRequestUnsafe (GWRequest::Ptr request, Result::Ptr answer)
 
void onSpecificResponse (const GWResponse::Ptr response, Result::Ptr result)
 
void onDeviceListResponse (const GWDeviceListResponse::Ptr response, Result::Ptr result)
 
void onLastValueResponse (const GWLastValueResponse::Ptr response, Result::Ptr result)
 

Detailed Description

Handle requests to the remote server:

The commands are converted to the appropriate GWMessage representations and sent to the remote server. Received responses are used to update the associated Answer and Result instances.


The documentation for this class was generated from the following files: