Satellite-Gateway
HdlcdClientHandlerCollection.h
Go to the documentation of this file.
1 
24 #ifndef HDLCD_CLIENT_HANDLER_COLLECTION_H
25 #define HDLCD_CLIENT_HANDLER_COLLECTION_H
26 
27 #include <memory>
28 #include <vector>
29 #include <map>
30 #include <string>
31 #include <boost/asio.hpp>
32 #include "HdlcdPacketData.h"
35 class HdlcdClientHandler;
36 
38 public:
39  // CTOR, initializer, and resetter
40  HdlcdClientHandlerCollection(boost::asio::io_service& a_IOService);
41  void Initialize(std::shared_ptr<ConfigServerHandlerCollection> a_ConfigServerHandlerCollection,
42  std::shared_ptr<GatewayClientHandlerCollection> a_GatewayClientHandlerCollection);
43  void SystemShutdown();
44 
45  // Methods to be called by a configuration server entity
46  void CleanAll();
47  void CreateHdlcdClient (const std::string &a_RemoteAddress, uint16_t a_TcpPortNbr, uint16_t a_SerialPortNbr);
48  void DestroyHdlcdClient(uint16_t a_SerialPortNbr);
49  void SuspendHdlcdClient(uint16_t a_SerialPortNbr);
50  void ResumeHdlcdClient (uint16_t a_SerialPortNbr);
51 
52  // Methods to be called by a gateway client entity
53  void SendPacket(uint16_t a_SerialPortNbr, const std::vector<unsigned char> &a_Payload);
54 
55 private:
56  // Members
57  boost::asio::io_service& m_IOService;
58  std::shared_ptr<ConfigServerHandlerCollection> m_ConfigServerHandlerCollection;
59  std::shared_ptr<GatewayClientHandlerCollection> m_GatewayClientHandlerCollection;
60 
61  // The map of HDLCd client handler entities
62  std::map<uint16_t, std::shared_ptr<HdlcdClientHandler>> m_HdlcdClientHandlerMap;
63 };
64 
65 #endif // HDLCD_CLIENT_HANDLER_COLLECTION_H
void Initialize(std::shared_ptr< ConfigServerHandlerCollection > a_ConfigServerHandlerCollection, std::shared_ptr< GatewayClientHandlerCollection > a_GatewayClientHandlerCollection)
void ResumeHdlcdClient(uint16_t a_SerialPortNbr)
void DestroyHdlcdClient(uint16_t a_SerialPortNbr)
void CreateHdlcdClient(const std::string &a_RemoteAddress, uint16_t a_TcpPortNbr, uint16_t a_SerialPortNbr)
void SuspendHdlcdClient(uint16_t a_SerialPortNbr)
HdlcdClientHandlerCollection(boost::asio::io_service &a_IOService)
void SendPacket(uint16_t a_SerialPortNbr, const std::vector< unsigned char > &a_Payload)
Copyright (c) 2016, Florian Evers, florian-evers@gmx.de All rights reserved.