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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-01-24T19:54:09+02:00</updated>

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

		<entry>
		<author><name><![CDATA[xSmurf]]></name></author>
		<updated>2009-01-24T19:54:09+02:00</updated>

		<published>2009-01-24T19:54:09+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7649#p7649</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7649#p7649"/>
		<title type="html"><![CDATA[Sending structs as reports]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7649#p7649"><![CDATA[
Well, just scrap that I've been an idiot all this time. I had forgotten about a routine which reads back data from the eeprom into the struct! That's where my &quot;random&quot; data came from!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1728">xSmurf</a> — Sat Jan 24, 2009 7:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2009-01-24T17:51:39+02:00</updated>

		<published>2009-01-24T17:51:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7647#p7647</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7647#p7647"/>
		<title type="html"><![CDATA[Sending structs as reports]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7647#p7647"><![CDATA[
Oh yeah I forgot to post the HID descriptor, if it's any help...<br /><br /><br /><div class="codebox"><p>Code: </p><pre><code>Low Speed device @ 8 &#40;0x1D130000&#41;: .............................................   Composite device: &quot;DigiTherm&quot;<br />    Device Descriptor   <br />        Descriptor Version Number:   0x0110<br />        Device Class:   0   &#40;Composite&#41;<br />        Device Subclass:   0<br />        Device Protocol:   0<br />        Device MaxPacketSize:   8<br />        Device VendorID/ProductID:   0x16C0/0x05DF   &#40;unknown vendor&#41;<br />        Device Version Number:   0x0100<br />        Number of Configurations:   1<br />        Manufacturer String:   1 &quot;mlalonde.net&quot;<br />        Product String:   2 &quot;DigiTherm&quot;<br />        Serial Number String:   0 &#40;none&#41;<br />    Configuration Descriptor   <br />        Length &#40;and contents&#41;:   34<br />        Number of Interfaces:   1<br />        Configuration Value:   1<br />        Attributes:   0x40 &#40;self-powered&#41;<br />        MaxPower:   20 ma<br />        Interface #0 - HID   <br />            Alternate Setting   0<br />            Number of Endpoints   1<br />            Interface Class:   3   &#40;HID&#41;<br />            Interface Subclass;   0<br />            Interface Protocol:   0<br />            HID Descriptor   <br />                Descriptor Version Number:   0x0101<br />                Country Code:   0<br />                Descriptor Count:   1<br />                Descriptor 1   <br />                    Type:   0x22  &#40;Report Descriptor&#41;<br />                    Length &#40;and contents&#41;:   24<br />                    Parsed Report Descriptor:   <br />                          Usage Page    &#40;65280&#41; <br />                          Usage 1 &#40;0x1&#41;    <br />                              Collection &#40;Application&#41;    <br />                                ReportID................    &#40;2&#41;  <br />                                Logical Minimum.........    &#40;0&#41;  <br />                                Logical Maximum.........    &#40;255&#41;  <br />                                Report Size.............    &#40;8&#41;  <br />                                Report Count............    &#40;7&#41;  <br />                                Usage 0 &#40;0x0&#41;    <br />                                Feature.................   &#40;Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Buffered bytes&#41; <br />                              End Collection     <br />            Endpoint 0x81 - Interrupt Input   <br />                Address:   0x81  &#40;IN&#41;<br />                Attributes:   0x03  &#40;Interrupt no synchronization data endpoint&#41;<br />                Max Packet Size:   8<br />                Polling Interval:   100 ms<br /></code></pre></div><p>Statistics: Posted by Guest — Sat Jan 24, 2009 5:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xSmurf]]></name></author>
		<updated>2009-01-24T06:22:50+02:00</updated>

		<published>2009-01-24T06:22:50+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7639#p7639</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7639#p7639"/>
		<title type="html"><![CDATA[Sending structs as reports]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2151&amp;p=7639#p7639"><![CDATA[
Hello guys, first thanks for this excellent piece of code!<br /><br />I'm trying to send a struct as a report. You can see the main part of the code right now. I can send straight bytes no problem. I was able to send two bytes from a buffer and reconstruct it in a struct as a uint16_t on the host side. How ever, when I pass along the pointer for the struct, the data on the host site is garbage (never changes). The struct is malloc'ed so it's definitely available at all time. I really don't get this 0.o<br /><br /><div class="codebox"><p>Code: </p><pre><code>   typedef struct t_configHolder &#123;<br />      uint8_t tempWanted;<br />      uint8_t selectMode;<br />      uint8_t lowHeatDifference;<br />      uint8_t saverDifference;<br />      uint8_t saverEnabled;<br />      uint8_t lightDarkThreshold;<br />      int8_t saverThreshold;<br />   &#125;configHolder;<br /><br /><br />usbMsgLen_t usbFunctionSetup&#40;uint8_t data&#91;8&#93;&#41;<br />&#123;<br />   usbRequest_t   *rq = &#40;usbRequest_t *&#41;&#40;&#40;void *&#41;data&#41;;<br />   <br />   /* HID class request */<br />   if &#40;&#40;rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK&#41; == USBRQ_TYPE_CLASS&#41; &#123;<br />      if &#40;rq-&gt;bRequest == USBRQ_HID_GET_REPORT&#41; &#123;<br />         /* wValue: ReportType &#40;highbyte&#41;, ReportID &#40;lowbyte&#41; */<br />         switch &#40;rq-&gt;wValue.bytes&#91;0&#93;&#41; &#123;<br />            case USB_REPORTID_CALENDAR:<br />               bytesRemaining = EEPROM_CALENDAR_SIZE;<br />               currentAddress = &#40;uint16_t&#41; &amp;EECalendar;<br />               return USB_NO_MSG;   /* use usbFunctionRead&#40;&#41; to obtain data */<br />            break;<br />            case USB_REPORTID_STATUS:<br />               usbMsgPtr = &#40;uint8_t*&#41;&amp;systemStatus;<br />               return sizeof&#40;t_statusHolder&#41;;<br />            break;<br />            case USB_REPORTID_CONFIG:<br />               usbMsgPtr = &#40;uint8_t *&#41;&amp;systemConfig;<br />               return sizeof&#40;t_configHolder&#41;;<br />            break;<br />         &#125;<br />      &#125;<br />   &#125; else &#123;<br />      /* ignore vendor type requests, we don't use any */<br />   &#125;<br />   <br />   return 0;<br />&#125;<br /></code></pre></div><br /><br />Thanks<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1728">xSmurf</a> — Sat Jan 24, 2009 6:22 am</p><hr />
]]></content>
	</entry>
	</feed>
