<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/1855" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-09-22T01:07:39+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/1855</id>

		<entry>
		<author><name><![CDATA[mojo]]></name></author>
		<updated>2009-09-22T01:07:39+02:00</updated>

		<published>2009-09-22T01:07:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11045#p11045</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11045#p11045"/>
		<title type="html"><![CDATA[Re: HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11045#p11045"><![CDATA[
Thanks for the reply. I am not the OP, but I have a similar problem. I am getting some strange results.<br /><br />The above code works, sort of. I get 50 bytes returned with the correct data when I use SimpleHIDWrite to check it. For some reason though, the HID gamepad interface just seems to ignore it. I get absolutely nothing, even when I write random rolling values.<br /><br />The report descriptor seems to be valid (I tried a few, they are all based on the PS3 SIXAXIS one). It must be some kind of issue like that though.<br /><br />Thanks for the assistance.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=892">mojo</a> — Tue Sep 22, 2009 1:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2009-09-21T21:45:17+02:00</updated>

		<published>2009-09-21T21:45:17+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11041#p11041</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11041#p11041"/>
		<title type="html"><![CDATA[Re: HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11041#p11041"><![CDATA[
This latest version should work, unless parts of your software suffer under the large delay of this construct.<br /><br />I noticed you compute (void *)&amp;buffer + intvalue. Gcc probably handles it correctly, but strictly speaking, a void pointer has no size and adding a value to it is nonsense. You probably want (char *)&amp;buffer + intvalue.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Mon Sep 21, 2009 9:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mojo]]></name></author>
		<updated>2009-09-21T20:53:34+02:00</updated>

		<published>2009-09-21T20:53:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11038#p11038</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11038#p11038"/>
		<title type="html"><![CDATA[Re: HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11038#p11038"><![CDATA[
Oh, I tried with this too:<br /><br /><div class="codebox"><p>Code: </p><pre><code>while (!usbInterruptIsReady()) usbPoll();</code></pre></div><br /><br />Didn't help.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=892">mojo</a> — Mon Sep 21, 2009 8:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mojo]]></name></author>
		<updated>2009-09-21T20:37:59+02:00</updated>

		<published>2009-09-21T20:37:59+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11037#p11037</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11037#p11037"/>
		<title type="html"><![CDATA[Re: HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=11037#p11037"><![CDATA[
Christian, can you elaborate a little? When you say you need to make sure the buffer is available with usbInterruptIsReady(), do you mean before every call to usbSetInterrupt() or just once before all the calls?<br /><br />For example, this does not seem to work properly:<br /><br /><div class="codebox"><p>Code: </p><pre><code>        if(usbInterruptIsReady())<br />      {<br />            /* called after every poll of the interrupt endpoint */<br />         ReadJoystick();<br />         usbSetInterrupt((void *)&amp;reportBuffer + 0, 8);<br />         usbSetInterrupt((void *)&amp;reportBuffer + 8, 8);   // 16<br />         usbSetInterrupt((void *)&amp;reportBuffer + 16, 8);   // 24<br />         usbSetInterrupt((void *)&amp;reportBuffer + 24, 8);   // 32<br />         usbSetInterrupt((void *)&amp;reportBuffer + 32, 8);   // 40<br />         usbSetInterrupt((void *)&amp;reportBuffer + 40, 7);   // 47<br />        }<br /></code></pre></div><br /><br />And neither does this:<br /><br /><div class="codebox"><p>Code: </p><pre><code>        if(usbInterruptIsReady())<br />      {<br />            /* called after every poll of the interrupt endpoint */<br />         ReadJoystick();<br />         usbSetInterrupt((void *)&amp;reportBuffer + 0, 8);<br />                        while(!usbInterruptIsReady());<br />         usbSetInterrupt((void *)&amp;reportBuffer + 8, 8);   // 16<br />                        while(!usbInterruptIsReady());<br />         usbSetInterrupt((void *)&amp;reportBuffer + 16, 8);   // 24<br />                        while(!usbInterruptIsReady());<br />         usbSetInterrupt((void *)&amp;reportBuffer + 24, 8);   // 32<br />                        while(!usbInterruptIsReady());<br />         usbSetInterrupt((void *)&amp;reportBuffer + 32, 8);   // 40<br />                        while(!usbInterruptIsReady());<br />         usbSetInterrupt((void *)&amp;reportBuffer + 40, 7);   // 47<br />        }<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=892">mojo</a> — Mon Sep 21, 2009 8:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2008-11-05T13:05:20+02:00</updated>

		<published>2008-11-05T13:05:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6598#p6598</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6598#p6598"/>
		<title type="html"><![CDATA[HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6598#p6598"><![CDATA[
Sorry, I don't have the time to go through your code. But I can confirm that sending a 18 byte report as 8 + 8 + 2 should work as long as you make sure that the buffer is available when you call usbSetInterrupt().<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Wed Nov 05, 2008 1:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2008-11-05T13:01:45+02:00</updated>

		<published>2008-11-05T13:01:45+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6597#p6597</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6597#p6597"/>
		<title type="html"><![CDATA[HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6597#p6597"><![CDATA[
Sorry, I don't have the time to go through your code. But I can confirm that sending a 18 byte report as 8 + 8 + 2 should work as long as you make sure that the buffer is available when you call usbSetInterrupt().<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Wed Nov 05, 2008 1:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[wilin]]></name></author>
		<updated>2008-11-04T21:32:42+02:00</updated>

		<published>2008-11-04T21:32:42+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6586#p6586</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6586#p6586"/>
		<title type="html"><![CDATA[HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6586#p6586"><![CDATA[
I've tried sending two reports (first 8 bytes, then one, then 8 again, and one again), and it doesn't really work. Linux detects it as a mouse, while Windows detects it as a gamepad and everything, but eats (doesn't change) 3 bits from the eight and ninth byte (maybe even more). I think I made Windows not eat those bits by sending 18 bytes together (8+8+2), but it still didn't work properly under linux. <br /><br />I think my problem is somewhere else, probably in the if(rq-&gt;bRequest == USBRQ_HID_GET_REPORT) statement. I've uploaded the current main.c (minimalistic version, most of the features cut out) to <!-- m --><a class="postlink" href="http://pastebin.com/m5474b7ff">http://pastebin.com/m5474b7ff</a><!-- m --><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1465">wilin</a> — Tue Nov 04, 2008 9:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2008-11-04T12:36:52+02:00</updated>

		<published>2008-11-04T12:36:52+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6580#p6580</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6580#p6580"/>
		<title type="html"><![CDATA[HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6580#p6580"><![CDATA[
When you send reports of more than 8 bytes, concatenate several calls to usbSetInterrupt() and make sure the buffer is empty with usbInterruptIsReady() before you call usbSetInterrupt(). The last chunk should be less than 8 bytes to indicate the end of transfer.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Tue Nov 04, 2008 12:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[wilin]]></name></author>
		<updated>2008-11-01T11:25:13+02:00</updated>

		<published>2008-11-01T11:25:13+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6558#p6558</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6558#p6558"/>
		<title type="html"><![CDATA[HID Composite device with reports bigger than 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1855&amp;p=6558#p6558"><![CDATA[
Hi<br /><br />Does anybody know, how to successfully send reports for two devices (2 gamepads in my case), that are more than 8 bytes long? (1 byte reportID + 8 bytes data).  Because I can send &gt;8 bytes for one joystick (not a composite device) or 2x8bytes (composite device, two joysticks, but then I'm missing 8 buttons on each). This is the last thing that I want to implement in my converter (it's a Playstation/Playstation2 gamepad converter with support for DDR pads and possibly Guitar Hero controllers)  and it's been driving me crazy for the past two days (for some reason whatever I tried presented itself as a mouse under linux, and didn't work fully under windows).<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1465">wilin</a> — Sat Nov 01, 2008 11:25 am</p><hr />
]]></content>
	</entry>
	</feed>
