2016-05-12 22:45:40 +02:00
|
|
|
/** @file
|
|
|
|
* @author Edouard DUPIN
|
|
|
|
* @copyright 2016, Edouard DUPIN, all right reserved
|
|
|
|
* @license APACHE v2.0 (see license file)
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <jus/TcpString.h>
|
|
|
|
#include <ememory/memory.h>
|
2016-05-22 22:40:42 +02:00
|
|
|
#include <esignal/Signal.h>
|
|
|
|
#include <ejson/ejson.h>
|
2016-05-12 22:45:40 +02:00
|
|
|
|
|
|
|
namespace jus {
|
2016-05-22 22:40:42 +02:00
|
|
|
class GateWay;
|
2016-05-12 22:45:40 +02:00
|
|
|
class GateWayService {
|
2016-05-22 22:40:42 +02:00
|
|
|
private:
|
|
|
|
jus::GateWay* m_gatewayInterface;
|
2016-05-12 22:45:40 +02:00
|
|
|
std::string m_name;
|
|
|
|
public:
|
2016-05-22 22:40:42 +02:00
|
|
|
jus::TcpString m_interfaceClient;
|
|
|
|
esignal::Signal<bool> signalIsConnected;
|
|
|
|
esignal::Connection m_dataCallback;
|
|
|
|
public:
|
|
|
|
GateWayService(jus::GateWay* _gatewayInterface);
|
2016-05-12 22:45:40 +02:00
|
|
|
virtual ~GateWayService();
|
2016-05-22 22:40:42 +02:00
|
|
|
void start(const std::string& _ip, uint16_t _port);
|
|
|
|
void stop();
|
|
|
|
void onClientData(const std::string& _value);
|
|
|
|
public:
|
|
|
|
void SendData(size_t _userSessionId, ejson::Object _data);
|
|
|
|
const std::string& getName() {
|
|
|
|
return m_name;
|
|
|
|
}
|
2016-05-12 22:45:40 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|