#include <cdevSystem.h>
#include <cdevRequestObject.h>
#include <cdevCallback.h>
#include <cdevGroup.h>

int done = 0;

void callback (int, void *, cdevRequestObject &, cdevData &data)
	{
	static int resultCount = 0;
	done = cdevCallback::isTransactionDone();
	fprintf(stdout, "Result count %i - %s done...\n", ++resultCount, done?"   ":"NOT");
	if(done) data.asciiDump();
	}
	
int main ( void )
	{
	cdevData in;
	cdevRequestObject & req = cdevRequestObject::attachRef("device0", "get attrib0");
	cdevCallback cb (callback, NULL);
	
	req.sendCallback(in, cb);
	while(!done)
		{
		cdevSystem::defaultSystem().pend();
		}
	}
