[libhid-discuss] setting output problems

Charles Lepple clepple at ghz.cc
Sat May 3 14:58:46 UTC 2008


On May 3, 2008, at 9:05 AM, Hans-Christoph Steiner wrote:

> Here's hid_set_output_report():
>
>    TRACE: hid_set_output_report(): looking up report ID...
>    TRACE: hid_prepare_parse_path(): preparing search path of depth 2
> for parse tree of USB device 004/003-0925-1299-00-00[0]...
>    TRACE: hid_prepare_parse_path(): search path prepared for parse
> tree of USB device 004/003-0925-1299-00-00[0].
>   NOTICE: hid_find_object(): found requested item.
>    TRACE: hid_set_output_report(): sending report ID 0x00 (length: 2)
> to USB device 004/003-0925-1299-00-00[0]...
> usb_control_msg: 33 9 512 0 0xbffff140 2 10000
>   NOTICE: hid_set_output_report(): successfully sent report to USB
> device 004/003-0925-1299-00-00[0].
> wrote 0 0

Not sure why this doesn't work, but if the device firmware doesn't  
signal an error, then there's not much that libhid can do.

I'll have to check and see if we can provide a little more debug  
output there. Are you using the SVN trunk of libhid?

> Here's the error I get for hid_interrupt_write():
>
> [usbhid] write failed with return code 21: HID_RET_FAIL_GET_REPORT

Hmm, that error code is misleading.

> wrote 1 1
>    TRACE: hid_interrupt_write(): writing interrupt report to device
> 004/003-0925-1299-00-00[0] ...
> libusb/darwin.c ep_to_pipeRef: Converting ep address to pipeRef.
> libusb/darwin.c ep_to_pipeRef: No pipeRef found with endpoint address
> 0x01.
> USB error: libusb/darwin.c usb_bulk_transfer: Invalid pipe reference
> USB error: usb_bulk_write: An error occured during write (see
> messages above)

That error message is coming from libusb - it can't seem to find the  
"interrupt out" endpoint. (Strange, since it does seem to be defined  
after endpoint 0x01.)

What version of libusb are you using?

I don't know offhand if the USB spec mandates that the endpoint  
descriptors be in ascending order (that is, output before input since  
the output address is 0x01, and input is 0x81) but if you have  
control over the firmware, that's something you could try.

-- 
Charles Lepple





More information about the libhid-discuss mailing list