AudioManager  7.5.11
Native Application Runtime Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CAmTelnetServer.h
Go to the documentation of this file.
1 
25 #ifndef TELNETSERVER_H_
26 #define TELNETSERVER_H_
27 
28 #include <queue>
29 #include <map>
30 #include "CAmSocketHandler.h"
31 #include "CAmTelnetMenuHelper.h"
32 
33 namespace am
34 {
35 
36 class IAmDatabaseHandler;
37 class CAmCommandSender;
38 class CAmRoutingSender;
39 class CAmControlSender;
40 class CAmCommandReceiver;
41 class CAmRoutingReceiver;
42 class CAmControlReceiver;
43 class CAmRouter;
44 class CAmTelnetMenuHelper;
45 
53 {
54 public:
55  CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSender *iCommandSender, CAmCommandReceiver *iCommandReceiver, CAmRoutingSender *iRoutingSender, CAmRoutingReceiver *iRoutingReceiver, CAmControlSender *iControlSender, CAmControlReceiver *iControlReceiver, IAmDatabaseHandler *iDatabasehandler, CAmRouter *iRouter, unsigned int servPort, unsigned int maxConnections);
57  void connectSocket(const pollfd pfd, const sh_pollHandle_t handle, void* userData);
58  void disconnectClient(int filedescriptor);
59  void receiveData(const pollfd pfd, const sh_pollHandle_t handle, void* userData);
60  bool dispatchData(const sh_pollHandle_t handle, void* userData);
61  bool check(const sh_pollHandle_t handle, void* userData);
66 private:
67 
68  typedef void (*CommandPrototype)(std::vector<std::string>& msg, int filedescriptor);
69  typedef std::map<std::string, CommandPrototype> mMapCommand_t;
70 
71  void sliceCommand(const std::string& string, std::string& command, std::queue<std::string>& msg);
72  mMapCommand_t createCommandMap();
73  struct connection_s
74  {
75  int filedescriptor;
76  sh_pollHandle_t handle;
77  };
78 
79  static CAmTelnetServer* mpInstance;
80  CAmSocketHandler *mpSocketHandler;
81  CAmCommandSender *mpCommandSender;
82  CAmCommandReceiver *mpCommandReceiver;
83  CAmRoutingSender *mpRoutingSender;
84  CAmRoutingReceiver *mpRoutingReceiver;
85  CAmControlSender *mpControlSender;
86  CAmControlReceiver *mpControlReceiver;
87  IAmDatabaseHandler *mpDatabasehandler;
88  CAmRouter *mpRouter;
89  sh_pollHandle_t mConnecthandle;
90  std::queue<std::string> mListMessages;
91  std::vector<connection_s> mListConnections;
92  int mConnectFD;
93  unsigned int mServerPort;
94  unsigned int mMaxConnections;
95  CAmTelnetMenuHelper mTelnetMenuHelper;
96 
97 };
98 
99 } /* namespace am */
100 #endif /* TELNETSERVER_H_ */
Implements the RoutingSendInterface.
This class realizes the command Interface.
SPDX license identifier: MPL-2.0.
bool check(const sh_pollHandle_t handle, void *userData)
template for a callback
make private, not public template for a callback
Implements an autorouting algorithm for connecting sinks and sources via different audio domains...
Definition: CAmRouter.h:152
This class is used to receive all commands from the control interface.
The am::CAmSocketHandler implements a mainloop for the AudioManager.
void connectSocket(const pollfd pfd, const sh_pollHandle_t handle, void *userData)
uint16_t sh_pollHandle_t
this is a handle for a filedescriptor to be used with the SocketHandler
Implements the Receiving side of the RoutingPlugins.
helper class for CAmTelnetServer
void disconnectClient(int filedescriptor)
template for a callback
sends data to the commandInterface, takes the file of the library that needs to be loaded ...
This class handles and abstracts the database.
Implements a telnetserver that can be used to connect to the audiomanager, retrieve some information ...
CAmTelnetServer(CAmSocketHandler *iSocketHandler, CAmCommandSender *iCommandSender, CAmCommandReceiver *iCommandReceiver, CAmRoutingSender *iRoutingSender, CAmRoutingReceiver *iRoutingReceiver, CAmControlSender *iControlSender, CAmControlReceiver *iControlReceiver, IAmDatabaseHandler *iDatabasehandler, CAmRouter *iRouter, unsigned int servPort, unsigned int maxConnections)
TAmShPollCheck< CAmTelnetServer > telnetCheckCB
bool dispatchData(const sh_pollHandle_t handle, void *userData)
SPDX license identifier: MPL-2.0.
TAmShPollDispatch< CAmTelnetServer > telnetDispatchCB
TAmShPollFired< CAmTelnetServer > telnetReceiveFiredCB
This class is used to send data to the CommandInterface.
void receiveData(const pollfd pfd, const sh_pollHandle_t handle, void *userData)
TCLAP::ValueArg< unsigned int > maxConnections("m","maxConnections","Maximal number of connections for telnet", false, MAX_TELNETCONNECTIONS,"int")
TAmShPollFired< CAmTelnetServer > telnetConnectFiredCB