Unix Programming - Usb Barcode Reader Please Help

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2004 > Usb Barcode Reader Please Help





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Usb Barcode Reader Please Help
yuval

2004-08-23, 1:38 am

Hi ,
I'm trying to write a program which reads a stream of data from a
USB Barcode-Reader - HID3 (in Solaris 8)
When I tried to compile the code I got some errors.....
Please if anyone could help me understand what's wrong ...
Many thanks.

#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);
}
}
and I get for
gcc bcode.c -o bcode

In file included from bcode.c:9:
/usr/include/sys/vuid_queue.h:46: parse error before "Firm_event"
bcode.c: In function `main':
bcode.c:14: `Firm_event' undeclared (first use in this function)
bcode.c:14: (Each undeclared identifier is reported only once
bcode.c:14: for each function it appears in.)
bcode.c:14: parse error before "fe"
bcode.c:19: `I_PUSH' undeclared (first use in this function)
bcode.c:22: `fe' undeclared (first use in this function)
yuval

2004-08-23, 3:06 am

I added :
#include <sys/types.h>
#include <sys/stropts.h>

And it solved the "I_PUSH" error
But I can't get rid of the other ERRORS...?
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com