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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-12-30T03:08:45+02:00</updated>

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

		<entry>
		<author><name><![CDATA[qdot]]></name></author>
		<updated>2009-12-30T03:08:27+02:00</updated>

		<published>2009-12-30T03:08:27+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3705&amp;p=12642#p12642</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3705&amp;p=12642#p12642"/>
		<title type="html"><![CDATA[Re: Limit on the # of reports (hid-data)]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3705&amp;p=12642#p12642"><![CDATA[
I'm such a fool. I was creating a file descriptor with each openDevice(), and, surely enough, 1020 descriptors (+4 default ones) away, we're out of them.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3323">qdot</a> — Wed Dec 30, 2009 3:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[qdot]]></name></author>
		<updated>2009-12-30T03:08:45+02:00 </updated>

		<published>2009-12-30T02:48:32+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3705&amp;p=12641#p12641</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3705&amp;p=12641#p12641"/>
		<title type="html"><![CDATA[Limit on the # of reports (hid-data) [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3705&amp;p=12641#p12641"><![CDATA[
Hi!<br /><br />I am playing around with a hid-data code sample. It's running quite happily, with a couple of changes that makes it use a RAM buffer, etc. The goal is to implement some log-console over USB, and to gain more familiarity with USB development.<br /><br />So, I have the linux-side userland code, that boils down to this (modified hidtool.c):<br /><div class="codebox"><p>Code: </p><pre><code>    while (1) {<br />        while ((dev=openDevice()) == NULL)<br />                usleep(250000);<br /><br />        int len = sizeof(buffer);<br />        if((err = usbhidGetReport(dev, 0, buffer, &amp;len)) != 0){<br />            fprintf(stderr, &quot;error reading data: %s\n&quot;, usbErrorMessage(err));<br />        }else{<br />            if (buffer&#91;1&#93; != buffer&#91;2&#93;)<br />                hexdump(buffer+1, sizeof(buffer) - 1);<br />            else  {<br />                fprintf(stdout, &quot;.&quot;); fflush(stdout);<br />            }<br />        }<br />        usleep(10000);<br />    }<br /></code></pre></div><br /><br />Now, I'm getting a very interesting effect - exactly 1020 reports are received, after which libusb presents me with:<br /><div class="codebox"><p>Code: </p><pre><code>error finding DataStore: The specified device was not found</code></pre></div> . <br /><br />The device, however, is still there, it just cannot be reopened by the same process. Merely restarting the hidtool solves the problem, for another 1020 reports. <br />This seems to be independent of the REPORT_SIZE, so I begin to wonder - is there counter that's overflowing? where? userland, or my AVR? <br /><br />Does any of you have similar experiences with pooling a hid-data device?<br /><br />cheers!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3323">qdot</a> — Wed Dec 30, 2009 2:48 am</p><hr />
]]></content>
	</entry>
	</feed>
