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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-03-08T21:18:03+02:00</updated>

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

		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2011-03-08T21:18:03+02:00</updated>

		<published>2011-03-08T21:18:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17827#p17827</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17827#p17827"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17827#p17827"><![CDATA[
...just already do that...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Tue Mar 08, 2011 9:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Bob]]></name></author>
		<updated>2011-03-08T19:52:58+02:00</updated>

		<published>2011-03-08T19:52:58+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17826#p17826</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17826#p17826"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17826#p17826"><![CDATA[
Just use different feature number for your different lengths and check the feature number in usbFunctionSetup<br />    <br /><div class="codebox"><p>Code: </p><pre><code>if (rq-&gt;bRequest == USBRQ_HID_SET_REPORT) //(0x09)<br />{<br />    if (rq-&gt;wValue.bytes&#91;0&#93; == 2)<br />    {<br />        DataRemaining = DATA_FTSIZE;<br />        return USB_NO_MSG;<br />    }<br />    else if (rq-&gt;wValue.bytes&#91;0&#93; == 1)  // only if the report ID is 1<br />    {<br />        DataRemaining = 0;<br />        return USB_NO_MSG;          // tell driver to call usbFunctionWrite with data<br />    }<br />}</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=279">Bob</a> — Tue Mar 08, 2011 7:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2011-03-02T11:19:20+02:00</updated>

		<published>2011-03-02T11:19:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17772#p17772</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17772#p17772"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17772#p17772"><![CDATA[
There is my function to open HID device written in FreeBasic language.<br /><br /><div class="codebox"><p>Code: </p><pre><code>function OpenHID(vid as integer,pid as integer,byval manufacturerp as byte ptr,byval productp as byte ptr,debug as integer=0) as HANDLE export<br />  dim as string manufacturer, product<br />  manufacturer = *manufacturerp<br />  product = *productp<br /><br />  Type HIDD_ATTRIBUTES<br />    size As Dword<br />    VendorID As Word<br />    ProductID As Word<br />    VersionNumber As Word<br />  End Type<br />  Type DEVICE_INTERFACE_DETAIL_DATA<br />    cbSize As Integer<br />    txt As ZString*250<br />  End Type<br />  Dim As guid hidGuid<br />  dim as HDEVINFO deviceInfoList<br />  dim as SP_DEVICE_INTERFACE_DATA deviceInfo<br />  dim as HANDLE handle = cast(any ptr,INVALID_HANDLE_VALUE)<br />  dim as DWORD size<br />  dim as integer OpenFlag=0<br />  dim as HIDD_ATTRIBUTES deviceAttributes<br />  Dim As WString*128 WS<br />  Dim As DEVICE_INTERFACE_DETAIL_DATA DetailData<br />  HidD_GetHidGuid (@hidGuid)<br />  deviceInfoList = SetupDiGetClassDevs(@hidGuid,0,0,DIGCF_PRESENT or DIGCF_INTERFACEDEVICE)<br />  If deviceInfoList = INVALID_HANDLE_VALUE Then return cast(any ptr,INVALID_HANDLE_VALUE)<br />  for i as integer=0 to 100000<br />    if handle &lt;&gt; INVALID_HANDLE_VALUE then CloseHandle(handle):handle = cast(any ptr,INVALID_HANDLE_VALUE)<br />    deviceInfo.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA)<br />    if SetupDiEnumDeviceInterfaces(deviceInfoList, 0, @hidGuid, i, @deviceInfo)=0 then return cast(any ptr,INVALID_HANDLE_VALUE)<br />    SetupDiGetDeviceInterfaceDetail(deviceInfoList,@deviceInfo,0,0,@size,0) 'samo da dobim size!<br />    DetailData.cbSize=5<br />    SetupDiGetDeviceInterfaceDetail(deviceInfoList,@deviceInfo,cast(any ptr,@DetailData),size,@size,0)<br />    handle = CreateFile(detailData.txt, GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ or FILE_SHARE_WRITE, NULL, OPEN_EXISTING, openFlag, NULL)<br />    if handle = INVALID_HANDLE_VALUE then return cast(any ptr,INVALID_HANDLE_VALUE)<br />    deviceAttributes.Size = sizeof(deviceAttributes)<br />    HidD_GetAttributes(handle, @deviceAttributes)<br />    if debug then<br />      print&quot;VID:&quot;; hex(deviceAttributes.VendorID,4);<br />      print&quot; PID:&quot;; hex(deviceAttributes.ProductID,4);<br />      print&quot; Ver:&quot;; hex(deviceAttributes.VersionNumber,4);<br />      If HidD_GetManufacturerString(handle,StrPtr(WS), 128)&lt;&gt;0 Then Print &quot; Mfg:&quot; ; WS;<br />      If HidD_GetProductString(handle,StrPtr(WS), 128)&lt;&gt;0 Then  Print &quot; Product:&quot; ; WS;<br />      print<br />    end if<br />    if  vid=deviceAttributes.VendorID then<br />      if  pid=deviceAttributes.ProductID then<br />        If HidD_GetManufacturerString(handle,StrPtr(WS), 128)&lt;&gt;0 Then<br />          if manufacturer=Ws then<br />            If HidD_GetProductString(handle,StrPtr(WS), 128)&lt;&gt;0 Then<br />              if Product=Ws then<br />                exit for 'just my device<br />              end if<br />            end if<br />          end if<br />        end if<br />      end if<br />    end if<br />  next<br />  SetupDiDestroyDeviceInfoList(deviceInfoList)<br />  OpenHID=handle<br />end function<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Wed Mar 02, 2011 11:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2011-03-02T11:15:09+02:00</updated>

		<published>2011-03-02T11:15:09+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17771#p17771</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17771#p17771"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17771#p17771"><![CDATA[
It possible to send data with windows API HidD_SetFeature and to receive it with HidD_GetFeature.<br />The only problem is that the the length is predefined in descriptor's.  So If you have descriptor for 8 bytes then you must send 8 bytes. So I had two (or more) descriptors with different length's. For example I had one capture device. I had two descriptors. One is for 8 bytes data (intended to control parameters) and other is 128 bytes long for receiving data. And work's well.<br /><br />Slavko<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Wed Mar 02, 2011 11:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[choleski]]></name></author>
		<updated>2011-03-01T16:56:20+02:00</updated>

		<published>2011-03-01T16:56:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17759#p17759</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17759#p17759"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17759#p17759"><![CDATA[
I too am trying to do the hid_data example without libusb .<br />can you please tell more about how to use control endpoint 0 to do it ?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4988">choleski</a> — Tue Mar 01, 2011 4:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2010-12-21T10:37:17+02:00</updated>

		<published>2010-12-21T10:37:17+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17096#p17096</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17096#p17096"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17096#p17096"><![CDATA[
Just want simplest interface (if it's possible without DLL's on WinXP) and to be able to send data of variable length in both ways.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Tue Dec 21, 2010 10:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2010-12-21T00:22:46+02:00</updated>

		<published>2010-12-21T00:22:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17089#p17089</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17089#p17089"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17089#p17089"><![CDATA[
As far as I am aware, the driver splits all control transfers (function read/write) into 8 byte packets regardless of the payload. Maybe you need to use an interrupt endpoint?<br /><br />Sorry, i'm really not sure what you are trying to do.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Tue Dec 21, 2010 12:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2010-12-20T09:42:37+02:00</updated>

		<published>2010-12-20T09:42:37+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17078#p17078</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17078#p17078"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17078#p17078"><![CDATA[
As far I understand that If I use API call instead libusb then I have only fixed data len (of <img class="smilies" src="./../../../images/smilies/icon_cool.gif" alt="8)" title="Cool" />. Is that true?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Mon Dec 20, 2010 9:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2010-12-20T01:07:44+02:00</updated>

		<published>2010-12-20T01:07:44+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17075#p17075</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17075#p17075"/>
		<title type="html"><![CDATA[Re: Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17075#p17075"><![CDATA[
<blockquote><div><cite>eslavko wrote:</cite>If I use HID device can I send the data thru control endpoint 0?</div></blockquote><br />Sure, by using HID feature reports. Try out the HID-data example, hopefully it will answer the rest of your questions and does pretty much what you're asking already.  <img class="smilies" src="./../../../images/smilies/icon_cool.gif" alt="8)" title="Cool" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Mon Dec 20, 2010 1:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eslavko]]></name></author>
		<updated>2010-12-19T23:05:48+02:00</updated>

		<published>2010-12-19T23:05:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17074#p17074</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17074#p17074"/>
		<title type="html"><![CDATA[Libusb or not?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5286&amp;p=17074#p17074"><![CDATA[
Hello...<br /><br />I just have few question...<br />If I use HID device can I send the data thru control endpoint 0?<br />Do I must need the libusb or is that possible with standard vin API calls?<br /><br />What size of data can be send in control endpoint 0?<br />I need to send data packet as short as 5 bytes but can be long 250 bytes too. Is that possible? Or I need to always send max size packet?<br /><br />Same is for receive. the packets are of different lenghts can I send back only 1 byte or I should use MAX size of packet?<br /><br />Thanks.....<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4732">eslavko</a> — Sun Dec 19, 2010 11:05 pm</p><hr />
]]></content>
	</entry>
	</feed>
