- 论坛徽章:
- 0
|
Hi I'm trying to read data from a USB BARCODE SCANNER
I've written a little sample code... But It refuses to Compile.
Please If anyone could help me with definitions.
Thanks !
[b]#include <sys/types.h>;
#include <stropts.h>;
#include <time.h>;
#include <stdio.h>; /* Standard input/output definitions */
#include <string.h>; /* String function definitions */
#include <stdlib.h>;
#include <unistd.h>; /* UNIX standard function definitions */
#include <fcntl.h>; /* File control definitions */
#include <errno.h>; /* Error number definitions */
#include <termios.h>; /* POSIX terminal control definitions */
#include <sys/vuid_queue.h>;
main( int argc, char *argv[]){
int fd,rval;
char c;
Firm_event fe;
fd = open("dev/usb/hid3",O_RDWR);
if (fd < 0 ) {
exit (1);
}
if ((rval = ioctl(fd, I_PUSH,"usbkbm")) < 0 ) {
exit (1);
}
while (read(fd, &fe, sizeof(fe))) {
printf("\n");
printf("%d", fe.id);
printf("%d", fe.value);
}
} [/b]
gcc bcode.c
In file included from bcode.c:12:
/usr/include/sys/vuid_queue.h:46: parse error before "Firm_event"
bcode.c: In function `main':
bcode.c:17: `Firm_event' undeclared (first use in this function)
bcode.c:17: (Each undeclared identifier is reported only once
bcode.c:17: for each function it appears in.)
bcode.c:17: parse error before "fe"
bcode.c:25: `fe' undeclared (first use in this function) |
|