On Mon, 23 Apr 2007, Wael Adel wrote:

> > > bu when the gadget really sends a word like "hello host" for example, the
> > host
> > > really receives it but still printing the phrase of insize is 64 i.e the
> > output
> > > is as follows:
> > >
> > > insize is 64
> > > hello host
> > > insize is 64
> > > insize is 64 and it prints this phrase forever
> > > so why it just receives 64B while i was really sending 2KB buffer?
> >
> > You are contradicting yourself.  Above you said the gadget sends the words
> > "hello host", which is 10 bytes, but now you say the gadget sends a
> > 2048-byte buffer.  Which is it?
> 
> 
> 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.

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