Hi,

I have a device where I have to switch to configuration 2, interface 1
and alternate setting 2. I now wonder what is the correct way to do this
with javax-usb? There are no methods for setting the configuration or
alternate setting, so is the user responsible for sending the necessary
standard control requests himself? Or is the javax-usb implementation
responsible for automatically setting the right configuration and
alternate setting when claiming the interface?

Let's look at some example code:

  UsbConfiguration config = device.getUsbConfiguration((byte) 2);
  UsbInterface iface = config.getUsbInterface((byte) 1);
  UsbInterface setting = iface.getSetting((byte) 2);
  setting.claim();

Is that the correct way to do it? My own javax-usb implementation
currently throws a UsbNotActiveException because the interface (and the
configuration) is indeed not active. Now I wonder if my implementation
violates the javax-usb specs and I have to change my implementation so
it automatically selects the configuration and alternate setting on
claim or if the user is responsible for that by manually sending
SET_CONFIGURATION and SET_INTERFACE control requests before claiming the
interface.

-- 
Klaus Reimer <http://www.ailis.de/~k/>
[2FC4 CCA0 C03B 1E5F 1ACC 94D6 6461 426C E734 75A1]

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to