Initial Commit

This commit is contained in:
2020-06-12 11:31:09 +02:00
commit 859e336eca
14 changed files with 365 additions and 0 deletions
+36
View File
@@ -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