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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2010-10-04T20:31:23+02:00</updated>

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

		<entry>
		<author><name><![CDATA[jay.elle]]></name></author>
		<updated>2010-10-04T20:31:23+02:00</updated>

		<published>2010-10-04T20:31:23+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16099#p16099</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16099#p16099"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16099#p16099"><![CDATA[
omg it works! <br /><br />i dont know anything about linux if it isn't that obvious.  doing a make all &quot;compiled?&quot; a program for me which i was able to run from the terminal.<br /><br />can anyone make a suggestion on what i should do next?  my gut tells me to mess around with the functions.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4241">jay.elle</a> — Mon Oct 04, 2010 8:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jay.elle]]></name></author>
		<updated>2010-10-04T15:19:47+02:00</updated>

		<published>2010-10-04T15:19:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16093#p16093</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16093#p16093"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16093#p16093"><![CDATA[
<blockquote><div><cite>_frank26080115 wrote:</cite>I have no idea what you don't understand, is it the typecasting?</div></blockquote><br /><br />I got way ahead of myself and tried to take in too much information.  I didn't even build the project and mess with it at that point, which is what i'm doing right now.<br />---<br />So far i flashed my metaboard with the custom class example that ships with the driver, but i can't build the host side application.<br /><br />I started with libusb1.0 and realized i needed the legacy version so i backtracked all the way to libusb-0.1.10a.  Everything seemed to install fine and my project can find usb.h, but now i've got different errors and i have no idea what they mean  <img class="smilies" src="./../../../images/smilies/icon_confused.gif" alt=":?" title="Confused" />   any ideas?<br /><div class="codebox"><p>Code: </p><pre><code>Samantha-Darkos-Mac-Pro:commandline SamanthaDarko$ gcc set-led.c<br />Undefined symbols:<br />  &quot;_usb_close&quot;, referenced from:<br />      _main in ccdDCuMX.o<br />  &quot;_usbOpenDevice&quot;, referenced from:<br />      _main in ccdDCuMX.o<br />  &quot;_usb_init&quot;, referenced from:<br />      _main in ccdDCuMX.o<br />  &quot;_usb_control_msg&quot;, referenced from:<br />      _main in ccdDCuMX.o<br />      _main in ccdDCuMX.o<br />  &quot;_usb_strerror&quot;, referenced from:<br />      _main in ccdDCuMX.o<br />      _main in ccdDCuMX.o<br />ld: symbol(s) not found<br />collect2: ld returned 1 exit status<br />Samantha-Darkos-Mac-Pro:commandline SamanthaDarko$ <br /></code></pre></div><br /><br />Do i have to do something with the makefile?<br /><br />Thanks,<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4241">jay.elle</a> — Mon Oct 04, 2010 3:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2010-09-26T05:12:43+02:00</updated>

		<published>2010-09-26T05:12:43+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16000#p16000</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16000#p16000"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=16000#p16000"><![CDATA[
I have no idea what you don't understand, is it the typecasting?<p>Statistics: Posted by Guest — Sun Sep 26, 2010 5:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jay.elle]]></name></author>
		<updated>2010-09-25T04:43:04+02:00</updated>

		<published>2010-09-25T04:43:04+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15984#p15984</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15984#p15984"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15984#p15984"><![CDATA[
<blockquote><div><cite>_frank26080115 wrote:</cite>read <!-- m --><a class="postlink" href="http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket">http://www.beyondlogic.org/usbnutshell/ ... etupPacket</a><!-- m --><br /><br />actually, read all the chapters</div></blockquote><br /><br /><br />I did read all of the chapters.  I think I need to study the code, just not too sure of how much because i'll start wondering how the asm code works.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4241">jay.elle</a> — Sat Sep 25, 2010 4:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2010-09-25T02:58:29+02:00</updated>

		<published>2010-09-25T02:58:29+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15983#p15983</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15983#p15983"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15983#p15983"><![CDATA[
read <!-- m --><a class="postlink" href="http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket">http://www.beyondlogic.org/usbnutshell/ ... etupPacket</a><!-- m --><br /><br />actually, read all the chapters<p>Statistics: Posted by Guest — Sat Sep 25, 2010 2:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jay.elle]]></name></author>
		<updated>2010-09-24T00:09:22+02:00</updated>

		<published>2010-09-24T00:09:22+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15969#p15969</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15969#p15969"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15969#p15969"><![CDATA[
<blockquote class="uncited"><div>This is wrong, the 8 bytes have already been received by the time that &quot;usbFunctionSetup&quot; is called.<br /></div></blockquote><br /><br />Thanks Frank,<br /><br />Could you please note some function that does this in the code and/or provide a simple explanation?<br />--<br />The wiki provides a very good explanation and shows great usage examples, but it's very high level and leaves me asking a lot of questions.<br /><br />I'm unsure of how to understand and make use of this code, meaning do i use it as something high level / functions or would there be great benefit to understand all of the functions?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4241">jay.elle</a> — Fri Sep 24, 2010 12:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2010-09-23T17:55:04+02:00</updated>

		<published>2010-09-23T17:55:04+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15967#p15967</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15967#p15967"/>
		<title type="html"><![CDATA[Re: usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15967#p15967"><![CDATA[
The casting is done where it says &quot;usbRequest_t *rq = (void *)setupData;   // cast to structured data for parsing&quot;<br /><br />the structure of type &quot;usbRequest_t&quot; is 8 bytes long, thus you can easily obtain the request from this 8 bytes of data that is received by &quot;usbFunctionSetup&quot;, that's what casting does, <!-- m --><a class="postlink" href="http://en.wikipedia.org/wiki/Type_conversion">http://en.wikipedia.org/wiki/Type_conversion</a><!-- m --><br /><br /><br /><blockquote class="uncited"><div>My guess is that it takes 1 byte at a time until an ACK is received. Each time a byte is received how is the data parsed separately into its appropriate place?</div></blockquote><br /><br />This is wrong, the 8 bytes have already been received by the time that &quot;usbFunctionSetup&quot; is called.<br /><br /><blockquote class="uncited"><div>Does this line point to the structure usbRequest and not usbRequest_t?</div></blockquote><br /><br />I don't understand this question because the word &quot;usbRequest&quot; does not appear anywhere. &quot;usbRequest_t&quot; is the name given to the structure type, while &quot;rq&quot; is the name given to a pointer that points to an instance of &quot;usbRequest_t&quot; converted from &quot;setupData&quot;, and &quot;bRequest&quot; is a member of the &quot;usbRequest_t&quot; structure that &quot;rq&quot; is pointing at.<p>Statistics: Posted by Guest — Thu Sep 23, 2010 5:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2010-09-23T10:27:03+02:00</updated>

		<published>2010-09-23T10:27:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15963#p15963</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15963#p15963"/>
		<title type="html"><![CDATA[usbFunctionSetup - 8 Bytes?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4858&amp;p=15963#p15963"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code> usbMsgLen_t usbFunctionSetup(uchar setupData&#91;8&#93;)<br />{<br />    usbRequest_t *rq = (void *)setupData;   // cast to structured data for parsing<br />    switch(rq-&gt;bRequest){<br />    case 1:<br />        setLEDStatus(rq-&gt;wValue.bytes&#91;0&#93;);  // evaluate low byte only<br />        return 0;                           // no data block sent or received<br />    }<br />    return 0;                               // ignore all unknown requests<br />}<br /></code></pre></div><br /><br />I know this is basic stuff,I'm trying to figure out how this function receives 8 separate bytes and stores it in to this structure:<br /><br /><div class="codebox"><p>Code: </p><pre><code> typedef struct usbRequest{<br />    uchar       bmRequestType;<br />    uchar       bRequest;<br />    usbWord_t   wValue;<br />    usbWord_t   wIndex;<br />    usbWord_t   wLength;<br />}usbRequest_t;<br /></code></pre></div><br /><br />My guess is that it takes 1 byte at a time until an ACK is received.  Each time a byte is received how is the data parsed separately into its appropriate place?<br /><br /><div class="codebox"><p>Code: </p><pre><code>switch(rq-&gt;bRequest)</code></pre></div>  <br />Does this line point to the structure usbRequest and not usbRequest_t?<p>Statistics: Posted by Guest — Thu Sep 23, 2010 10:27 am</p><hr />
]]></content>
	</entry>
	</feed>
