#include <cdevPlatforms.h>
#include <cdevSystem.h>
#include <cdevRequestObject.h>
#include <cdevDevice.h>

void callback (int status, void * arg, cdevRequestObject &req, cdevData & data)
	{
	fprintf(stdout, "Received callback with status %i\n", status);
	fflush(stdout);
	}

int main ( )
	{
	cdevRequestObject & setReq = cdevRequestObject::attachRef("device0", "set attrib1");
	cdevCallback cb (callback, NULL);
	cdevData data;
	
	data.insert("value", 1);
	
	setReq.sendCallback(data, cb);
	cdevSystem::defaultSystem().pend();
	
	fprintf(stdout, "Enter a character after you stop and restart the server\n");
	getc(stdin);
	
	setReq.sendCallback(data, cb);
	cdevSystem::defaultSystem().pend();
	return 0;
	}
