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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2007-11-11T12:37:12+02:00</updated>

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

		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-11-11T12:37:12+02:00</updated>

		<published>2007-11-11T12:37:12+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=3016#p3016</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3016#p3016"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3016#p3016"><![CDATA[
Or look at the Automator project. It uses Windows HID functions to send and receive data and it contains an abstraction library based on Windows HID calls for Windows and libusb calls for Unix.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sun Nov 11, 2007 12:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-11T07:40:10+02:00</updated>

		<published>2007-11-11T07:40:10+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=3012#p3012</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3012#p3012"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3012#p3012"><![CDATA[
<blockquote><div><cite>Anonymous wrote:</cite><blockquote><div><cite>christian wrote:</cite>If you need to send data to the device, I would recommend that you also encapsulate this in reports sent to the device, so that you can stay fully compliant with HID. See the Automator project for an example.<br /><br />You don't need the interrupt-in endpoint. However, the HID specification demands that one exists. The host operating system may refuse to connect to the device if there is no interrupt-in endpoint.<br /><br />And finally: Yes, you can poll for control messages from the host, of course. If you declare an endpoint as interrupt-in, the operating system's USB driver does the polling for you. This is usually more efficient in terms of CPU time used.</div></blockquote><br /><br />Thanks. I'm currently searching on the web regarding the HID side of things.  I'm trying to figure out how to pull data from and put data to the <br />HID on the host side.  It is transfering data on the scheduled times.  but I'm not sure how to get at it or put data into it for the interupt_out.<br /><br />I know I can do transfers,  either control_in or control_out,  but I'm not sure if that is how I'm supposed to get the data to and from the HID.  I would imagine there is some pipes functions in the HID.dll,  but I'm still searching.<br /><br />Thanks again.</div></blockquote><br /><br />edit: The windows ddk has alot of examples of HID and USB functions.<p>Statistics: Posted by Guest — Sun Nov 11, 2007 7:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-11T06:14:42+02:00</updated>

		<published>2007-11-11T06:14:42+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=3011#p3011</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3011#p3011"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3011#p3011"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>If you need to send data to the device, I would recommend that you also encapsulate this in reports sent to the device, so that you can stay fully compliant with HID. See the Automator project for an example.<br /><br />You don't need the interrupt-in endpoint. However, the HID specification demands that one exists. The host operating system may refuse to connect to the device if there is no interrupt-in endpoint.<br /><br />And finally: Yes, you can poll for control messages from the host, of course. If you declare an endpoint as interrupt-in, the operating system's USB driver does the polling for you. This is usually more efficient in terms of CPU time used.</div></blockquote><br /><br />Thanks. I'm currently searching on the web regarding the HID side of things.  I'm trying to figure out how to pull data from and put data to the <br />HID on the host side.  It is transfering data on the scheduled times.  but I'm not sure how to get at it or put data into it for the interupt_out.<br /><br />I know I can do transfers,  either control_in or control_out,  but I'm not sure if that is how I'm supposed to get the data to and from the HID.  I would imagine there is some pipes functions in the HID.dll,  but I'm still searching.<br /><br />Thanks again.<p>Statistics: Posted by Guest — Sun Nov 11, 2007 6:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-11-10T19:07:56+02:00</updated>

		<published>2007-11-10T19:07:56+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=3004#p3004</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3004#p3004"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=3004#p3004"><![CDATA[
If you need to send data to the device, I would recommend that you also encapsulate this in reports sent to the device, so that you can stay fully compliant with HID. See the Automator project for an example.<br /><br />You don't need the interrupt-in endpoint. However, the HID specification demands that one exists. The host operating system may refuse to connect to the device if there is no interrupt-in endpoint.<br /><br />And finally: Yes, you can poll for control messages from the host, of course. If you declare an endpoint as interrupt-in, the operating system's USB driver does the polling for you. This is usually more efficient in terms of CPU time used.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sat Nov 10, 2007 7:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Rukus]]></name></author>
		<updated>2007-11-10T02:50:43+02:00</updated>

		<published>2007-11-10T02:50:43+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=2995#p2995</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2995#p2995"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2995#p2995"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>The technical description is correct. You can send control-in messages of up to 254 bytes. If your out-data fits into a setup package (one or two integers), then you can do the same as PowerSwitch and parse the data from setup. Otherwise you need a control-out transfer and implment usbFunctionWrite().<br /><br />One thing is not entirely correct, though. When usbFunctionSetup() is called, you must return immediately and have reply data available. You can't wait until the encoder has incremented. However, you can poll for the encoder from the host side and return a zero increment if the encoder has not changed.</div></blockquote><br /><br />Christian,  I've been working pretty hard trying to get this working and it appears that everything is working fine at this time.  I have a routine that I wrote that reads a quadrature mechanical encoder and sends that value to the host via the HID report.  This report just makes windows think that this is a joystick.  The encoders just change the values of the axis information in the hid report at this time.<br /><br />I'm also able to initialize these values by sending the atmega8 values via a control out message that is implemented in a form like what is being done with powerswitch.  I'm able to initialize all 6 axis's to any value I want.<br /><br />All of this really of no real use yet other than understanding how to send data back and forth from host -&gt;device and device-&gt;host.  I'm just about ready to implement all of the encoders to adjust radios and autopilot settings and the LCD displays for the radios and the autopilot heading, speed, altitude ect.<br /><br />Durring my testing it would appear that I really don't need a interupt_in endpoint as I can send data both ways via a control message.  Is this correct?  If this is the case, is there a way on the host side to tell if a control message has been sent by the device? I'm using a modified version of the powerswitch program.  Is there any callbacks or anything in the libusb driver that provides this type of functionality?<br /><br />Anyway...thanks for all of your help.<br /><br />edit: It just occured to me that I might be able to continuously poll for data from a control in via: <div class="codebox"><p>Code: </p><pre><code>usb_control_msg&#40;handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, PSCMD_GET, 0, 0, &#40;char *&#41;buffer, sizeof&#40;buffer&#41;, 5000&#41;</code></pre></div><br /><br />Is this true?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=544">Rukus</a> — Sat Nov 10, 2007 2:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-03T17:58:14+02:00</updated>

		<published>2007-11-03T17:58:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=2878#p2878</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2878#p2878"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2878#p2878"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>The technical description is correct. You can send control-in messages of up to 254 bytes. If your out-data fits into a setup package (one or two integers), then you can do the same as PowerSwitch and parse the data from setup. Otherwise you need a control-out transfer and implment usbFunctionWrite().<br /><br />One thing is not entirely correct, though. When usbFunctionSetup() is called, you must return immediately and have reply data available. You can't wait until the encoder has incremented. However, you can poll for the encoder from the host side and return a zero increment if the encoder has not changed.</div></blockquote><br /><br />Well it appears that I'm learning something <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" />  These examples are a big help as well as your posts.  I appreciate you taking the time to help me along.<br /><br />Thanks again.<p>Statistics: Posted by Guest — Sat Nov 03, 2007 5:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-11-03T17:05:40+02:00</updated>

		<published>2007-11-03T17:05:40+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=2876#p2876</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2876#p2876"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2876#p2876"><![CDATA[
The technical description is correct. You can send control-in messages of up to 254 bytes. If your out-data fits into a setup package (one or two integers), then you can do the same as PowerSwitch and parse the data from setup. Otherwise you need a control-out transfer and implment usbFunctionWrite().<br /><br />One thing is not entirely correct, though. When usbFunctionSetup() is called, you must return immediately and have reply data available. You can't wait until the encoder has incremented. However, you can poll for the encoder from the host side and return a zero increment if the encoder has not changed.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sat Nov 03, 2007 5:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-03T16:54:47+02:00</updated>

		<published>2007-11-03T16:54:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=2875#p2875</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2875#p2875"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2875#p2875"><![CDATA[
I've been studying Powerswitch.  Correct me if I'm wrong:<br /><br />avr  program loops in main until it receives a USB Control message.  The firmware driver calls usbFunctionSetup(uchar data[8]) and data contains <br />the usb command sent from powerswitch.<br /><br />The usbFunctionSetup routine decides what command was sent by testing<br />the variable bRequest.  <br /><br />If it is a switchon or switchoff,  it changes the output bits on its I/O, or if it<br />is a status request,  it puts the status info into the reply buffer and returns a 2 value to the caller which indicates how many bytes to send back via the reply buffer?<br /><br />If all of this is true,  in my case I should be able to send a control message back to the host when one of the mechanical encoders has incremented or decremented the radio frequency.  And then when the host gets it, it should be able to send a control message back to send the actual radio frequency to display via 7 segment displays?<br /><br />How many bytes can I send as a control in or control out message?<br /><br />This seems to do exactly what I want if I am understanding it correctly.<br /><br />Thanks for your help and understanding.  I'm a noob,  but ya just gotta start somewhere <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by Guest — Sat Nov 03, 2007 4:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-11-03T15:57:16+02:00</updated>

		<published>2007-11-03T15:57:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=2873#p2873</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2873#p2873"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2873#p2873"><![CDATA[
You need to install libusb-win32 and attach it to RemoteSensor's IDs. I'm not a Windows expert, so I don't have much experience with that, but the libusb-win32 package contains some instructions.<br /><br />When I make software for Windows, I usually prefer HID because it saves me the extra driver.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Sat Nov 03, 2007 3:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-03T15:23:19+02:00</updated>

		<published>2007-11-03T15:23:19+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=872&amp;p=2872#p2872</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2872#p2872"/>
		<title type="html"><![CDATA[AVR-USB I/O]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=872&amp;p=2872#p2872"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>Yes, RemoteSensor needs its own driver since it's not based on HID.<br /><br />HID is somewhat limited, you can't do generic control requests. All data must be transferred in fixed size structures which must be described to the operating system by means of Report Descriptors.<br /><br />In spite of the limits, HID is suitable for what you want to do. Instead of triggering just a notification with the interrupt-in endpoint, you send the payload data. Output data is still sent with a control-out transfer, but it must adhere to the structure defined in the Report Descriptor.<br /><br />Constructing the Report Descriptor is not always easy. Google finds many documents which describe how to do it. I would recommend that you have a look at Automator. Although it does not use the interrupt-in endpoint, it demonstrates how arbitrary data can be encapsulated in a descriptor without too much effort.</div></blockquote><br /><br /><br />where is the driver for the host side of the Remote sensor project?<br />When the found device window pops up....what driver do I attach?<p>Statistics: Posted by Guest — Sat Nov 03, 2007 3:23 pm</p><hr />
]]></content>
	</entry>
	</feed>
