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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-11-29T21:33:04+02:00</updated>

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

		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2013-11-29T21:33:04+02:00</updated>

		<published>2013-11-29T21:33:04+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8756&amp;p=26270#p26270</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8756&amp;p=26270#p26270"/>
		<title type="html"><![CDATA[libusb and linux]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8756&amp;p=26270#p26270"><![CDATA[
Helo...<br />I have little ADC working in windows. Now I like to port to linux (raspberry/beaglebone).<br />ADC act as HID. The working solution is writen in basic. After oppening USB (to get handle) I just repeated read like this<br /><br /><div class="codebox"><p>Code: </p><pre><code>declare function HidD_GetFeature lib &quot;hid.dll&quot; alias &quot;HidD_GetFeature&quot; (hnd As integer,buf As integer,len As integer) As Integer<br />HidD_GetFeature(HidHandle,buffer,9)</code></pre></div><br /><br />Now for linux I tried python and libusb. After twigling with permissions (dont need to be sudo any more) I can find and open interface based on name, but cant got any data from usb. Any idea?<br /><br />The as short as possible python test. I tryed many values for request_type and request, but without success.<br /><br /><div class="codebox"><p>Code: </p><pre><code>import usb1<br /><br />#Try to open my stick - no error checking at all<br />context = usb1.USBContext()<br />for device in context.getDeviceList(skip_on_error=True):<br />    if device.getProduct()=='IsolADC':<br />        devh=device.open()<br />        <br />print devh  #just print descriptor to see<br /><br />#now try to get 8 bytes from control point<br />request_type=0# (1&lt;&lt;5) #HID CLASS<br />request=0 #1 #GET REPORT<br />value=0<br />index=0<br />length=8<br /><br />tmp= devh.controlRead(request_type, request, value, index, length,0)<br />print len(tmp)<br />print '&gt;',tmp<br /><br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Fri Nov 29, 2013 9:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
