[libhid-discuss] HID_Interrupt_write reports OK, but no action on device..

Neil Sutton sutton.nm at googlemail.com
Tue Sep 1 23:53:31 UTC 2009


Hi Charles,

Thanks for the clarification, that now makes a little more sense to me.
I tried the output path suggested but even though it reported sent ok
nothing happened.

I've been tinkering some more and thought I'd give the interrupt write
another go and it's now working :)
I think I must have had the packet length wrong the first time I tried it as
I've haven't really altered much else!

Thanks very much for your assistance in getting this going.. I'm so pleased
I finally got there ! :)

Kind Regards
Neil

On Tue, Sep 1, 2009 at 11:43 PM, Charles Lepple <clepple at ghz.cc> wrote:

>
> On Sep 1, 2009, at 12:47 PM, Neil Sutton wrote:
>
>
>
> On Tue, Sep 1, 2009 at 12:33 PM, Charles Lepple <clepple at ghz.cc> wrote:
>
>>
>> I would assume that if the argument to Convert.ToByte() is an integer less
>> than 255, then the C equivalent would be that same integer. I think you
>> would only use 0x35 if you were passing a string "5" to Convert.ToByte().
>> Someone who actually knows .NET can feel free to correct me, though.
>>
>
> I think you're right Charles, I went back to the working example from LVR
> and stepped through everything. If I send Hex 0x05 to the device using an
> Output report it works under windows.. so my data needs to be a single byte
> of 0x05.
> Also if I echo back the result of Convert.ToByte(5) it is indeed 5..
>
> Could you advise on how the output usage path is calculated from my lsusb
> -vv output ? (http://pastebin.com/m48287552)
> I am going to try and get things working using output reports instead of
> interrupt_write because I know this works under Windows, but even after
> reading the example text I don't know how to calculate the PATH_IN /
> PATH_OUT values.
> I think if I can get those right then my problems will be solved.
>
>
> Your original code pastebin expired, but I think you were close.
>
> *            Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440*
> *            Item(Local ): Usage, data= [ 0x01 ] 1*
>             Item(Main  ): Collection, data= [ 0x01 ] 1
> *            Item(Local ): Usage, data= [ 0x03 ] 3*
>             Item(Global): Logical Minimum, data= [ 0x00 ] 0
>             Item(Global): Logical Maximum, data= [ 0x00 0xff ] 65280
>             Item(Global): Report Size, data= [ 0x08 ] 8
>             Item(Global): Report Count, data= [ 0x01 ] 1
> [...]
>             Item(Main  ): Output, data= [ 0x02 ] 2
>                             Data Variable Absolute No_Wrap Linear
>                             Preferred_State No_Null_Position Non_Volatile
> Bitfield
>             Item(Local ): Usage, data= [ 0x05 ] 5
>
> The "usage page" part is the upper 16 bits of each entry in the "path". If
> there are no other Usage Pages listed, then that part (0xffa0) doesn't
> change.
>
> The bold items above are what you need.
>
> I think the path should be "0xffa00001, 0xffa00003, 0xffa00005". I forget
> if the HID parser drops the very first usage (since it is outside a
> collection).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090902/43b5aeac/attachment-0001.htm>


More information about the libhid-discuss mailing list