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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-10-27T14:30:29+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-10-27T14:30:29+02:00</updated>

		<published>2014-10-27T14:30:29+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28535#p28535</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28535#p28535"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28535#p28535"><![CDATA[
Sorry not clear why you need to change the device but consider.<br />0x09, 0x05,        // USAGE (Game Pad = 05)<br />0x09, 0x04,        // USAGE (Joy Stick= 04)<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Oct 27, 2014 2:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiao]]></name></author>
		<updated>2014-10-27T07:49:25+02:00</updated>

		<published>2014-10-27T07:49:25+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28531#p28531</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28531#p28531"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28531#p28531"><![CDATA[
thanks<br /><br />we have work out the 8 bytes report and HID device is working as expected in Windows.<br /><br />Because of the device is constantly sending data to USB host upon power up, the own application has intent to receive those raw bytes at purpose. With PC host, there is no any side effect so far (Win7 / Win8/ Win XP), but with android phone, once the device is plugged in with OTG cable, it will triggers those android phone icon in randomly selection, perhaps the result of this &quot;game pad&quot; descriptor and the original design.<br /><br />Due to a clone of existing project (win32) and aims to port for android platform, this result is not anticipated. we would like to change this device descriptor from game pad to some sort of other, what could be better if there is only few bytes of raw data to host ?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1562">xiao</a> — Mon Oct 27, 2014 7:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-10-27T04:04:15+02:00</updated>

		<published>2014-10-27T04:04:15+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28528#p28528</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28528#p28528"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28528#p28528"><![CDATA[
So did it all work out then?<br /><br />I think this makes descriptors and comments as well. <!-- m --><a class="postlink" href="http://hidedit.org/">http://hidedit.org/</a><!-- m --><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Oct 27, 2014 4:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-10-24T22:17:54+02:00</updated>

		<published>2014-10-24T22:17:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28486#p28486</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28486#p28486"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28486#p28486"><![CDATA[
ulao, hah, a day or so ago when I was looking at the report posted here, I was thinking to myself &quot;those comments could easily differ from the actual values. The comments are in such a structured format, surely someone has made some macros that could allow entry directly in that form, to avoid chance of inconsitency.&quot;<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Fri Oct 24, 2014 10:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-10-24T17:56:33+02:00</updated>

		<published>2014-10-24T17:56:33+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28483#p28483</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28483#p28483"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28483#p28483"><![CDATA[
I'm really confused by your report here and what you are expecting? <br /><br />Your descriptor shows it needs 10 bytes( 2 analogs and 8 buttons), BTW buttons are normally done with one report ( 8 bits: a bit mask), I'm guessing you know that.<br /><strong class="text-strong">EDIT!!!<br /> 0x95, 0x04,        //   REPORT_COUNT (2) &lt;--- ahhh... see never do this, always adjust the comments!!! Your thew me off a bit there but i'll leave what I wrote not seeing this.<br />EDIT!!!</strong><br />reportBuffer[0] = x ( 0 to ff )<br />reportBuffer[1] = y ( 0 to ff )<br />reportBuffer[2] button 1 (0 or 1)<br />reportBuffer[3] button 2 (0 or 1)<br />reportBuffer[4] button 3 (0 or 1)<br />reportBuffer[5] button 4 (0 or 1)<br />reportBuffer[6] button 5 (0 or 1)<br />reportBuffer[7] button 6 (0 or 1)<br />reportBuffer[8] button 7 (0 or 1)<br />reportBuffer[9] button 8 (0 or 1)<br /><br />So yes your fist code will work as its 5 bytes long, and it just doubles that equaling 10. The second code is 7 bytes and that is not dividable by 10 so it stops reporting.<br /><br />It looks like you are trying to stuff 4 bytes to X and Y of the report? ( my thinking before I saw your comment typeo) <br />   reportBuffer[0] = 500 / 0x100; // quotient = 0x01 (500 = 0x01f4, form 2 bytes, 0x01, 0xf4)<br />   reportBuffer[1] = 500 % 0x100; // remainder = 0xf4<br />   reportBuffer[2] = 1000 / 0x100; // 1000 = 0x03e8<br />   reportBuffer[3] = 1000 % 0x100;<br /><br />report 2 and 3 are only 1 bit in length, so clearly you are going about this with a misunderstanding. Explain the data sizes you are trying to pass in. If you need to pass in more then 255 for X or Y then your report needs to be split up.<br /><br /><br />If my guess is right you want this?<br />   reportBuffer[0] = Little Endian of X<br />   reportBuffer[1] = Big Endian of X<br />   reportBuffer[2] = Little Endian of Y<br />   reportBuffer[3] = Bittle Endian of Y<br />   reportBuffer[4] = buttons (0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80)<br />   reportBuffer[5] = padding.<br />   reportBuffer[6] = padding.<br />   reportBuffer[7] = padding.<br /><br />If so try this ( check your Endianess)<br /><div class="codebox"><p>Code: </p><pre><code>    PROGMEM const char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; = {    <br />        0x05, 0x01,        // USAGE_PAGE (Generic Desktop = 01)<br />       0x09, 0x05,        // USAGE (Game Pad = 05)<br />       0xa1, 0x01,        // COLLECTION (Application)<br />       0x09, 0x01,        //   USAGE (Pointer)<br />       0xa1, 0x00,        //   COLLECTION (Physical)<br />       0x09, 0x30,        //     USAGE (X)<br />       0x09, 0x30,        //     USAGE (X)<br />       0x09, 0x30,        //     USAGE (Y)<br />       0x09, 0x30,        //     USAGE (Y)<br />       0x15, 0x00,        //   LOGICAL_MINIMUM (0)<br />       0x26, 0xff, 0x00,  //     LOGICAL_MAXIMUM (255)<br />       0x75, 0x08,        //   REPORT_SIZE (8bits)<br />       0x95, 0x04,        //   REPORT_COUNT (4)<br />       0x81, 0x02,        //   INPUT (Data,Var,Abs)<br />       0xc0,              // END_COLLECTION<br />       <br />       0x05, 0x09,        // USAGE_PAGE (Button)<br />       0x19, 0x01,        //   USAGE_MINIMUM (Button 1)<br />       0x29, 0x08,        //   USAGE_MAXIMUM (Button 8)<br />       0x15, 0x00,        //   LOGICAL_MINIMUM (0)<br />       0x25, 0x01,        //   LOGICAL_MAXIMUM (1)<br />       0x75, 0x08,        // REPORT_SIZE (8)<br />       0x95, 0x01,        // REPORT_COUNT (1)<br />       0x81, 0x02,        // INPUT (Data,Var,Abs)<br />       0xc0               // END_COLLECTION<br />    };<br /></code></pre></div><br /><br />also depending on the supplication this is not always allowed.<br />       0x09, 0x30,        //     USAGE (X)<br />       0x09, 0x30,        //     USAGE (X)<br />       0x09, 0x30,        //     USAGE (Y)<br />       0x09, 0x30,        //     USAGE (Y)<br />try this if the above gives you troubles. <br />       0x09, 0x30,        //     USAGE (X)<br />       0x09, 0x31,        //     USAGE (X)<br />       0x09, 0x32,        //     USAGE (Y)<br />       0x09, 0x33,        //     USAGE (Y)<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Oct 24, 2014 5:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiao]]></name></author>
		<updated>2014-10-23T05:09:39+02:00</updated>

		<published>2014-10-23T05:09:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28464#p28464</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28464#p28464"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28464#p28464"><![CDATA[
<blockquote><div><cite>ulao wrote:</cite><blockquote class="uncited"><div>another thing, as we want to increase the report size from 5 bytes to 8 byte, what else to do with tweaking ? assign more bytes to the report buffer, seems not feasibl</div></blockquote> This seems a bit unclear. You don't set the size the report does?  If you want to send more then the report needs, yes you need to add padding to the report.</div></blockquote><br /><br /><br />thanks for update, let us rephrase the query,<br /><br />original code of 5 bytes of report, compile ok, hid device running, ok<br /><div class="codebox"><p>Code: </p><pre><code>static uchar    reportBuffer&#91;5&#93;;    /* buffer for HID reports, type game controller*/<br />   reportBuffer&#91;0&#93; = 500 / 0x100; // quotient = 0x01 (500 = 0x01f4, form 2 bytes, 0x01, 0xf4)<br />   reportBuffer&#91;1&#93; = 500 % 0x100; // remainder = 0xf4<br />   reportBuffer&#91;2&#93; = 1000 / 0x100; // 1000 = 0x03e8<br />   reportBuffer&#91;3&#93; = 1000 % 0x100;<br />   reportBuffer&#91;4&#93; = 0x01;<br /></code></pre></div><br /><br /><br />attempted to upward adjust our report to be 8 bytes as padding 3 more dummy bytes for testing, compile ok, hid device recognized by PC, but the running has error of halt, not even a single bytes of report. we therefore might omitted something or, do not thoroughly understand how to modified the code to fit the purpose.<br /><br /><div class="codebox"><p>Code: </p><pre><code>static uchar    reportBuffer&#91;8&#93;;    /* buffer for HID reports, type game controller*/<br />   reportBuffer&#91;0&#93; = 500 / 0x100; // quotient = 0x01 (500 = 0x01f4, form 2 bytes, 0x01, 0xf4)<br />   reportBuffer&#91;1&#93; = 500 % 0x100; // remainder = 0xf4<br />   reportBuffer&#91;2&#93; = 1000 / 0x100; // 1000 = 0x03e8<br />   reportBuffer&#91;3&#93; = 1000 % 0x100;<br />   reportBuffer&#91;4&#93; = 0x01;<br />   reportBuffer&#91;5&#93; = 0xa;<br />   reportBuffer&#91;6&#93; = 0xa;<br />   reportBuffer&#91;7&#93; = 0xa;<br /></code></pre></div><br /><br /><br />the code of report size, please help to advise how would be adjusted as there are more than one report_size appeared to be. thanks.<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM const char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; = {    <br />    0x05, 0x01,        // USAGE_PAGE (Generic Desktop = 01)<br />   0x09, 0x05,        // USAGE (Game Pad = 05)<br />   0xa1, 0x01,        // COLLECTION (Application)<br />   0x09, 0x01,        //   USAGE (Pointer)<br />   0xa1, 0x00,        //   COLLECTION (Physical)<br />   0x09, 0x30,        //     USAGE (X)<br />   0x09, 0x31,        //     USAGE (Y)<br />   0x15, 0x00,        //   LOGICAL_MINIMUM (0)<br />   0x26, 0xff, 0x00,  //     LOGICAL_MAXIMUM (255)<br />   0x75, 0x08,        //   REPORT_SIZE (8bits)<br />   0x95, 0x04,        //   REPORT_COUNT (2)<br />   0x81, 0x02,        //   INPUT (Data,Var,Abs)<br />   0xc0,              // END_COLLECTION<br />   <br />   0x05, 0x09,        // USAGE_PAGE (Button)<br />   0x19, 0x01,        //   USAGE_MINIMUM (Button 1)<br />   0x29, 0x08,        //   USAGE_MAXIMUM (Button 8)<br />   0x15, 0x00,        //   LOGICAL_MINIMUM (0)<br />   0x25, 0x01,        //   LOGICAL_MAXIMUM (1)<br />   0x75, 0x01,        // REPORT_SIZE (1bit)<br />   0x95, 0x08,        // REPORT_COUNT (8)<br />   0x81, 0x02,        // INPUT (Data,Var,Abs)<br />   0xc0               // END_COLLECTION<br />};<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1562">xiao</a> — Thu Oct 23, 2014 5:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-10-22T17:12:14+02:00</updated>

		<published>2014-10-22T17:12:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28453#p28453</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28453#p28453"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28453#p28453"><![CDATA[
<blockquote class="uncited"><div>another thing, as we want to increase the report size from 5 bytes to 8 byte, what else to do with tweaking ? assign more bytes to the report buffer, seems not feasibl</div></blockquote> This seems a bit unclear. You don't set the size the report does?  If you want to send more then the report needs, yes you need to add padding to the report.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Oct 22, 2014 5:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiao]]></name></author>
		<updated>2014-10-22T13:37:19+02:00</updated>

		<published>2014-10-22T13:37:19+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28448#p28448</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28448#p28448"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28448#p28448"><![CDATA[
<blockquote><div><cite>blargg wrote:</cite>Looks like you were probably just missing 'const'. Often const-correctness is only later done correctly in a library, requiring addition of const in some user code as in this case. So ulao's suggestion seems to be what you need to follow to get it compiling.<br /><br />As for a larger report, you need to update the descriptor to specify the larger report, and any code which assumed the previous size (hopefully it just uses sizeof reportBuffer). You originally posted about a problem with the smalller report and compiling a newer version to see if that fixes it. I suggest you get that working before trying to expand the report.</div></blockquote><br /><br />thanks. compiling with switching to latest usbdrv is done and works.<br /><br />The increased report size has not functioning properly. usb bus logging is seeing this error, reset..etc<br /><br /><div class="codebox"><p>Code: </p><pre><code>  23                                   ok                                                      197.2.0        <br />  23.1                                 RESET                                                   199.1.0        <br />  23.1                                 USTS   c0000012                  babble detected        200.1.0        <br />  23                                   RESET                                                   201.1.0        <br />  23.1                                 USTS   c0000030                  endpoint halted        202.1.0        <br />  23                                   ok                                                      201.2.0    <br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1562">xiao</a> — Wed Oct 22, 2014 1:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-10-22T07:35:34+02:00</updated>

		<published>2014-10-22T07:35:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28445#p28445</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28445#p28445"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28445#p28445"><![CDATA[
Looks like you were probably just missing 'const'. Often const-correctness is only later done correctly in a library, requiring addition of const in some user code as in this case. So ulao's suggestion seems to be what you need to follow to get it compiling.<br /><br />As for a larger report, you need to update the descriptor to specify the larger report, and any code which assumed the previous size (hopefully it just uses sizeof reportBuffer). You originally posted about a problem with the smalller report and compiling a newer version to see if that fixes it. I suggest you get that working before trying to expand the report.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Wed Oct 22, 2014 7:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiao]]></name></author>
		<updated>2014-10-22T05:30:45+02:00</updated>

		<published>2014-10-22T05:30:45+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28444#p28444</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28444#p28444"/>
		<title type="html"><![CDATA[Re: usbHidReportDescriptor type of confilct]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9400&amp;p=28444#p28444"><![CDATA[
<blockquote><div><cite>ulao wrote:</cite>usbHidReportDescriptor needs to be <br />PROGMEM  const char  usbHidReportDescriptor<br />or<br />const  ROGMEM  char  usbHidReportDescriptor<br />I forget the order that is required and I'm sure that wont be the only error you encounter. I believe i had 50 some lines to fix. Its actually the IDE that is giving you the grief.</div></blockquote><br /><br /><br />thanks anyway.<br /><br />we used the command line with avr-gcc only with makefile, seems the usbdrv.h has changed all define with the latest release, still no success on compilation.<br /><br />another thing, as we want to increase the report size from 5 bytes to 8 byte, what else to do with tweaking ? assign more bytes to the report buffer, seems not feasible.<br /><br />code as below,<br /><div class="codebox"><p>Code: </p><pre><code>//2014-10-20, orignal buffer size, test ok, except one extra byte 0x0 from device ???<br />//static uchar    reportBuffer&#91;5&#93;;    /* buffer for HID reports, type game controller*/<br />//2014-10-22, adjust buffer size, want to send more bytes on report, not working<br />static uchar    reportBuffer&#91;8&#93;;    /* buffer for HID reports, type game controller*/<br /></code></pre></div><br /><br /><div class="codebox"><p>Code: </p><pre><code>   //2014-10-20, test for usb bus logging<br />   reportBuffer&#91;0&#93; = 500 / 0x100; // quotient = 0x01 (500 = 0x01f4, form 2 bytes, 0x01, 0xf4)<br />   reportBuffer&#91;1&#93; = 500 % 0x100; // remainder = 0xf4<br />   reportBuffer&#91;2&#93; = 1000 / 0x100; // 1000 = 0x03e8<br />   reportBuffer&#91;3&#93; = 1000 % 0x100;<br />   reportBuffer&#91;4&#93; = 0x01;<br />   //2014-10-22, adjust buffer size, want to send more bytes on report, not working<br />   reportBuffer&#91;5&#93; = 0xa;<br />   reportBuffer&#91;6&#93; = 0xa;<br />   reportBuffer&#91;7&#93; = 0xa;</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1562">xiao</a> — Wed Oct 22, 2014 5:30 am</p><hr />
]]></content>
	</entry>
	</feed>
