|
From: David L. <dav...@le...> - 2019-07-29 16:59:20
|
Hardware: raspberry pi 3
OS: raspbian 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux
Libusb v1.0.21-1
-----Message d'origine-----
De : Tim Roberts <ti...@pr...>
Envoyé : 29 juillet 2019 12:42
À : lib...@li...
Objet : Re: [libusb] Issue with raspberry pi and libusb_bulk_transfer if buffer size is too big
David Levy wrote:
> I still dont understand why I dont receive all data when I specifiy that the receive buffer has a size > 0x4000 on the raspberry.
>
> I made a small change to work around it, I just find the issue weird
>
> int lLen = 0;
> libusb_bulk_transfer( mHandle, aEndPoint | LIBUSB_ENDPOINT_IN, aData,
> aSize>0x4000? 0x4000 : aSize, &lLen, mReadTimeout );
>
> if( lLen == 0x4000 )
> {
> libusb_bulk_transfer( mHandle, aEndPoint | LIBUSB_ENDPOINT_IN, aData+0x4000, aSize - 0x4000, &lLen, mReadTimeout );
> }
How old is your libusb? There was a time, long ago, when the Linux kernel wouldn't accept USB transfers larger than 16k, so either the library or the application had to chop things up exactly like that, but we're talking a very long time ago -- like 15 years. I can't explain why you would need that today.
--
Tim Roberts, ti...@pr...
Providenza & Boekelheide, Inc.
|