/*
 * Pau Mendoza and Patricia Balbastre
 * Aperiodic load generator for CBS scheduler
 *
 * A linux user application that writes on a FIFO
*/

#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>

#include <rtl_fifo.h>
#include <rtl_time.h>

#define RTF_IN_1           "/dev/rtf1"
int main()
{
    int event = 1;
    int ret_out = 0;
    int fd;
    if ((fd = open(RTF_IN_1, O_WRONLY)) < 0) {
	fprintf(stderr, "Error opening /dev/rtf\n");
	exit(1);
    }
    fprintf(stderr, "%d\n", event);
    ret_out = write(fd, &event, sizeof(event));
    fprintf(stderr, "%d\n", event);

	close(fd);
    return 0;
}


