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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-01-31T18:51:07+02:00</updated>

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

		<entry>
		<author><name><![CDATA[stf92]]></name></author>
		<updated>2014-01-31T18:51:07+02:00</updated>

		<published>2014-01-31T18:51:07+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8832&amp;p=26529#p26529</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8832&amp;p=26529#p26529"/>
		<title type="html"><![CDATA[hidtool read: 'Device or resource busy'.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8832&amp;p=26529#p26529"><![CDATA[
Hi: I ran examples/hid-data/commandline/hidtool:<div class="codebox"><p>Code: </p><pre><code>$ hidtool read<br />Error sending message: error sending control message: Device or resource busy<br />$</code></pre></div><br />I checked hiddata.c. In usbhidGetReport I found <div class="codebox"><p>Code: </p><pre><code>    bytesReceived = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_ENDPOINT_IN, USBRQ_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE &lt;&lt; 8 | reportNumber, 0, buffer, maxLen, 5000);<br /></code></pre></div><br />And having seen somethings in the sources (firmware), I knew the one of the fields in bmRequestType had to be 'device'. So I replaced USB_RECIP_INTERFACE above by USB_RECIP_DEVICE and, voila: 'hidtool read' worked correctly! Again with the 'write' parameter I got an error. And a new replacement at the appropiate usb_control_msg line made it run OK. Of course, the firmware in the device is that of example/hid-data, but the version of the whole package is 20080418. Being so old, I do not think this can be of any help to the readers but, who knows? <br /><br />By the way, examples/usbtool did not work out either:<div class="codebox"><p>Code: </p><pre><code>$ usbtool -v0x16c0 -d 1,2,3,4,5 control in class device 9 0 0<br />USB error: error sending control message: Connection timed out</code></pre></div><br />where I took the request from<br />RQ_HID_SET_REPORT 0x09<br />in the sources, and value, index I think are don't cares. But here I may be doing something wrong.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20156">stf92</a> — Fri Jan 31, 2014 6:51 pm</p><hr />
]]></content>
	</entry>
	</feed>
