LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2005, 07:42 AM   #1
nickster
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
help with usb application program


Hi

I'm trying to get a ps2 barcode scanner to work with a ps2-usb converter in a usb slot.

The kernel recognises the ps2 converted when i insert it, and i'm guessing loads some drivers as well. My question is, how do I access this device? do I need to create my own device in /dev/usb? a couple already exists, but when i try to open them, the file descriptor returns -1 (open ("/dev/usb/hiddev0", O_RDONLY)

I've tried a number of devices with a 'sniffer' that wrote, but all the usb devices can't open.

If anybody can tell me how i can use the device, i would really appreciate it, since i have found nothing to help me in the last couple of days

thanks
 
Old 01-26-2005, 12:52 PM   #2
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
you should check out the kernel API for this particular device. Usually, you have to IOCTL some parameters before you can just open the device. It should all be there in the driver file though, look for the ioctl function in the driver and follow the code flow. Also look at the open() and read() and write() calls in the driver.

Aaron
 
Old 01-27-2005, 02:42 AM   #3
nickster
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
you mentioned device? do i need to know what device ie /dev/foo_bar ? thats the one issue. Otherwise, if i understand you correctly, you said i could just open() the driver. as far as I understand open only works on pathnames (ie /dev/foo_bar) and then it creates a file descriptor for that device, rather than accessing some driver.o file and then working the magic?

with the kernel API, do you mean i should write my own driver for the barcode scanner? I figured the usbkbd (or even the devkbd) driver should have the functionality built in. ... ?

thanks in advance
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to a start another application from my c++ program? gajaykrishnan Programming 4 07-25-2004 07:55 AM
how to program java gui application vijaysh Linux - Software 1 07-07-2004 09:39 PM
closing an application from a c program roush Programming 4 04-30-2004 04:14 AM
launching a program from a C++ application Error1312 Programming 7 02-25-2004 08:18 AM
Call Other Application by one Program kiennd Programming 4 08-02-2003 01:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration