/* gfntes.c For testing GFN driver */ #include #include #include #define GETSTATUS 1000 #define SETCONPORT 1001 int handle; int main() { int data; handle = open("/dev/gfn", O_RDWR); if(handle > 0) printf("GFN Driver opened %d\n", handle); else { printf("Error opening GFN\n"); exit(1); } if(ioctl(handle, GETSTATUS, &data) < 0) printf("Error doing IOCTL GFN\n");; printf("Printer Status from the Driver = %x hex\n",data & 255); printf("Enter Data to Write : "); scanf("%x",&data); if(ioctl(handle, SETCONPORT, &data) < 0) printf("Error doing IOCTL GFN\n");; return 0; }