00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <unistd.h>
00004 #include <signal.h>
00005 #include <fcntl.h>
00006
00007 char buffer[8192];
00008
00009 int main(int argc, char **argv)
00010 {
00011 int i, j;
00012 int count;
00013 int fd;
00014 fd = open("/dev/fsc_dev",O_RDWR );
00015 if (fd<=0) {
00016 printf("Opening fsc_dev failed.\n");
00017 return 1;
00018 }
00019 printf("Jsem straslivej Michaluv demon a ocekavam prikazy :)\n");
00020 while (1) {
00021
00022 count=read(fd,buffer,5192);
00023
00024
00025 printf("REQUEST: len=%d, %s\n", count, buffer);
00026
00027 sleep(1);
00028
00029 write(fd, buffer, count);
00030 printf("RESPONSE: %s\n", buffer);
00031
00032 }
00033 close(fd);
00034 }