Commit Iniziale
This commit is contained in:
23
com/mqtt_callback.h
Normal file
23
com/mqtt_callback.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef MQTT_CALLBACK_H
|
||||
#define MQTT_CALLBACK_H
|
||||
|
||||
#include <mqtt/client.h>
|
||||
#include <mqtt/callback.h>
|
||||
#include <spdlog/logger.h>
|
||||
|
||||
class mqtt_callback : public virtual mqtt::callback {
|
||||
|
||||
private:
|
||||
mqtt::async_client *cli_ = nullptr;
|
||||
std::shared_ptr<spdlog::logger> log_;
|
||||
|
||||
public:
|
||||
mqtt_callback(mqtt::async_client *cli, std::shared_ptr<spdlog::logger> log);
|
||||
|
||||
void connected(const mqtt::string &cause) override;
|
||||
void connection_lost(const mqtt::string &cause) override;
|
||||
void message_arrived(mqtt::const_message_ptr msg) override;
|
||||
void delivery_complete(mqtt::delivery_token_ptr tok) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user