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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-10-09T07:51:44+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Urvin]]></name></author>
		<updated>2009-10-09T07:51:44+02:00</updated>

		<published>2009-10-09T07:51:44+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11297#p11297</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11297#p11297"/>
		<title type="html"><![CDATA[Re: libusb &amp; 128 bytes data transfer]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11297#p11297"><![CDATA[
Thanks!<br />I was afraid of using usbFunctionWrite just because of there's no such function in requests example of v-usb <img class="smilies" src="./../../../images/smilies/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2829">Urvin</a> — Fri Oct 09, 2009 7:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2009-10-09T00:43:15+02:00</updated>

		<published>2009-10-09T00:43:15+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11293#p11293</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11293#p11293"/>
		<title type="html"><![CDATA[Re: libusb &amp; 128 bytes data transfer]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11293#p11293"><![CDATA[
You need to implement function write, see usbconfig.h. There is an example in the documentation wiki <a href="http://vusb.wikidot.com/driver-api" class="postlink">http://vusb.wikidot.com/driver-api</a><br />For the host-side, example code can also be found in the wiki here <a href="http://vusb.wikidot.com/host-software" class="postlink">http://vusb.wikidot.com/host-software</a><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Fri Oct 09, 2009 12:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Urvin]]></name></author>
		<updated>2009-10-08T18:41:16+02:00</updated>

		<published>2009-10-08T18:41:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11289#p11289</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11289#p11289"/>
		<title type="html"><![CDATA[Re: libusb &amp; 128 bytes data transfer]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11289#p11289"><![CDATA[
A little trip around usbRequest_t shows that I'm wrong with rq-&gt;wValue.bytes[i] cause of there are only two bytes spreading into integer type.<br />I see that there must be a pointer do data send from PC with size of rq-&gt;wLength.<br />And it's not usbMsgPtr <img class="smilies" src="./../../../images/smilies/icon_sad.gif" alt=":(" title="Sad" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2829">Urvin</a> — Thu Oct 08, 2009 6:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Urvin]]></name></author>
		<updated>2009-10-08T13:17:15+02:00</updated>

		<published>2009-10-08T13:17:15+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11286#p11286</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11286#p11286"/>
		<title type="html"><![CDATA[Re: libusb &amp; 128 bytes data transfer]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11286#p11286"><![CDATA[
I tried to use this code in the host software (with the upper avr code):<br /><div class="codebox"><p>Code: </p><pre><code>char usbReportBuffer&#91;128&#93;;<br />//...<br />usb_control_msg(usbHandle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT,<br />                              CUSTOM_RQ_SET_ALL, 1, 0,usbReportBuffer, sizeof(usbReportBuffer), 5000);</code></pre></div><br /><br />I always get &quot;1&quot; at first position of wholeData array, other elements are trash-filled.<br />What do I need to change to receive <em class="text-italics">data from array</em>, but not <em class="text-italics">wValue</em> parameter, in microcontroller?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2829">Urvin</a> — Thu Oct 08, 2009 1:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Urvin]]></name></author>
		<updated>2009-10-07T17:14:49+02:00</updated>

		<published>2009-10-07T17:14:49+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11276#p11276</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11276#p11276"/>
		<title type="html"><![CDATA[libusb &amp; 128 bytes data transfer]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3356&amp;p=11276#p11276"><![CDATA[
Hi!<br />Now I'm trying to transfer data between my device and PC using libusb and custom requests.<br /><br />I can send 128 bytes from the device to computer already, but I'm in doubt about sending this array of data back to AVR.<br /><br />Would it be right if I use this construction to receieve data (avr-side)?<br /><div class="codebox"><p>Code: </p><pre><code>#define CUSTOM_RQ_SET_ALL 2                     // request to set data array<br />#define USB_BUFFER_REPORT_LEN 128               // data array len<br />static uchar wholeData&#91;USB_BUFFER_REPORT_LEN&#93;   // this array should be filled with data<br /><br />uchar   usbFunctionSetup(uchar data&#91;8&#93;)<br />{<br />    usbRequest_t    *rq = (void *)data;<br /><br />    if((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) == USBRQ_TYPE_VENDOR)<br />    {<br />        // Trying to get data from PC<br />        if(rq-&gt;bRequest == CUSTOM_RQ_SET_ALL)<br />        {<br />            uchar i;<br />         <br />            for (i=0; i&lt;USB_BUFFER_REPORT_LEN; i++)<br />            {<br />                wholeData&#91;i&#93; = rq-&gt;wValue.bytes&#91;i&#93;;<br />            }<br />        }<br />    }<br /><br />    return 0;<br />}</code></pre></div><br /><br />What code should I use in the host application?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2829">Urvin</a> — Wed Oct 07, 2009 5:14 pm</p><hr />
]]></content>
	</entry>
	</feed>
