2014-01-05 22:58:00 +00:00
|
|
|
#include <cassert>
|
|
|
|
#include <cstdarg>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <iostream>
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
#include <boost/asio.hpp>
|
|
|
|
#include <boost/bind.hpp>
|
|
|
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
|
|
#include <boost/statechart/event.hpp>
|
|
|
|
#include <boost/statechart/state_machine.hpp>
|
|
|
|
#include <boost/statechart/simple_state.hpp>
|
|
|
|
#include <boost/statechart/transition.hpp>
|
|
|
|
#include <boost/interprocess/shared_memory_object.hpp>
|
|
|
|
#include <boost/interprocess/mapped_region.hpp>
|
|
|
|
|
|
|
|
#include <msgpack.hpp>
|
|
|
|
|
|
|
|
#include <Category.hh>
|
|
|
|
#include <FileAppender.hh>
|
|
|
|
#include <PatternLayout.hh>
|
|
|
|
|
|
|
|
#include "Listener.h"
|
|
|
|
#include "EventSender.h"
|
|
|
|
#include "TimeStampedEvent.h"
|
|
|
|
#include "PolymorphEvent.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <utility>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <queue>
|
|
|
|
|
2014-01-11 19:34:15 +00:00
|
|
|
#define CLIEVER
|
2014-01-05 22:58:00 +00:00
|
|
|
|
2014-01-11 19:34:15 +00:00
|
|
|
#define CLIEVER_APP " ausreg-cd "
|
|
|
|
#define MD_COMPONENT "Client Daemon" // Cliever Component
|
|
|
|
#define MD_NAME CLIEVER_APP " " MD_COMPONENT
|
|
|
|
#define MD_VERSION " 1.0 " // Version
|
|
|
|
#define MD_DEFAULT_IP "188.138.106.163"
|
2014-01-05 22:58:00 +00:00
|
|
|
|
2014-01-11 19:34:15 +00:00
|
|
|
#include "mdcommon.h"
|
2014-01-05 22:58:00 +00:00
|
|
|
|
|
|
|
#include "cdEvents.h"
|
|
|
|
#include "mdCommander.h"
|
|
|
|
|
|
|
|
#include "mdBehavior.h"
|
|
|
|
#include "mdState.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define CD_EPOCH date()
|
|
|
|
#define CD_GLOBAL_SIZE 4096
|
2014-01-11 19:34:15 +00:00
|
|
|
#define CD_LOCK_FILE "ausreg-cd.lock"
|
|
|
|
#define CD_NAME CLIEVER_APP " ausreg-cd"
|
|
|
|
#define CD_VERSION "1.0"
|
2014-01-05 22:58:00 +00:00
|
|
|
#define CD_REFRESH MD_HEARTBEAT // default milliseconds between telemetry frame updates
|
|
|
|
#define CD_MAX_DEVICE 4 // including ourselves
|
|
|
|
|
|
|
|
|
|
|
|
#include "clientDaemonConfig.h"
|
|
|
|
|
|
|
|
typedef std::map<std::string,mdOperationalDataElement*> ODEsOfInterest;
|
|
|
|
|
|
|
|
#include "cdLogger.h"
|
|
|
|
|
2014-01-11 19:34:15 +00:00
|
|
|
class cdapiLayer;
|
2014-01-05 22:58:00 +00:00
|
|
|
class mdCliever;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CD_MAIN
|
|
|
|
|
2014-01-11 02:22:40 +00:00
|
|
|
ac_cd_global *gm;
|
2014-01-05 22:58:00 +00:00
|
|
|
boost::asio::io_service io_bg,io_fg;
|
|
|
|
cdLogger theseLogs;
|
|
|
|
clientDaemonConfig *thisConfig;
|
|
|
|
mdCliever *thisCliever;
|
|
|
|
|
|
|
|
|
2014-01-11 19:34:15 +00:00
|
|
|
extern void runAPILayer();
|
2014-01-05 22:58:00 +00:00
|
|
|
extern void runCliever();
|
|
|
|
extern void shutdown();
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2014-01-11 19:34:15 +00:00
|
|
|
extern ac_cd_global *gm;
|
2014-01-05 22:58:00 +00:00
|
|
|
extern boost::asio::io_service io_bg,io_fg;
|
2014-01-11 19:34:15 +00:00
|
|
|
extern const char *cdOrTk;
|
2014-01-05 22:58:00 +00:00
|
|
|
extern cdLogger theseLogs;
|
|
|
|
extern clientDaemonConfig *thisConfig;
|
|
|
|
extern mdCliever *thisCliever;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "clientDaemon.h"
|
|
|
|
|