| 
      
      
      From: Stephan M. <Ste...@ia...> - 2007-11-09 09:35:01
      
     | 
| What's the error message returned
by usb_strerror()?
Stephan
> 
> Hi,
> 
> I have a VisualC++ 6.0-application (MFC) for Windows XP.
> This application is supposed to communicate with a microcontroller using
> Bulk writes over USB.
> With an older version of libusb (can't tell you the version, but it's 
from
> 05 August 2006) the application works fine. Now I downloaded the newest
> version of libusb (not the filter-driver!) and created a new inf-file.
> After installing the new driver the application does not work any more!
> The relevant code is:
> ---------------------------------------------------
> usb_init();
> usb_find_busses();
> usb_find_devices();
> for (m_bus = usb_get_busses(); m_bus; m_bus = m_bus->next)
> {
>    struct usb_device *dev;
>    for (dev = m_bus->devices; dev; dev = dev->next)
>    {
>       if (dev->descriptor.bDeviceClass == 0xff)   //find for vendor 
> specific class
>       {
>          m_dev = usb_open(dev);
>          if (m_dev)
>          {
>             if ((dev->descriptor.idVendor == USB_VENDOR) && 
>             (dev->descriptor.idProduct == USB_PRODUCT))
>             {
>                int err;
>                err = usb_set_configuration(m_dev, 1);
>                if (err)
>                {
>                   char* s= usb_strerror();
>                   m_strInitStatus = s;
>                   UpdateData(FALSE);
>                   return;
>                }
>                err = usb_claim_interface(m_dev, 0);
>                if (err)
>                {
>                   char* s= usb_strerror();
>                   m_strInitStatus = s;
>                   UpdateData(FALSE);
>                   return;
>                }
>             }
>          }
>       }
>    }
> }
> 
------------------------------------------------------------------------------------
> 
> With the new version of libusb the usb_set_configuration(...) call 
returns
> with an error and tells me, that configuration 1 could not be set 
because
> the parameter is invalid...
> If I use the new libusb0.dll, the new libusb.lib and the OLD libusb0.sys 
the
> application works fine again.
> 
> Can someone please tell me where I am going wrong?
> Thank you in advantage for your help
> -- 
> View this message in context: http://www.nabble.com/application-
> works-with-older-libusb-win32-but-not-with-version-0.1.12.1-
> tf4770195.html#a13644735
> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.
> 
> 
> 
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
 |