/* event management buffer */ 
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <apci3600.h>
#include <apci3600-events.h>

#include "apci3600-def.h"
#include "event.h"
#include "apci3600msg.h"

//--------------------------------------------------------------------------------
int apci3600_wait_for_event(struct apci3600_card_t * pboard, apci3600_event_t* pevt )
{
	int ret = ioctl(pboard->base, CMD_APCI3600_EventWait, pevt);

	STATUS_MSG(ret,EventWait);
	
	if (ret)
		return -1;
	
	return 0;
}
//--------------------------------------------------------------------------------
int apci3600_empty_event_buffer(struct apci3600_card_t * pboard)
{
	int ret = ioctl(pboard->base, CMD_APCI3600_EventEmpty, NULL);

	STATUS_MSG(ret,EventEmpty);
	
	if (ret)
		return -1;
	
	return 0;
}
