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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2008-10-18T18:02:27+02:00</updated>

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

		<entry>
		<author><name><![CDATA[epsilon_da]]></name></author>
		<updated>2008-10-18T18:02:27+02:00</updated>

		<published>2008-10-18T18:02:27+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1818&amp;p=6453#p6453</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1818&amp;p=6453#p6453"/>
		<title type="html"><![CDATA[hid-data example with different HIDReportDescriptor]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1818&amp;p=6453#p6453"><![CDATA[
Hi.<br /><br />I have successfully tryed the hid-data example provided with avrusb after <a href="http://forums.obdev.at/viewtopic.php?t=1474" class="postlink">fixing</a> the command line tool.<br /><br />Now i have changed back the Report to my previously working keyboard copyed from HID-Keys:<br /><br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;35&#93; = &#123; // USB report descriptor<br />    0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x06,                    // USAGE &#40;Keyboard&#41;<br />    0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x05, 0x07,                    //   USAGE_PAGE &#40;Keyboard&#41;<br />    0x19, 0xe0,                    //   USAGE_MINIMUM &#40;Keyboard LeftControl&#41;<br />    0x29, 0xe7,                    //   USAGE_MAXIMUM &#40;Keyboard Right GUI&#41;<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM &#40;0&#41;<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM &#40;1&#41;<br />    0x75, 0x01,                    //   REPORT_SIZE &#40;1&#41;<br />    0x95, 0x08,                    //   REPORT_COUNT &#40;8&#41;<br />    0x81, 0x02,                    //   INPUT &#40;Data,Var,Abs&#41;<br />    0x95, 0x01,                    //   REPORT_COUNT &#40;1&#41;<br />    0x75, 0x08,                    //   REPORT_SIZE &#40;8&#41;<br />    0x25, 0x65,                    //   LOGICAL_MAXIMUM &#40;101&#41;<br />    0x19, 0x00,                    //   USAGE_MINIMUM &#40;Reserved &#40;no event indicated&#41;&#41;<br />    0x29, 0x65,                    //   USAGE_MAXIMUM &#40;Keyboard Application&#41;<br />    0x81, 0x00,                    //   INPUT &#40;Data,Ary,Abs&#41;<br />    0xc0                           // END_COLLECTION<br />&#125;;<br /></code></pre></div><br /><br /><br />I wasnt expecting it to work, but it works perfectly.<br /><br />So i wonder what is the difference between both Reports?<br /><br />I can see different hex values but i dont know what they means.<br />For instance ones have REPORT_COUNT (128) and the comments says that the report consists in 128 opaque data bytes, and in this report i have REPORT_COUNT (1), so this means &quot;1 opaque data byte&quot;.<br />Then why is the transfer working?<br />I can write and read all 128 values with hidtool.<br /><br /><br /><br /><br />My usbFunctionSteup is as follow:<br /><br /><div class="codebox"><p>Code: </p><pre><code>case USBRQ_HID_GET_REPORT:<br />   // wValue: ReportType &#40;highbyte&#41;, ReportID &#40;lowbyte&#41; <br />   // we only have one report type, so don't look at wValue <br />//               buildReport&#40;keyPressed&#40;&#41;&#41;;<br />//               usbMsgPtr = reportBuffer;<br />//               return sizeof&#40;reportBuffer&#41;; // This will always be 2<br /><br />   // fallback and use usbFunctionRead&#40;&#41; to obtain data <br />case USBRQ_HID_SET_REPORT:<br />   bytesRemaining = 128;<br />   currentAddress = 0;<br />   return USB_NO_MSG;  // use usbFunctionWrite&#40;&#41; to receive data from host<br /></code></pre></div><br />The 3 commented code lines seems to not be needed for the keyboard to work.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1412">epsilon_da</a> — Sat Oct 18, 2008 6:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
