2013/10/30 Johannes Stezenbach <j...@sig21.net>:

[snip]

> I'm still not getting it.
>
>     cfg = dev.get_active_configuration()
>     # now we have the Configuration Descriptor for some arbitrary 
> configuration

Here we have the configuration descriptor of the active configuration
(that which was set by set_configuration).

>     intf = cfg[(0,0)]
>     # first altsetting of first interface in the configuration
>

Yes, but we want the active alternate setting.

> The usb.util.find_descriptor() in the tutorial would be useful
> if we would know bInterfaceNumber for the desired interface
> by some other means.  A more realistic example for the
> tutorial would search the interface by bInterfaceClass,
> bInterfaceSubClass and bInterfaceProtocol.  Or, for the
> case of Linux g_zero, find the configuration with
> iConfiguration pointing to "source and sink data" and
> use the first (and only) interface.
>
>

Later on the tutorial tutorial we have a example for bInterfaceClass,
bInterfaceSubClass and bInterfaceProtocol.
I think I will remove the alternate setting stuff from the first
example, as it seems to cause some confusion to newcomers.


-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to