Usb Barcode Reader Please Help
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Usb Barcode Reader Please Help




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

yuval is offline     Usb Barcode Reader Please Help  
yuval


View Ip Address Report This Message To A Moderator Edit/Delete Message


Click Here to See the Profile for yuval Click here to Send yuval a Private Message Find more posts by yuval Add yuval to your buddy list
 
08-23-04 06: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)




[ Post a follow-up to this message ]



yuval is offline     Re: Usb Barcode Reader Please Help  
yuval


View Ip Address Report This Message To A Moderator Edit/Delete Message


Click Here to See the Profile for yuval Click here to Send yuval a Private Message Find more posts by yuval Add yuval to your buddy list
 
08-23-04 08: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...?




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register