Initial commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#ifndef TOON_BRIDGE_H
|
||||
#define TOON_BRIDGE_H
|
||||
|
||||
#include "MessageHandler.h"
|
||||
#include "MQTTSettings.h"
|
||||
#include "ToonSettings.h"
|
||||
#include "WebSocketSubscription.h"
|
||||
#include <HttpServer.h>
|
||||
#include <MQTT.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace ToonBridge {
|
||||
namespace Toon {
|
||||
|
||||
class Bridge
|
||||
{
|
||||
public:
|
||||
Bridge(int port, const ToonSettings& toonSettings, const MQTTSettings& mqttSettings);
|
||||
~Bridge();
|
||||
|
||||
void Wait();
|
||||
|
||||
private:
|
||||
void Start();
|
||||
|
||||
Http::HttpServer::HttpReply HttpCallback(const std::string& uri, const std::vector<Http::HttpPostData>& postData);
|
||||
void TimeToLiveCallback(WebSocketSubscription* pSubscription, int timeToLive);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Http::HttpServer> m_pHttpServer;
|
||||
MQTT::MQTT m_mqttClient;
|
||||
MessageHandler m_messageHandler;
|
||||
|
||||
int m_port;
|
||||
ToonSettings m_toonSettings;
|
||||
MQTTSettings m_mqttSettings;
|
||||
std::unique_ptr<WebSocketSubscription> m_pWebSocketSubscription;
|
||||
};
|
||||
|
||||
} // namespace Toon
|
||||
} // namespace ToonBridge
|
||||
|
||||
#endif // TOON_BRIDGE_H
|
||||
Reference in New Issue
Block a user