Initial Commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#ifndef MQTT_H
|
||||
#define MQTT_H
|
||||
|
||||
#include "Message.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace MQTT {
|
||||
|
||||
class MQTTImpl;
|
||||
|
||||
class MQTT
|
||||
{
|
||||
public:
|
||||
MQTT(const std::string& hostname, int port);
|
||||
~MQTT();
|
||||
|
||||
public:
|
||||
typedef std::function<void(const Message&)> CallbackMethod;
|
||||
|
||||
public:
|
||||
bool Send(const Message& message);
|
||||
bool Subscribe(const std::string& topic);
|
||||
void Unsubscribe(const std::string& topic);
|
||||
size_t Connect(CallbackMethod function);
|
||||
void Disconnect(size_t connection);
|
||||
|
||||
private:
|
||||
std::unique_ptr<MQTTImpl> m_pMQTTImpl;
|
||||
};
|
||||
|
||||
} // namespace MQTT
|
||||
|
||||
#endif // MQTT_H
|
||||
Reference in New Issue
Block a user