#include main() { int rc; char a; FILE *fopen(), *fp_out, *fp_in; a = 0; fp_out = fopen ("/dev/usb/scanner0", "wb"); if (fp_out == NULL) { printf ("\nError"); goto exit; } /* Try a reset */ rc = fprintf(fp_out, "\033zE"); printf ("\nfprintf returns %d", rc); /* Inquire firmware data code */ rc = fprintf(fp_out, "\033*s4E"); printf ("\nfprintf returns %d", rc); printf ("\n"); fclose (fp_out); fp_in = fopen ("/dev/usb/scanner0","rb"); if (fp_in == NULL) { printf ("\nRead Error\n"); goto exit; } /* Try to read the scan */ while (a != EOF) { a = fgetc(fp_in); printf ("%c ", a); } fclose (fp_in); exit:; }