<?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/7412" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2012-11-08T15:14:18+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2012-11-08T15:14:18+02:00</updated>

		<published>2012-11-08T15:14:18+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23468#p23468</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23468#p23468"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23468#p23468"><![CDATA[
<blockquote class="uncited"><div>I think straight answer is better than wasting bandwidth told me to look for the &quot;good example&quot; which I didn't know which is &quot;good&quot; exactly because I'm new to this V-USB, and told me to try to use &gt;255 then (which make me asking here in the first post), </div></blockquote> OK first off if you're going to attempt to correct someone try to use a translator that actually works. This comment does not even resemble that witch conveys a meaning full sentence. <br /><br />The Microchip forum was just to show you the size of the descriptor I use and no more. If you tried harder to understand that would have been clear. <br /><br />Your not conflicting the usbFunctionDescriptor, you are redefining it. For any c coder this would be quite clear. Many examples show you how its redefining done. Newbie or not your expected to know that. We are not here to teach you C.<br /><br /><blockquote class="uncited"><div>That means supposed to be no altering in the original library.</div></blockquote> No buddy said you had to allure any libraries. Its called a redefinition. <br /><br />I'll say this one more time: Find an example in the provided download that included the function definitions. Modify it attempting to use a large descriptor. If you get errors post the errors and the main.c and we can show you how to make it work.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Thu Nov 08, 2012 3:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2012-11-08T10:04:38+02:00</updated>

		<published>2012-11-08T10:04:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23456#p23456</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23456#p23456"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23456#p23456"><![CDATA[
I think straight answer is better than wasting bandwidth told me to look for the &quot;good example&quot; which I didn't know which is &quot;good&quot; exactly because I'm new to this V-USB, and told me to try to use &gt;255 then (which make me asking here in the first post), <br /><br />including &quot;Microchip&quot; forum which no explanation about &quot;AVR Studio&quot; which I ask for at the first time, <br /><br />and then example &quot;part&quot; of the code to altering the &quot;original library&quot; (use that will conflict the original usbFunctionDescriptor library default and that means altering ! and that's not newbie's doing)<br />This library supposed to be &quot;direct use library&quot; because it was told:<br /><blockquote class="uncited"><div>On Release 2012-01-09, it said:<br />Fixed bug in usbDriverSetup() which prevented descriptor sizes above 255 bytes</div></blockquote><br />That means supposed to be no altering in the original library.<br /><br />So unless you had working code for descriptor &gt; 255 in AVR Studio, I think it has to stop here.<br />And thanks a lot for the answers  <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=":wink:" title="Wink" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Thu Nov 08, 2012 10:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2012-11-06T18:30:48+02:00</updated>

		<published>2012-11-06T18:30:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23406#p23406</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23406#p23406"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23406#p23406"><![CDATA[
<blockquote class="uncited"><div>Like what? Any link to it?</div></blockquote> So I guess you never even downloaded the package? The examples come with the download.<br /><br /><blockquote class="uncited"><div>Possible if less than 255 bytes (as I knew so far)</div></blockquote> no, possible if &gt; 255.  See this descriptor at post  #35<br /><!-- m --><a class="postlink" href="http://www.microchip.com/forums/tm.aspx?m=320225&amp;mpage=2">http://www.microchip.com/forums/tm.aspx ... 25&amp;mpage=2</a><!-- m --><br />that is the one I use.<br /><br /><blockquote class="uncited"><div>mouse or joystick examples only needs under 255 bytes, so that's not answer of my question</div></blockquote> One more time... please pay attention this time. Use a good example so you can be helped more easily. Your code is a mess I can not even begin to help you. My suggestion is to start with a better example then try to use a descriptor &gt; 255. If you have troubles at that point then ask for help. These examples are in a much easier to read state. In other words , help us help you.<br /><br />I stil think the issue with your code is that you are not redefining the usbFunctionDescriptor function as a &gt;255 byte type. See in my example above how I did it as unsigned.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Tue Nov 06, 2012 6:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2012-11-06T15:33:40+02:00</updated>

		<published>2012-11-06T15:33:40+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23404#p23404</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23404#p23404"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23404#p23404"><![CDATA[
<blockquote class="uncited"><div>There is no trick, just do it. Like I said find a better example. </div></blockquote><br />Like what? Any link to it?<br /><br /><blockquote class="uncited"><div>I already told you its possible. </div></blockquote><br />Possible if less than 255 bytes (as I knew so far)<br /><br /><blockquote class="uncited"><div>Get one of the ever so common mouse or joystick examples.</div></blockquote><br />mouse or joystick examples only needs under 255 bytes, so that's not answer of my question<br /><br /><br />But thanks anyway, I appreciated that you wasted your time to be the only one who care to answer my question  <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=":wink:" title="Wink" /><br /><br />NB:<br />I succesfully implemented many projects including &quot;this project&quot; using LUFA Library, so I interested to try V-USB as it can be use for Generic Micro with no USB Peripheral. But unfortunately meet dead end. <br />So I guess I had to go back to LUFA Library until I find the answer.<br /><br />I editted the above code inside the &quot;PROGMEM char usbHidReportDescriptor[]&quot; maybe somebody need it, but no need look the code below it  <img class="smilies" src="./../../../images/smilies/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /> <br />It detected as 4 USB HID devices in Windows &quot;Device Manager&quot;:<br />device 1 as HID-compliant game controller (joystick with 6 axis and 5 buttons using report ID 5)<br />device 2 to 4 as HID-compliant devices (7 report &quot;IN&quot; only, using report ID 1 to 3)<br /><br />The &quot;rq-&gt;wValue.bytes[0] &quot; is the device report ID, to process the right report from Host.<br />In the above code I only try device 1 (report ID 5).<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Tue Nov 06, 2012 3:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2012-11-06T14:12:10+02:00</updated>

		<published>2012-11-06T14:12:10+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23403#p23403</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23403#p23403"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23403#p23403"><![CDATA[
<blockquote class="uncited"><div>So my question is simple, how I can get more than 255 bytes in descriptor?</div></blockquote> There is no trick, just do it. Like I said find a better example. <br /><br /><div class="codebox"><p>Code: </p><pre><code>Or more simple is how can I cast the descriptor into &quot;int&quot; or is it possible to cast it into &quot;int&quot; as the usbHidReportDescriptor&#91;&#93; was &quot;char&quot; in default, that means max value is 255.</code></pre></div> Again find a better example its so easy with the right code. <br /><br /><blockquote class="uncited"><div>If it's not possible, then I can't use V-USB Library for my project. That's all.</div></blockquote> I already told you its possible. Get one of the ever so common mouse or joystick examples.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Tue Nov 06, 2012 2:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2012-11-06T10:54:23+02:00</updated>

		<published>2012-11-06T10:54:23+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23398#p23398</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23398#p23398"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23398#p23398"><![CDATA[
Sorry for my bad  <img class="smilies" src="./../../../images/smilies/icon_redface.gif" alt=":oops:" title="Embarassed" /> <br /><br />I'm not going to confused you with my code, as I'm new to V-USB and still figuring out how it works for my needs.<br />That's why I took the working example to start, and try to understand it.<br />I was asked to post my code here, so I posted it even it messed up because it's far from final (I won't ask if it's final, right?).<br /> <br />I need to implement 6 devices in 1 project using V-USB library which needs descriptor for each devices.<br />So my question is simple, how I can get more than 255 bytes in descriptor?<br />Or more simple is how can I cast the descriptor into &quot;int&quot; or is it possible to cast it into &quot;int&quot; as the usbHidReportDescriptor[] was &quot;char&quot; in default, that means max value is 255.<br /><br />If it's not possible, then I can't use V-USB Library for my project. That's all.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Tue Nov 06, 2012 10:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2012-11-05T14:35:01+02:00</updated>

		<published>2012-11-05T14:35:01+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23377#p23377</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23377#p23377"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23377#p23377"><![CDATA[
First you're going to have to learn a little patience. &quot;Anybody home&quot;, really?<br /><br />Second please use the &quot;code&quot; button so its not painful to read this. Make things easy for people to help you. <br /><br />Third you code is a mess, things like if (rq-&gt;wValue.bytes[0] == 5) is really bad practices. Try to use the actual define names... At a quick glance you dont even have the basic functions ( i.e usbFunctionDescriptor ). Here is a quick example on how things are made to be readable. <br /><br /><div class="codebox"><p>Code: </p><pre><code>unsigned   usbFunctionDescriptor(struct usbRequest *rq)<br />{<br />   if ((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) != USBRQ_TYPE_STANDARD)<br />      return 0;<br /><br />   if (rq-&gt;bRequest == USBRQ_GET_DESCRIPTOR)<br />   {<br />      // USB spec 9.4.3, high byte is descriptor type<br />      switch (rq-&gt;wValue.bytes&#91;1&#93;)<br />      {<br />         case USBDESCR_DEVICE:<br />            usbMsgPtr = rt_usbDeviceDescriptor;      <br />            return rt_usbDeviceDescriptorSize;<br />         case USBDESCR_HID_REPORT:<br />            usbMsgPtr = rt_usbHidReportDescriptor;<br />            return rt_usbHidReportDescriptorSize;<br />         case USBDESCR_CONFIG:<br />            usbMsgPtr = my_usbDescriptorConfiguration;<br />            return sizeof(my_usbDescriptorConfiguration);<br />      }<br />   }<br /><br />   return 0;<br />}</code></pre></div><br /><br />If you based your code from a USB-V example i'd try another. I really think your problem is that code, it sure confuses me. My descriptor size is calculated automatically. <br /><div class="codebox"><p>Code: </p><pre><code>   rt_usbDeviceDescriptor = (void*)usbDescrDevice;<br />   rt_usbDeviceDescriptorSize = getUsbDescrDevice_size();<br /></code></pre></div><br />Things are so much easier when the code is written well. Maybe someone else can give it a stab here?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Nov 05, 2012 2:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2012-11-04T06:31:20+02:00</updated>

		<published>2012-11-04T06:31:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23360#p23360</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23360#p23360"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23360#p23360"><![CDATA[
Hello <img class="smilies" src="./../../../images/smilies/icon_question.gif" alt=":?:" title="Question" />  <img class="smilies" src="./../../../images/smilies/icon_eek.gif" alt=":shock:" title="Shocked" /> <br />Anybody home  <img class="smilies" src="./../../../images/smilies/icon_question.gif" alt=":?:" title="Question" />  <img class="smilies" src="./../../../images/smilies/icon_confused.gif" alt=":?" title="Confused" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Sun Nov 04, 2012 6:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2012-11-06T15:39:19+02:00 </updated>

		<published>2012-11-03T04:34:18+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23347#p23347</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23347#p23347"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23347#p23347"><![CDATA[
Thanks for your reply ulao (sorry if I wrong typed your name  <img class="smilies" src="./../../../images/smilies/icon_redface.gif" alt=":oops:" title="Embarassed" /> )<br />Here's the main code:<br /><div class="codebox"><p>Code: </p><pre><code>//=========================================================================<br />//<br />// Project: PPM2USB, a AVR-based PPM to USB-Joystick Converter using V-USB.<br />// Author: Thomas Pfeifer<br />// Creation Date: 2010-09-10<br />//<br />// WWW: http://thomaspfeifer.net/ppm2usb_adapter.htm<br />//<br />// Copyright: (c) 2010, Thomas Pfeifer - http://www.thomaspfeifer.net<br />//<br />//            This software is free for non-commercial use. It may be copied,<br />//            modified, and redistributed provided that this copyright notice<br />//            is preserved on all copies.<br />//<br />//            You may NOT use this software, in whole or in part, in support<br />//            of any commercial product without the express consent of the<br />//            author.<br />//<br />//            There is no warranty or other guarantee of fitness of this<br />//            software for any purpose. It is provided solely &quot;as is&quot;.<br />//<br />//=========================================================================<br /><br />#include &lt;avr/io.h&gt;<br />#include &lt;avr/wdt.h&gt;<br />#include &lt;avr/interrupt.h&gt; /* for sei() */<br />#include &lt;util/delay.h&gt; /* for _delay_ms() */<br /><br />#include &lt;avr/pgmspace.h&gt;  /* required by usbdrv.h */<br />#include &quot;usbdrv.h&quot;<br />#include &quot;oddebug.h&quot;<br />#include &quot;ppm.h&quot;<br /><br />/* ------------------------------------------------------------------------- */<br />/* ----------------------------- USB interface ----------------------------- */<br />/* ------------------------------------------------------------------------- */<br /><br />PROGMEM char usbHidReportDescriptor&#91;208&#93; = { // USB report descriptor, size must match usbconfig.h <br />// device 1<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x04,                    // USAGE (Joystick)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x05, 0x01,                    //   USAGE_PAGE (Generic Desktop)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x85, 0x05,                    //   REPORT_ID (5)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)<br />    0x35, 0x00,                    //   PHYSICAL_MINIMUM (0)<br />    0x46, 0xff, 0x00,              //   PHYSICAL_MAXIMUM (255)<br />    0x09, 0x01,                    //   USAGE (Pointer)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x09, 0x34,                    //     USAGE (Ry)<br />    0x09, 0x41,                    //     USAGE (Vy)<br />    0x09, 0x32,                    //     USAGE (Z)<br />    0x09, 0x33,                    //     USAGE (Rx)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />    0x95, 0x06,                    //     REPORT_COUNT (6)<br />    0x81, 0x82,                    //     INPUT (Data,Var,Abs,Vol)<br />    0xc0,                          //   END_COLLECTION<br />    0x09, 0x04,                    //   USAGE (Joystick)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x85, 0x05,                    //     REPORT_ID (5)<br />    0x05, 0x09,                    //     USAGE_PAGE (Button)<br />    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)<br />    0x29, 0x03,                    //     USAGE_MAXIMUM (Button 3)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)<br />    0x95, 0x03,                    //     REPORT_COUNT (3)<br />    0x75, 0x01,                    //     REPORT_SIZE (1)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x95, 0x01,                    //     REPORT_COUNT (1)<br />    0x75, 0x05,                    //     REPORT_SIZE (5)<br />    0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)<br />    0xc0,                          //   END_COLLECTION<br />    0xc0,                          // END_COLLECTION &#91;b&#93;(73 bytes)&#91;/b&#93;<br /><br />// device 2<br />    0x06, 0x00, 0xff,              // USAGE_PAGE (Vendor Defined Page 0)<br />    0x09, 0x01,                    // USAGE (Vendor Usage 1)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    // USAGE (Vendor Usage 1)<br />    0xa1, 0x00,                    //  COLLECTION (Physical)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x95, 0x07,                    //   REPORT_COUNT (7)<br />    0x85, 0x01,                    //   REPORT_ID (1)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)<br />    0x35, 0x00,                    //   PHYSICAL_MINIMUM (0)<br />    0x46, 0xff, 0x00,              //   PHYSICAL_MAXIMUM (255)<br />    0x09, 0x30,                    //   USAGE (0x30)<br />    0x09, 0x31,                    //   USAGE (0x31)<br />    0x09, 0x32,                    //   USAGE (0x32)<br />    0x09, 0x33,                    //   USAGE (0x33)<br />    0x09, 0x34,                    //   USAGE (0x34)<br />    0x09, 0x35,                    //   USAGE (0x35)<br />    0x09, 0x36,                    //   USAGE (0x36)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br />    0xc0,                          //  END_COLLECTION  <br />    0xc0,                          // END_COLLECTION (45 bytes)<br /><br />// device 3<br />    0x06, 0x00, 0xff,              // USAGE_PAGE (Vendor Defined Page 0)<br />    0x09, 0x01,                    // USAGE (Vendor Usage 1)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    // USAGE (Vendor Usage 1)<br />    0xa1, 0x00,                    //  COLLECTION (Physical)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x95, 0x07,                    //   REPORT_COUNT (7)<br />    0x85, 0x03,                    //   REPORT_ID (3)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)<br />    0x35, 0x00,                    //   PHYSICAL_MINIMUM (0)<br />    0x46, 0xff, 0x00,              //   PHYSICAL_MAXIMUM (255)<br />    0x09, 0x30,                    //   USAGE (0x30)<br />    0x09, 0x31,                    //   USAGE (0x31)<br />    0x09, 0x32,                    //   USAGE (0x32)<br />    0x09, 0x33,                    //   USAGE (0x33)<br />    0x09, 0x34,                    //   USAGE (0x34)<br />    0x09, 0x35,                    //   USAGE (0x35)<br />    0x09, 0x36,                    //   USAGE (0x36)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br />    0xc0,                          //  END_COLLECTION  <br />    0xc0,                          // END_COLLECTION (45 bytes)<br /><br />// device 4<br />    0x06, 0x00, 0xff,              // USAGE_PAGE (Vendor Defined Page 0)<br />    0x09, 0x01,                    // USAGE (Vendor Usage 1)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    // USAGE (Vendor Usage 1)<br />    0xa1, 0x00,                    //  COLLECTION (Physical)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x95, 0x07,                    //   REPORT_COUNT (7)<br />    0x85, 0x03,                    //   REPORT_ID (3)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)<br />    0x35, 0x00,                    //   PHYSICAL_MINIMUM (0)<br />    0x46, 0xff, 0x00,              //   PHYSICAL_MAXIMUM (255)<br />    0x09, 0x30,                    //   USAGE (0x30)<br />    0x09, 0x31,                    //   USAGE (0x31)<br />    0x09, 0x32,                    //   USAGE (0x32)<br />    0x09, 0x33,                    //   USAGE (0x33)<br />    0x09, 0x34,                    //   USAGE (0x34)<br />    0x09, 0x35,                    //   USAGE (0x35)<br />    0x09, 0x36,                    //   USAGE (0x36)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br />    0xc0,                          //  END_COLLECTION  <br />    0xc0,                          // END_COLLECTION (45 bytes)<br /><br />&#91;b&#93;// device 5 need 45 bytes<br />// device 6 need 45 bytes&#91;/b&#93;<br />};<br /><br />static uchar idleRate;  /* repeat rate for keyboards, never used for mice */<br />static struct reportBuffer_t<br />{<br />   uint8_t  report_id;<br />   uint8_t  Vy;<br />   uint8_t  Ry;<br />   uint8_t  Rx;<br />   uint8_t   Z;<br />   uint8_t   Y;<br />   uint8_t   X;<br />   uint16_t Button;<br />} reportBuffer;<br />/* ------------------------------------------------------------------------- */<br />usbMsgLen_t usbFunctionSetup(uchar data&#91;8&#93;)<br />{<br />    usbRequest_t *rq = (void *)data;<br />    if((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){ /* class request type */<br />        DBG1(0x50, &amp;rq-&gt;bRequest, 1);  /* debug output: print our request */<br />        if(rq-&gt;bRequest == USBRQ_HID_GET_REPORT){ /* wValue: ReportType (highbyte), ReportID (lowbyte) */<br />         if (rq-&gt;wValue.bytes&#91;0&#93; == 5)<br />         {reportBuffer.report_id = 0x05;} // set report ID so computer knows what data struct is sent<br />         usbMsgPtr = (void *)&amp;reportBuffer;<br />            return sizeof(reportBuffer);<br />         }else if(rq-&gt;bRequest == USBRQ_HID_GET_IDLE){<br />         usbMsgPtr = &amp;idleRate;<br />         return 1;<br />            }else if(rq-&gt;bRequest == USBRQ_HID_SET_IDLE){<br />            idleRate = rq-&gt;wValue.bytes&#91;1&#93;;<br />        }<br />        }else{<br />        /* no vendor specific requests implemented */<br />    }<br />    return 0;  /* default for not implemented requests: return no data back to host */<br />}<br />/* ------------------------------------------------------------------------- */<br />int main(void) {<br />    wdt_enable(WDTO_1S);<br />    odDebugInit();<br />    DBG1(0x00, 0, 0);  /* debug output: main starts */<br />    ppmInit();<br />    usbInit();<br />    usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */<br />    uchar i = 0;<br />    while(--i){  /* fake USB disconnect for &gt; 250 ms */<br />        wdt_reset();<br />        _delay_ms(1);<br />    }<br />    usbDeviceConnect();<br />    sei();<br />    DBG1(0x01, 0, 0);  /* debug output: main loop starts */<br />    uchar changed=0;<br />    ppmNewData=1;<br /><br />    for(;;){ /* main event loop */<br />        DBG1(0x02, 0, 0);  /* debug output: main loop iterates */<br />        wdt_reset();<br />        usbPoll();<br />        if (ppmNewData) {<br />            ppmNewData=0;<br />            if (reportBuffer.Vy !=ppmGet(0)) {reportBuffer.Vy=ppmGet(0); changed=1;}<br />            if (reportBuffer.Ry !=ppmGet(1)) {reportBuffer.Ry=ppmGet(1); changed=1;}<br />            if (reportBuffer.Rx !=ppmGet(2)) {reportBuffer.Rx=ppmGet(2); changed=1;}<br />            if (reportBuffer.Z  !=ppmGet(3)) {reportBuffer.Z=ppmGet(3);  changed=1;}<br />            if (reportBuffer.Y  !=ppmGet(4)) {reportBuffer.Y=ppmGet(4);  changed=1;}<br />            if (reportBuffer.X  !=ppmGet(5)) {reportBuffer.X=ppmGet(5);  changed=1;}<br />            if (reportBuffer.Button !=ppmGet(6)) {reportBuffer.Button=ppmGet(6); changed=1;}<br />         if (changed) {<br />                if(usbInterruptIsReady()){<br />                    changed=0;<br />                    // called after every poll of the interrupt endpoint<br />                    DBG1(0x03, 0, 0);  // debug output: interrupt report prepared<br />                    usbSetInterrupt((void *)&amp;reportBuffer, sizeof(reportBuffer));<br />                }<br />            }<br />        }<br />    }<br />}</code></pre></div><br /><br />This code works fine with 4 devices detected as expected, but I need 2 more devices.<br />That mean need 255 more bytes.<br />How can I achieved that?<br />Any suggestion welcome.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Sat Nov 03, 2012 4:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2012-11-02T20:25:26+02:00</updated>

		<published>2012-11-02T20:25:26+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23346#p23346</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23346#p23346"/>
		<title type="html"><![CDATA[Re: HID DESCRIPTOR more than 255 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=7412&amp;p=23346#p23346"><![CDATA[
Yes it was fixed, I committed the bug. Can you show a bit more code? I think the issue is in the typing of the descriptor functions. Just add your main to the thread and I'll spot the error.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Nov 02, 2012 8:25 pm</p><hr />
]]></content>
	</entry>
	</feed>
