Satellite-Gateway
GatewayClientHandler.h
Go to the documentation of this file.
1 
24 #ifndef GATEWAY_CLIENT_HANDLER_H
25 #define GATEWAY_CLIENT_HANDLER_H
26 
27 #include <memory>
28 #include <boost/asio.hpp>
29 #include <string>
33 class GatewayFrame;
34 class GatewayClient;
35 
37 public:
38  // CTOR, initializer, and resetter
39  GatewayClientHandler(boost::asio::io_service& a_IOService, std::shared_ptr<ConfigServerHandlerCollection> a_ConfigServerHandlerCollection,
40  std::shared_ptr<HdlcdClientHandlerCollection> a_HdlcdClientHandlerCollection, uint16_t a_ReferenceNbr,
41  std::string a_RemoteAddress, uint16_t a_RemotePortNbr);
42  void Close();
43  uint16_t GetReferenceNbr() const { return m_ReferenceNbr; }
44 
45  // Methods to be called by a HDLCd client entity
46  void SendPacket(uint16_t a_SerialPortNbr, const std::vector<unsigned char> &a_Payload);
47 
48 private:
49  // Helpers
50  void ResolveDestination();
51 
52  // Members
53  boost::asio::io_service& m_IOService;
54  std::shared_ptr<ConfigServerHandlerCollection> m_ConfigServerHandlerCollection;
55  std::shared_ptr<HdlcdClientHandlerCollection> m_HdlcdClientHandlerCollection;
56  GatewayClientConnectGuard m_GatewayClientConnectGuard;
57  std::string m_RemoteAddress;
58  uint16_t m_RemotePortNbr;
59 
60  std::shared_ptr<GatewayClient> m_GatewayClient;
61  uint16_t m_ReferenceNbr;
62 
63  // Resolver
64  boost::asio::ip::tcp::resolver m_Resolver;
65  boost::asio::deadline_timer m_ConnectionRetryTimer;
66 };
67 
68 #endif // GATEWAY_CLIENT_HANDLER_H
uint16_t GetReferenceNbr() const
GatewayClientHandler(boost::asio::io_service &a_IOService, std::shared_ptr< ConfigServerHandlerCollection > a_ConfigServerHandlerCollection, std::shared_ptr< HdlcdClientHandlerCollection > a_HdlcdClientHandlerCollection, uint16_t a_ReferenceNbr, std::string a_RemoteAddress, uint16_t a_RemotePortNbr)
void SendPacket(uint16_t a_SerialPortNbr, const std::vector< unsigned char > &a_Payload)