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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2010-02-28T19:03:47+02:00</updated>

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

		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-02-28T19:03:47+02:00</updated>

		<published>2010-02-28T19:03:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13453#p13453</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13453#p13453"/>
		<title type="html"><![CDATA[Re: How to handle multiple reports correctly?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13453#p13453"><![CDATA[
Sorry, have not checked your code... I think it should work, but only a test can give you a definitive answer.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sun Feb 28, 2010 7:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[z0ttel]]></name></author>
		<updated>2010-02-28T18:59:39+02:00</updated>

		<published>2010-02-28T18:59:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13452#p13452</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13452#p13452"/>
		<title type="html"><![CDATA[Re: How to handle multiple reports correctly?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13452#p13452"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>The report-ID must also be the first byte of the report data. The reports sizes all increase by one byte.</div></blockquote><br /><br />Hello Christian,<br /><br />thanks for your answer. I already had that in mind. So it should work with the posted code or are there any other modifications neccessary?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=680">z0ttel</a> — Sun Feb 28, 2010 6:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-02-28T18:36:34+02:00</updated>

		<published>2010-02-28T18:36:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13445#p13445</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13445#p13445"/>
		<title type="html"><![CDATA[Re: How to handle multiple reports correctly?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13445#p13445"><![CDATA[
The report-ID must also be the first byte of the report data. The reports sizes all increase by one byte.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sun Feb 28, 2010 6:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[z0ttel]]></name></author>
		<updated>2010-02-08T23:34:03+02:00</updated>

		<published>2010-02-08T23:34:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13177#p13177</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13177#p13177"/>
		<title type="html"><![CDATA[How to handle multiple reports correctly?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3873&amp;p=13177#p13177"><![CDATA[
Hi all,<br /><br />it's me with a stupid question again  <img class="smilies" src="./../../../images/smilies/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /> <br /><br />I was wondering how to handle a HID descriptor with multiple report ids correctly? For example, if I had a device with a HID descriptor containing two reports (report id(1) and report id(2)), would it be sufficient to modify the function &quot;usbFunctionSetup&quot; delivered with the HID-mouse-example in this way?<br /><br /><div class="codebox"><p>Code: </p><pre><code>static uint32_t UsbReport_t_1;    /* Data for report id(1) */<br />static uint32_t UsbReport_t_2;    /* Data for report id(2) */<br /><br />usbMsgLen_t usbFunctionSetup(uchar data&#91;8&#93;)<br />{<br />    usbRequest_t    *rq = (void *)data;<br />    uchar           localReportId;<br />    uchar           localSize;<br /><br />    /* The following requests are never used. But since they are required by<br />     * the specification, we implement them in this example.<br />     */<br />    if((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){    /* class request type */<br />        if(rq-&gt;bRequest == USBRQ_HID_GET_REPORT){  /* wValue: ReportType (highbyte), ReportID (lowbyte) */<br /><br />            /* Get current Report ID */<br />            localReportId = rq-&gt;wValue.bytes&#91;0&#93;;<br /><br />            /* Determine which report to send */<br />            switch (localReportId) {<br /><br />                case 0x01:  usbMsgPtr = (void *)&amp;UsbReport_t_1;<br />                            localSize = sizeof(UsbReport_t_1);<br />                            break;<br />                case 0x02:  usbMsgPtr = (void *)&amp;UsbReport_t_2;<br />                            localSize = sizeof(UsbReport_t_2);<br />                            break;<br />            }<br />            return localSize;<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 */</code></pre></div><br /><br /><br />Would that work or would I have to do something else/additional?<br /><br />Thanks in advance for any comments!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=680">z0ttel</a> — Mon Feb 08, 2010 11:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
