2010/9/11 Xiaofan Chen <xiaof...@gmail.com>

> On Sat, Sep 11, 2010 at 9:04 AM, Gao Hong <joy.highl...@gmail.com> wrote:
> > I see not,at the beginning I didn't install any driver for my usb
> > device,just level it as windows installed.
> > However how did the pyusb/libusb-windows backend find it and get the
> > device/interface descriptor for it with out winusb? the device is an mass
> > storage device.
>
> The libusb-1.0 Windows backend uses Setupapi for those kind of
> things. No WinUSB is needed to get the descriptors. However, once
> you want to do real operation, then you have to use the WinUSB driver.
>
> Actually I do not need the real read/write such operation,I just wanna
device/interface/string descriptor.
However PyUSB hasn't realized the get_string_descriptor yet,so I have to use
this code:

def getStringDescriptor(device, index):
    """
    """
    #device.set_configuration()
    response = device.ctrl_transfer(usb.util.ENDPOINT_IN,
                                    usb.legacy.REQ_GET_DESCRIPTOR,
                                    (usb.util.DESC_TYPE_STRING << 8) |
index,
                                    0, # language id
                                    255) # length

    # TODO: Refer to 'libusb_get_string_descriptor_ascii' for error handling

    return response[2:].tostring().decode('utf-16')

The result is that....I need to install libusb-win32/WinUSB driver...I
really really don't want to...


> Currently the libusb-win32 seems to be an better choice with filter-driver
> > if it works...
>
> If it is for your development use, the filter driver is okay. We still
> do not recommend to deploy filter driver to end users as potential
> problems can still occur, including BSODs in some circumstances.
>
>
> --
> Xiaofan
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>



-- 
It's a long journey to go! :-)
Legend since 1985...
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to