#include <nrp_mqtt_client.h>
|
| NRPMQTTClient (nlohmann::json clientParams) |
|
| NRPMQTTClient () |
|
virtual | ~NRPMQTTClient ()=default |
|
virtual void | subscribe (const std::string &address, const std::function< void(const std::string &)> &callback) |
| Subscribe to MQTT topic 'address' with callback function 'callback'. More...
|
|
virtual void | publish (const std::string &address, const std::string &msg, bool retained=false) |
| Publishes 'msg' to MQTT topic 'address'. More...
|
|
void | publishDirect (const std::string &address, const std::string &msg) |
| Publishes 'msg' directly to subscriber callbacks, without going through the MQTT broker. Only for testing. More...
|
|
virtual void | disconnect () |
| Disconnects client from MQTT Broker. More...
|
|
virtual bool | isConnected () |
| Check connection status to broker. More...
|
|
virtual void | clearRetained () |
| Clear all topics with retain messages by sending an empty msg. More...
|
|
◆ NRPMQTTClient() [1/2]
◆ NRPMQTTClient() [2/2]
NRPMQTTClient::NRPMQTTClient |
( |
| ) |
|
◆ ~NRPMQTTClient()
virtual NRPMQTTClient::~NRPMQTTClient |
( |
| ) |
|
|
virtualdefault |
◆ clearRetained()
void NRPMQTTClient::clearRetained |
( |
| ) |
|
|
virtual |
Clear all topics with retain messages by sending an empty msg.
◆ disconnect()
void NRPMQTTClient::disconnect |
( |
| ) |
|
|
virtual |
Disconnects client from MQTT Broker.
◆ isConnected()
bool NRPMQTTClient::isConnected |
( |
| ) |
|
|
virtual |
Check connection status to broker.
◆ publish()
void NRPMQTTClient::publish |
( |
const std::string & |
address, |
|
|
const std::string & |
msg, |
|
|
bool |
retained = false |
|
) |
| |
|
virtual |
Publishes 'msg' to MQTT topic 'address'.
◆ publishDirect()
void NRPMQTTClient::publishDirect |
( |
const std::string & |
address, |
|
|
const std::string & |
msg |
|
) |
| |
Publishes 'msg' directly to subscriber callbacks, without going through the MQTT broker. Only for testing.
◆ subscribe()
void NRPMQTTClient::subscribe |
( |
const std::string & |
address, |
|
|
const std::function< void(const std::string &)> & |
callback |
|
) |
| |
|
virtual |
Subscribe to MQTT topic 'address' with callback function 'callback'.
The documentation for this class was generated from the following files: