On 22 Feb 2007, Jeff Warren wrote:

> On Thu, 2007-02-22 at 11:44, Alan Stern wrote:
> 
> > It sounds like you have a protocol problem, not a driver problem.  If you 
> > submitted a request for 1024 bytes on a bulk endpoint and 960 bytes have 
> > been received so far, what makes you think the transfer is finished?
> > 
> > Alan Stern
> > 
> You are probably correct.  I don't send the amount of data to be
> transferred over, the host transfer x amount of data at any time, where
> x can be any number,  I just preload requests for 1024 bytes as the
> gadget does not know in advance how much data will be sent.  This method
> works flawlessly except in the case I described.  Without entirely
> changing my protocol to be a fixed length every time (which I don't want
> to do) it sounds like the fix I implemented is the one I should stick
> with.

You're in a situation where you don't have an expected number of bytes,
hence the only criterion for a complete transfer is to receive a short
packet.  So yes, having the host insure that the message size is not a
multiple of 64 will solve the problem.

Alternatively, you could have the host send the transfer length in a
fixed-size 4-byte packet before the main message.  But adding on an extra
byte is quicker and easier.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to