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>
|
|
|
|
#include <esignal/Signal.h>
|
2016-05-22 22:40:42 +02:00
|
|
|
#include <jus/GateWayService.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 GateWayClient {
|
2016-05-22 22:40:42 +02:00
|
|
|
private:
|
|
|
|
jus::GateWay* m_gatewayInterface;
|
2016-05-12 22:45:40 +02:00
|
|
|
public:
|
|
|
|
jus::TcpString m_interfaceClient;
|
|
|
|
esignal::Signal<bool> signalIsConnected;
|
2016-05-17 22:14:02 +02:00
|
|
|
esignal::Connection m_dataCallback;
|
2016-05-22 22:40:42 +02:00
|
|
|
bool m_returnValueOk;
|
|
|
|
ejson::Object m_returnMessage;
|
|
|
|
std::vector<ememory::SharedPtr<jus::GateWayService>> m_listConnectedService;
|
|
|
|
size_t m_uid;
|
2016-05-22 23:15:09 +02:00
|
|
|
std::string m_userConnectionName;
|
2016-05-12 22:45:40 +02:00
|
|
|
public:
|
2016-05-22 22:40:42 +02:00
|
|
|
GateWayClient(jus::GateWay* _gatewayInterface);
|
2016-05-12 22:45:40 +02:00
|
|
|
virtual ~GateWayClient();
|
2016-05-22 22:40:42 +02:00
|
|
|
void start(const std::string& _ip, uint16_t _port, size_t _uid);
|
2016-05-12 22:45:40 +02:00
|
|
|
void stop();
|
2016-05-17 22:14:02 +02:00
|
|
|
void onClientData(const std::string& _value);
|
2016-05-22 22:40:42 +02:00
|
|
|
void returnMessage(ejson::Object _data);
|
2016-05-12 22:45:40 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|