Satellite-Gateway
HdlcdClientHandler.h
Go to the documentation of this file.
1 
24 #ifndef HDLCD_CLIENT_HANDLER_H
25 #define HDLCD_CLIENT_HANDLER_H
26 
27 #include <memory>
28 #include <vector>
29 #include <string>
30 #include <boost/asio.hpp>
34 class HdlcdClient;
35 
37 public:
38  HdlcdClientHandler(boost::asio::io_service& a_IOService, std::shared_ptr<ConfigServerHandlerCollection> a_ConfigServerHandlerCollection,
39  std::shared_ptr<GatewayClientHandlerCollection> a_GatewayClientHandlerCollection, const std::string& a_RemoteAddress, uint16_t a_TcpPortNbr, uint16_t a_SerialPortNbr);
40  void Close();
41  void Suspend();
42  void Resume();
43  void SendPacket(const std::vector<unsigned char> &a_Payload);
44 
45 private:
46  // Helpers
47  void ResolveDestination();
48 
49  // Members
50  boost::asio::io_service& m_IOService;
51  std::shared_ptr<ConfigServerHandlerCollection> m_ConfigServerHandlerCollection;
52  std::shared_ptr<GatewayClientHandlerCollection> m_GatewayClientHandlerCollection;
53  HdlcdClientConnectGuard m_HdlcdClientConnectGuard;
54 
55  const std::string m_RemoteAddress;
56  const uint16_t m_TcpPortNbr;
57  const uint16_t m_SerialPortNbr;
58 
59  // Resolver
60  boost::asio::ip::tcp::resolver m_Resolver;
61  boost::asio::deadline_timer m_ConnectionRetryTimer;
62 
63  // The connection to the HDLC Daemon
64  std::shared_ptr<HdlcdClient> m_HdlcdClient;
65 
66  // Flags
67  bool m_bSuspendSerialPort;
68 };
69 
70 #endif // HDLCD_CLIENT_HANDLER_H
Class HdlcdClient.
Definition: HdlcdClient.h:60
HdlcdClientHandler(boost::asio::io_service &a_IOService, std::shared_ptr< ConfigServerHandlerCollection > a_ConfigServerHandlerCollection, std::shared_ptr< GatewayClientHandlerCollection > a_GatewayClientHandlerCollection, const std::string &a_RemoteAddress, uint16_t a_TcpPortNbr, uint16_t a_SerialPortNbr)
void SendPacket(const std::vector< unsigned char > &a_Payload)