<br><br><div class="gmail_quote">2009/9/3 Charles Lepple <span dir="ltr">&lt;<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, Sep 3, 2009 at 5:05 AM, Arnaud Quette&lt;<a href="mailto:aquette.dev@gmail.com">aquette.dev@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; 2009/9/3 Charles Lepple &lt;<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Is there a particular reason why we are setting the alternate<br>
&gt;&gt; interface to 0 in drivers/libusb.c?<br>
&gt;&gt;<br>
&gt;&gt; I have seen some documentation which indicates that this should<br>
&gt;&gt; already done by the OS when the device is enumerated. If that is the<br>
&gt;&gt; case, then there is no reason why we should hardcode the alternate<br>
&gt;&gt; interface to 0.<br>
&gt;<br>
&gt; iirc, this is indeed done automatically on Linux (and possibly OSX) when<br>
&gt; there&#39;s only one interface (the same goes for the config). but it&#39;s not the<br>
&gt; case on windows.<br>
<br>
</div>Stephan of libusb-win32 seems to disagree:<br>
<br>
<a href="http://osdir.com/ml/lib.libusb.devel.windows/2005/msg00093.html" target="_blank">http://osdir.com/ml/lib.libusb.devel.windows/2005/msg00093.html</a><br></blockquote><div><br>interesting.<br>it might be worth to make some checking around<br>
<pre>&gt; - usb_set_configuration() =&gt; &quot;bConfigurationValue&quot;<br>&gt; - usb_claim_interface() =&gt; &quot;bInterfaceNumber&quot;<br>&gt; - usb_set_altinterface() =&gt; &quot;bAlternateSetting&quot;<br><br>and their values to have something dynamic, smart and adaptable<br>
</pre><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
&gt;&gt; If I remove the following code, tripplite_usb seems to work*:<br>
&gt;&gt;<br>
&gt;&gt;                        /* set default interface */<br>
&gt;&gt;                       usb_set_altinterface(udev, 0);<br>
&gt;<br>
&gt; prefer to flag it for windows (#ifdef WIN32...) so that we don&#39;t face a<br>
&gt; problem when porting to windows.<br>
<br>
</div>I might put a comment in there, but if that call is needed, it should<br>
be pretty obvious during porting.<br></blockquote><div><br>indeed<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">

&gt;&gt; Any objections to removing this? Can I get some volunteers to try this<br>
&gt;&gt; out on their non-OS X systems?<br>
&gt;&gt;<br>
&gt;&gt; I am using libusb-0.1.12 on Mac OS X 10.5.8.<br>
&gt;&gt;<br>
&gt;&gt; * I did have to monkey with a codeless kext in order to allow libusb<br>
&gt;&gt; to claim the device. However, it doesn&#39;t seem like OS X allows you to<br>
&gt;&gt; bypass the claim operation anymore.<br>
&gt;<br>
&gt; I&#39;ll be interested in the result since usbhid-ups, bcmxcp_usb and richcomm<br>
&gt; are in the same case.<br>
&gt; I&#39;ll try to make an OS X test on usbhid-ups with an Eaton...<br>
<br>
</div>The codeless kext stuff is not too complicated - we could probably<br>
generate them the same way as the udev configuration files. The only<br>
trick is that the USB VID, PID, bConfigurationValue, bInterfaceNumber<br>
and bcdDevice values need to be included, in decimal (and the latter<br>
probably needs to be extracted from lsusb output that users have<br>
posted to the mailing lists).<br></blockquote></div><br>isn&#39;t there some joker for the b* (like &quot;*&quot; meaning any value)?<br>having the option to match so specifically is nice, but I find strange to be forced to do that!<br clear="all">
<br>cheers,<br>Arnaud<br>-- <br>Linux / Unix Expert R&amp;D - Eaton - <a href="http://www.eaton.com/mgeops">http://www.eaton.com/mgeops</a><br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/</a><br>
Debian Developer - <a href="http://www.debian.org">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a><br><br>