On Sat, 28 Apr 2007, Wael Adel wrote:

> > > on the gadget side i have a buffer of 2KB and i just fill 10 bytes of
> > > it by "hello host" but i send all the buffer i.e i send 2KB. so can u
> > > tell me now why the phrase of insize is 64 is repaeted forever while i
> > > set the timeout to zero.i think it shall never appear as long as the
> > > gadget is sending nothing and the read is blocking and the timeout is
> > > zero?
> >
> > This response may be a little late, but here it is anyway.
> >
> > So the gadget isn't just sending "hello host" -- it's really sending a
> > 2048-byte buffer.  On the host side, you have a read request for 64 bytes,
> > which returns the first 64 bytes sent by the gadget.  The next read
> > request returns the next 64 bytes sent by the gadget.  And so on...
> >
> > After 32 repetitions (not forever!), all 2048 bytes will have been read
> > and then the messages will stop.
> 
> ah, i see, so suppose that the gadget sends 2048 buffer full of data ,
> so what should i do to force the host to receive 2048 B only at once ,
> not at 32 times?

Like Dave said...  To force the host to receive 2048 bytes at once, make 
your host program issue a 2048-byte read.

If you don't want to do that, or if you don't want your host program to
read all 2048 bytes, then perhaps the gadget shouldn't send a 2048-byte
buffer in the first place.  Make it send only the first 10 bytes of the 
buffer.

In general, you should expect that the host will read everything the 
gadget sends.  Whether this occurs in a single read operation or spread 
out over several read operations is up to you.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to