#include <iostream>
#ifdef CMW_WIN // Windows
#include <windows.h>
#else // Unix
#include <unistd.h>
#endif
#include <rda/RDAService.h>
using namespace std;
static const char* deviceName = 0;
static const char* property = 0;
static const char* cycle = 0;
static void setParameters(int argc, char** argv)
{
if (argc > 2)
{
deviceName = argv[1];
property = argv[2];
if (argc > 3) cycle = argv[3];
}
else
{
cout << "Missing command line arguments\n";
cout << "Expected: <device name> <property name>";
cout << " <cycle selector (optional)>\n";
exit(1);
}
}
static void sleepForever()
{
while (true)
{
#ifdef CMW_WIN
Sleep(1000);
#else
sleep(1);
#endif
}
}
class Example
{
static bool flag;
public:
static void wait()
{
while (flag == false)
{
#ifdef CMW_WIN
Sleep(1000);
#else
sleep(1);
#endif
}
}
static void terminate()
{
flag = true;
}
};
bool Example::flag = false;