![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MAC Universal Barcode Font 8.0 (Default branch) | iBot | Software Releases - RSS News | 0 | 05-16-2008 08:40 PM |
| Oracle Reports Barcode PLL 1.2 (Default branch) | iBot | Software Releases - RSS News | 0 | 02-28-2008 04:10 AM |
| Where do barcode fonts go (Oracle reports) | Chantho | UNIX for Dummies Questions & Answers | 0 | 01-09-2008 07:53 AM |
| Barcode Printing | llepley | UNIX for Advanced & Expert Users | 2 | 01-13-2004 06:18 PM |
| Barcode printing problem | khe_li | UNIX for Advanced & Expert Users | 6 | 10-15-2002 09:07 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
read from a USB Barcode-Reader
Hi all , I'm trying to read from a USB Barcode-Reader "LX-250" (on Unix) ,
I've written the following code ... But the program always failes on : ioctl call Please if anyone has any ideas on what causes it to fail ? Or how should I try to access the Barcode Device ? Your help is very much appreciated ! Thanks #include <sys/stream.h> #include <sys/kbio.h> #include <sys/kbd.h> #include <sys/types.h> #include <sys/stropts.h> #include <sys/vuid_event.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 */ main( int argc, char *argv[]){ int fd,rval; char c; Firm_event fe; fd = open("/dev/usb/hid0" , O_RDWR); if (fd < 0 ) { exit (1); } printf("open /dev/usb/hid0 O.K\n"); if ((rval = ioctl(fd, I_PUSH,"usbkbm")) < 0 ) { perror("ioctl failed"); exit (2); } while (read(fd, &fe, sizeof(fe))) { printf("\n"); printf("%d", fe.id); printf("%d", fe.value); } } The output is : open /dev/usb/hid0 O.K ioctl failed: Invalid argument Please If anyone has any suggestions.... or know any other way to retrive a barcode scan Thanks again Yuval |
|
|||||
|
It would help if you would tell us which unix you are using. The only usbkvm manpage I find is here, and when I read the man page, I see:
open("/dev/kbd", O_RDWR) and I would expect this module to be autopushed anyway. Be sure that you're open the right device. And run autopush on that device to be sure that the module really needs an explicit push. I sorta doubt that a keyboard module will handle a bar code reader anyway. But I've never worked with this stuff, so who knows... |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|