<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 1, 2009, at 12:47 PM, Neil Sutton wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br> <div class="gmail_quote">On Tue, Sep 1, 2009 at 12:33 PM, Charles Lepple <span dir="ltr">&lt;<a href="mailto:clepple@ghz.cc">clepple@ghz.cc</a>&gt;</span> wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"> <div style="WORD-WRAP: break-word"> <div class="im"> <div>&nbsp;</div></div> <div>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.</div> </div></blockquote></div> <div>&nbsp;</div> <div><font color="#3333ff">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.</font></div> <div><font color="#3333ff">Also if I echo back the result of Convert.ToByte(5) it is indeed 5..</font></div> <div><font color="#3333ff"></font>&nbsp;</div> <div><font color="#3333ff">Could you advise on how the output usage path is calculated from my lsusb -vv output ? (<a href="http://pastebin.com/m48287552">http://pastebin.com/m48287552</a>)</font></div> <div><font color="#3333ff">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.</font></div> <div><font color="#3333ff">I think if I can get those right then my problems will be solved.</font></div> <div><font color="#3333ff"></font>&nbsp;</div></blockquote>Your original code pastebin expired, but I think you were close.</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Local ): Usage, data= [ 0x01 ] 1</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Main&nbsp; ): Collection, data= [ 0x01 ] 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Local ): Usage, data= [ 0x03 ] 3</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Global): Logical Minimum, data= [ 0x00 ] 0</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Global): Logical Maximum, data= [ 0x00 0xff ] 65280</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Global): Report Size, data= [ 0x08 ] 8</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Global): Report Count, data= [ 0x01 ] 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium;">[...]</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Main&nbsp; ): Output, data= [ 0x02 ] 2</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Data Variable Absolute No_Wrap Linear</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Preferred_State No_Null_Position Non_Volatile Bitfield</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-weight: bold; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Item(Local ): Usage, data= [ 0x05 ] 5</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><br></div></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">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.</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium;"><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium;">The bold items above are what you need.</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium;"><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium;">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).</span></div></div></body></html>