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

The GWServerConnector allows the BeeeOn Gateway to communicate with the BeeeOn Server using WebSocket. It automatically connects and registers the gateway after start or connection loss. More...

#include <GWServerConnector.h>

Inheritance diagram for BeeeOn::GWServerConnector:
BeeeOn::StoppableLoop BeeeOn::CommandSender BeeeOn::CommandHandler BeeeOn::Exporter BeeeOn::Loggable

Public Types

typedef Poco::SharedPtr
< GWServerConnector
Ptr
 
- Public Types inherited from BeeeOn::StoppableLoop
typedef Poco::SharedPtr
< StoppableLoop
Ptr
 

Public Member Functions

void start () override
 
void stop () override
 
void setHost (const std::string &host)
 
void setPort (int port)
 
void setPollTimeout (const Poco::Timespan &timeout)
 
void setReceiveTimeout (const Poco::Timespan &timeout)
 
void setSendTimeout (const Poco::Timespan &timeout)
 
void setRetryConnectTimeout (const Poco::Timespan &timeout)
 
void setBusySleep (const Poco::Timespan &timeout)
 
void setResendTimeout (const Poco::Timespan &timeout)
 
void setMaxMessageSize (int size)
 
void setGatewayInfo (Poco::SharedPtr< GatewayInfo > info)
 
void setSSLConfig (Poco::SharedPtr< SSLClient > config)
 
void setInactiveMultiplier (int multiplier)
 
bool accept (const Command::Ptr cmd) override
 
void handle (Command::Ptr cmd, Answer::Ptr answer) override
 
bool ship (const SensorData &data) override
 
- Public Member Functions inherited from BeeeOn::CommandSender
void setCommandDispatcher (CommandDispatcher *dispatcher)
 
void dispatch (Poco::AutoPtr< Command > cmd, Poco::AutoPtr< Answer > answer)
 
void dispatch (Poco::AutoPtr< Command > cmd)
 
AnswerQueueanswerQueue ()
 

Additional Inherited Members

- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 
- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Detailed Description

The GWServerConnector allows the BeeeOn Gateway to communicate with the BeeeOn Server using WebSocket. It automatically connects and registers the gateway after start or connection loss.

There are 2 threads: sender and receiver. Sender's responsibility is reconnecting to server and sending messages. Receiver's responsibility is to to receive messages from server and handling them.

Member Function Documentation

bool GWServerConnector::ship ( const SensorData data)
overridevirtual

Ensures export data in best effort to target destination

Returns
true when successfully shipped (this is kind of a guarantee that the caller doesn't have to care about the data anymore).
false when the Exporter cannot ship data temporarily (e.g. full output buffers).
Exceptions
Poco::IOExceptionwhen a serious issue caused the Exporter to deny its service.

Implements BeeeOn::Exporter.

void GWServerConnector::start ( )
overridevirtual

Starts the loop to process in an internally managed thread.

Implements BeeeOn::StoppableLoop.

void GWServerConnector::stop ( )
overridevirtual

Stop the loop and wait until finished.

Implements BeeeOn::StoppableLoop.


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