| 
      
      
      From: Stephan M. <ste...@we...> - 2006-06-22 15:47:44
      
     | 
| > Where do I find out the file that keep a list of error like -5? And how can > I enable the usberror output? I guess I have to have the DDK to recompile > it? I don't have the DDK installed. You can use usb_set_debug(255) to enable debug output. You don't have to recompile anything. Also, get DebugView from http://www.sysinternals.com/Utilities/DebugView.html This tool allows you to monitor the kernel driver's and the DLL's debug output. > > I cannot use multiple of 64, because there is the only way to detect end of > the packet. Each block is 64bytes, if the block is not 64 blocks, that means > it is the last block. This is the only way in the device I am using. Maybe I > am missing something. If you are using a multiple of 64 you can still detect the last packet. The usb_bulk_read() function returns the number of bytes read. If you request 64*21 bytes and your device only sends 64*20+11 bytes then 64*20+11 will be returned. > > I think I might have some hardware noise problem. Because I did not see the > problem on another hardware. > > > -Andrew > > > ----- Original Message ----- > From: "Stephan Meyer" <ste...@we...> > To: <lib...@li...>; "Andrew Xiang" > <xi...@gr...> > Sent: Wednesday, June 21, 2006 3:49 PM > Subject: Re: [Libusb-win32-devel] win-libusb async read > > > > > > > #define BUF_SIZE (64*20+11) > > > > Can you always guarantee that the last packet your device > > sends is 11 bytes or less? If not, then set BUF_SIZE to a multiple > > of the endpoint's buffer size. Otherwise your device might produce > > 'data overrun' errors (this may cause the -5 error you got). > > > > > while(end_thread==0) > > > { > > > usb_bulk_setup_async(dev, &context0, EP_IN); > > > usb_submit_async(context0, tmp1, sizeof(tmp1)); > > > bytesread=usb_reap_async(context0, INFINITE); > > > printf("%d bytes read back\n", bytesread); > > > } > > > > You forgot to free 'context', call usb_free_async(). > > _____________________________________________________________________ > > Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > > http://smartsurfer.web.de/?mc=100071&distributionid=000000000071 > > > > > > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > > Fully trained technicians. The highest number of Red Hat certifications in > > the hosting industry. Fanatical Support. Click to learn more > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > > _______________________________________________ > > Libusb-win32-devel mailing list > > Lib...@li... > > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > > > > > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > Libusb-win32-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel _____________________________________________________________________ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=000000000071 |