Re: usb hid
From: roswell (roswel_ajf_at_hotmail.com)
Date: 05/10/04
- Next message: Pierre Asselin: "Re: portable issue of storing float point value in file"
- Previous message: Grant Edwards: "Re: portable issue of storing float point value in file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 10 May 2004 11:43:00 -0700
Gyger Jean-Luc <jean-luc.gyger@omega-electronics.ch> wrote in message news:<pan.2004.04.27.12.30.26.471329@omega-electronics.ch>...
> Hi,
>
> I would like to know how I can communicate with a HID device. This device
> is not a keyboard or mouse but it use the HID driver.
>
> I try different way, but nothing.
>
>
> 1. Using hiddev
> if ((fd = open("/dev/usb/hid/hiddev0", O_RDWR)) < 0) {
> perror("hiddev open");
> exit(1);
> }
> char buff[9];
> int n = read(fd,buff, 9);
>
> 2. Using libusb
>
> usb_init();
>
>
> usb_find_busses();
> usb_find_devices();
>
> for (bus = usb_busses; bus; bus = bus->next)
> {
> for (dev = bus->devices; dev; dev = dev->next)
> {
> int ret, i;
> char string[256];
>
> if(dev->descriptor.idVendor == 0x925 &&
> dev->descriptor.idProduct == 0x1234 )
> {
> udev = usb_open(dev);
> if(udev)
> {
> if (usb_claim_interface(udev, 0) < 0) {
> printf("usb_claim_interface 1: %s\n",usb_strerror());
> usb_close(udev);
> udev = NULL;
> return false;
> }
> }
>
> }
> }
> }
>
> Here, the funntion usb_claim_interface return: device busy.
>
> I would appreciate any help. If you need any further
> information, please let me know.
>
>
> Jlg
Hi, i am having the same problem, any help would eb great. i have
kernel 2.4, trying to just open() device file for HID/smartcardreader,
but no luck. not even sure which devfile to use? any idea?
- Next message: Pierre Asselin: "Re: portable issue of storing float point value in file"
- Previous message: Grant Edwards: "Re: portable issue of storing float point value in file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|