MQTT far layer.
More...
#include <mqtt.hpp>
|
| void | connectedCb () |
| | Signalizes successful initial connection to broker. More...
|
| |
| void | subDataCb (const std::string &topic, const std::string &payload) |
| | Callback for underlaying adapter to receive subscribe data. More...
|
| |
MQTT far layer.
Definition at line 25 of file mqtt.hpp.
◆ MQTT()
| SPSP::FarLayers::MQTT::MQTT::MQTT |
( |
IAdapter & |
adapter, |
|
|
const Config & |
conf |
|
) |
| |
Constructs a new MQTT layer object.
Block until connection is successfully made.
- Parameters
-
| adapter | MQTT low-level adapter |
| conf | Configuration |
- Exceptions
-
◆ ~MQTT()
| SPSP::FarLayers::MQTT::MQTT::~MQTT |
( |
| ) |
|
Destroys MQTT layer object.
◆ connectedCb()
| void SPSP::FarLayers::MQTT::MQTT::connectedCb |
( |
| ) |
|
|
protected |
Signalizes successful initial connection to broker.
◆ publish()
| bool SPSP::FarLayers::MQTT::MQTT::publish |
( |
const std::string & |
src, |
|
|
const std::string & |
topic, |
|
|
const std::string & |
payload |
|
) |
| |
|
virtual |
Publishes message coming from node.
- Parameters
-
| src | Source address |
| topic | Topic |
| payload | Payload (data) |
- Returns
- true Delivery successful
-
false Delivery failed
Implements SPSP::IFarLayer.
◆ subDataCb()
| void SPSP::FarLayers::MQTT::MQTT::subDataCb |
( |
const std::string & |
topic, |
|
|
const std::string & |
payload |
|
) |
| |
|
protected |
Callback for underlaying adapter to receive subscribe data.
- Parameters
-
| topic | Topic |
| payload | Payload |
◆ subscribe()
| bool SPSP::FarLayers::MQTT::MQTT::subscribe |
( |
const std::string & |
topic | ) |
|
|
virtual |
Subscribes to given topic.
Should be used by INode only!
- Parameters
-
- Returns
- true Subscribe successful
-
false Subscribe failed
Implements SPSP::IFarLayer.
◆ unsubscribe()
| bool SPSP::FarLayers::MQTT::MQTT::unsubscribe |
( |
const std::string & |
topic | ) |
|
|
virtual |
Unsubscribes from given topic.
Should be used by INode only!
- Parameters
-
- Returns
- true Unsubscribe successful
-
false Unsubscribe failed
Implements SPSP::IFarLayer.
The documentation for this class was generated from the following file: