#include "Example.h"
class AsyncReplyHandler : public rdaReplyHandler
{
public:
virtual void handleReply(const rdaRequest&, const rdaData& value)
{
cout << value;
exit(0);
}
virtual void handleError(const rdaRequest&, const rdaException& ex)
{
cout << ex << endl;
exit(0);
}
};
int main(int argc, char** argv)
{
setParameters(argc, argv);
try
{
rdaRDAService* rda = rdaRDAService::init();
rdaDeviceHandle* device = rda->getDeviceHandle(deviceName);
AsyncReplyHandler rh;
if (cycle == 0) device->get(property, &rh);
else device->get(property, cycle, &rh);
sleepForever();
}
catch(const rdaException& ex)
{
cout << ex << endl;
}
catch(const rdaInternalError& ex)
{
cout << ex << endl;
}
return 0;
}