2014-01-03 08:27:31 +00:00
|
|
|
#ifndef MASTER_DAEMON
|
|
|
|
#define MASTER_DAEMON
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief masterDaemon
|
|
|
|
* server core.
|
|
|
|
*
|
2014-01-05 22:58:00 +00:00
|
|
|
* Two Process Layers: one to n EPP Servers and one to n EPP Clients.
|
2014-01-03 08:27:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef MD_CORE
|
|
|
|
|
|
|
|
class masterDaemon *thisService;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
extern class masterDaemon *thisService;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
using boost::asio::ip::udp;
|
|
|
|
|
|
|
|
|
|
|
|
class masterDaemon : public mdProcess,
|
|
|
|
public Listener<mdAttention>,
|
|
|
|
public Listener<mdCDPulse>,
|
|
|
|
public Listener<mdClientBirth>,
|
|
|
|
public Listener<mdClientDeath>,
|
|
|
|
public Listener<mdIncoming>,
|
|
|
|
public Listener<mdResponse>,
|
2014-01-05 22:58:00 +00:00
|
|
|
public Listener<mdAPIFrame>,
|
|
|
|
public Listener<mdHostCommand> {
|
2014-01-03 08:27:31 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
bool shuttingDown;
|
|
|
|
|
|
|
|
boost::asio::io_service io_;
|
|
|
|
|
|
|
|
int arCycles,
|
2014-01-05 22:58:00 +00:00
|
|
|
apiClients[MAX_CLIENTS],
|
2014-01-06 19:19:17 +00:00
|
|
|
eppPeers[MAX_PEER],
|
2014-01-05 22:58:00 +00:00
|
|
|
nClievers,
|
|
|
|
received,
|
2014-01-03 08:27:31 +00:00
|
|
|
sentCommands;
|
|
|
|
|
2014-01-18 20:35:18 +00:00
|
|
|
#if (ARTKENABLED > 0)
|
2014-01-30 23:27:18 +00:00
|
|
|
ACPRODINOTE::ausRegEPPTK *artk;
|
2014-01-15 16:44:02 +00:00
|
|
|
#endif
|
2014-01-03 08:27:31 +00:00
|
|
|
masterDaemonConfig *cfg;
|
|
|
|
mdDGChannel *bg,*fg;
|
|
|
|
|
|
|
|
std::string clievers[MAX_CLIEVER];
|
|
|
|
|
|
|
|
masterDaemon();
|
|
|
|
~masterDaemon() {}
|
|
|
|
|
|
|
|
masterDaemon(masterDaemonConfig *cmdCfg) { int i;
|
|
|
|
thisService = this;
|
|
|
|
cfg = cmdCfg;
|
|
|
|
nClievers = 0;
|
|
|
|
shuttingDown = false;
|
2014-01-05 22:58:00 +00:00
|
|
|
memset(apiClients,0,sizeof(apiClients));
|
2014-01-06 19:19:17 +00:00
|
|
|
memset(eppPeers,0,sizeof(eppPeers));
|
2014-01-03 08:27:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int getDeviceHandle(int deviceMajor,std::string &deviceMinor) {};
|
2014-01-08 05:00:04 +00:00
|
|
|
int initAusRegTK(void);
|
2014-01-03 08:27:31 +00:00
|
|
|
int initDataLayer(void);
|
|
|
|
int releaseDevice(int handle) {return( -1);}
|
|
|
|
int validateHandleForCmds(int handle) {return(-1);}
|
|
|
|
void dispatch(mdWQitem*);
|
|
|
|
void dispatch(const mdIncoming&);
|
|
|
|
void listen();
|
2014-01-05 22:58:00 +00:00
|
|
|
void * fetchCommands(std::string subSystem) {};
|
2014-01-03 08:27:31 +00:00
|
|
|
|
|
|
|
virtual void processEvent(const mdAttention &ev);
|
|
|
|
virtual void processEvent(const mdCDPulse &ev);
|
|
|
|
virtual void processEvent(const mdClientBirth &ev);
|
|
|
|
virtual void processEvent(const mdClientDeath &ev);
|
|
|
|
virtual void processEvent(const mdIncoming &ev);
|
|
|
|
virtual void processEvent(const mdResponse &ev);
|
2014-01-05 22:58:00 +00:00
|
|
|
virtual void processEvent(const mdAPIFrame &ev);
|
|
|
|
virtual void processEvent(const mdHostCommand &ev);
|
2014-01-03 08:27:31 +00:00
|
|
|
|
|
|
|
void run();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|