IQRF Gateway Daemon
|
IMessaging interface. More...
#include <IMessaging.h>
Public Types | |
typedef std::basic_string< unsigned char > | ustring |
typedef std::function< void(const ustring &)> | MessageHandlerFunc |
Incoming message handler functional type. More... | |
Public Member Functions | |
virtual void | start ()=0 |
Start Messaging instance. More... | |
virtual void | stop ()=0 |
Stop Messaging instance. More... | |
virtual void | update (const rapidjson::Value &cfg)=0 |
Update configuration. More... | |
virtual const std::string & | getName () const =0 |
Get name of the instance. More... | |
virtual void | registerMessageHandler (MessageHandlerFunc hndl)=0 |
Register message handler. More... | |
virtual void | unregisterMessageHandler ()=0 |
Unregister message handler. More... | |
virtual void | sendMessage (const ustring &msg)=0 |
send message More... | |
virtual | ~IMessaging () |
IMessaging interface.
Provides interface for sending/receiving message from/to general communication interface
typedef std::function<void(const ustring&)> IMessaging::MessageHandlerFunc |
Incoming message handler functional type.
typedef std::basic_string<unsigned char> IMessaging::ustring |
|
inlinevirtual |
|
pure virtual |
Get name of the instance.
Returns unique name of the instance
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.
|
pure virtual |
Register message handler.
[in] | hndl | registering handler function |
Whenever a message is received it is passed to the handler function. It is possible to register just one handler
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.
|
pure virtual |
send message
[in] | msg | message to be sent |
The message is send outside
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.
|
pure virtual |
Start Messaging instance.
Messaging implementation starts to listen incoming messages an is ready to send
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.
|
pure virtual |
Stop Messaging instance.
Messaging implementation stops its job
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.
|
pure virtual |
Unregister message handler.
If the handler is not required anymore, it is possible to unregister via this method.
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.
|
pure virtual |
Update configuration.
[in] | cfg | configuration data |
Configuration data are taken from passed cfg and the instance is configured accordingly
Implemented in MqttMessaging, UdpMessaging, and MqMessaging.