/*******************************************************************************
* TmsControlClient2.cpp TMS API example code
* T.Barnaby, BEAM Ltd, 2007-02-07
*******************************************************************************
*
* This is a very basic example of using the TmsApi to set the
* TMS's cycleNumber and cycleType.
* It is designed to give an overview of using the API.
*/
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <TmsD.h>
#include <TmsC.h>
#include <TmsS.h>
#include <BSema.h>
using namespace Tms;
using namespace std;
#define DEBUG 0
#if DEBUG
#define dprintf(fmt, a...) printf(fmt, ##a);
#else
#define dprintf(fmt, a...)
#endif
BSema cycleStopSemaphore;
double getTime()
{
struct timeval tp;
gettimeofday(&tp, NULL);
return ((double) tp.tv_sec + (double) tp.tv_usec * 1e-6);
}
class TmsEventServer : public Tms::TmsEventService {
public:
TmsEventServer(BoapServer& server, BString name) : Tms::TmsEventService(server, name){
}