<span style="color: rgb(51, 51, 255);">> Thanks for the advice Wingnut I will try out USBSnoop when I get home tonight..</span><br><br><div class="gmail_quote">On Tue, Sep 1, 2009 at 12:02 AM, Charles Lepple <span dir="ltr"><clepple@ghz.cc></span> wrote:<br>
<div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
On Aug 31, 2009, at 4:24 PM, Neil Sutton wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In Windows I successfully control the device using VB and issue the commands to control the relays using Convert.ToByte(Int)<br>
The board has 4 relays and by issuing Convert.ToByte(6) for example I can open a single relay, Convert.ToByte(5) closes the relay.<br>
(7) and (8) control another relay.. you get the idea.<br>
</blockquote>
<br></div>
In that case, you probably want to send 6 and 5, or 7 and 8.<div class="im"><br></div></blockquote><div><span style="color: rgb(51, 51, 255);">> Would just sending 0x35 via libhid be the equivilent of using .net's Convert.ToByte(5) ? </span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">> I have really confused myself with how the data should be presented to libhid..</span> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now the example code reports back ok when I issue the interrupt write but nothing happens on the device.<br>
I think I may be sending the wrong commands but I'm not too sure..<br>
</blockquote>
<br></div>
Are you sure that the Windows code is using an interrupt write, and not a control transfer? Is it using an output usage rather than a feature usage?<br>
<br>
Also, what timeout are you using under Windows?<div class="im"><br></div></blockquote><div><span style="color: rgb(51, 51, 255);">> Looking at the code I'm using for Windows (sample code .net from Lake View Research - <a href="http://www.lvr.com">www.lvr.com</a>) It does appear to be using a control transfer.</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">> I'm not sure about output / feature usage.. as that was something I never dealt with using the LVR code, I just had to point it at the VID/PID and enter the data to send.</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">> I did intially use the output report method in libhid but I wasn't sure of the output path since I couldn't make much sense of the comments in the example.</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">> Then I noticed that the output of lsusb said the method was Interrupt so I presumed I should be using that..?</span><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I figured that I should send one byte, of 8 bits..? so I have tried to send 0xFF and also 255 but neither does anything.<br>
</blockquote>
<br></div>
0xff and 255 get converted to the same 8-bit quantity when sent.<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
The lsusb output is here for my device;<br>
<a href="http://pastebin.com/m48287552" target="_blank">http://pastebin.com/m48287552</a><br>
<br>
Here is the modified hid_test.c that I'm currently using;<br>
<a href="http://pastebin.com/d1a6f40da" target="_blank">http://pastebin.com/d1a6f40da</a><br>
<br>
Any pointers would be appreciated!<br>
<br>
Thanks<br></div>
_______________________________________________<br>
libhid-discuss mailing list<br>
<a href="mailto:libhid-discuss@lists.alioth.debian.org" target="_blank">libhid-discuss@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss</a><br>
<a href="http://libhid.alioth.debian.org/" target="_blank">http://libhid.alioth.debian.org/</a> </blockquote>
</blockquote></div><br>