Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ReadPipeAsync revisited.



On Oct 30, 2006, at 10:15 AM, Robert Bell wrote:


Hi guys,

So, I have finally gotten round to implementing a fix for a 0xe00002e8 in a call to ReadPipeAsync (mentioned in earlier emails). I have a question though.  The code used is as follows:

result = (*interface)->ReadPipeAsync(interface, 1, asynchRequest->rawDataBuffer,
sizeOfRequest, returnHandler, asynchRequest);

if(result != kIOReturnSuccess){
//Handle error.
}

The error is caught in the if block. Given that this is an async request, am I correct in assuming that the return from this function cannot know about errors generated during the actual obtaining of the data? So, if I re-send the request, can I trust that the device is still waiting to receive a read request? If this were a synchronous call, I would naturally assume that some error had occurred that would more than likely mean that I would loose the data, but in this case, it is not clear to me as the call above returns immediately.


Your if block above is catching immediate errors, such as the pipe being stalled or a bad argument being passed.  Actual errors from the transfer will be reported in your returnHandler.  If you queue another request, it will be queued behind that first one.   An async request has to return immediately without waiting for the actual transfer.  That's the whole point of it.

--
Fernando Urbina
USB Technology Team
Apple Computer, Inc.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden

References: 
 >ReadPipeAsync revisited. (From: Robert Bell <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.