| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I have a low-speed device that responds to 8-byte commands issued via control requests, by returning data via Interrupt IN. My code issues the DeviceRequest(), followed by a call to ReadPipeAsync(), then a sleep via a runloop while waiting for my callback to be run (see code sample below). Normally this works fine, but I've found that in some circumstance (that I cannot identify yet) my async callback {identified as ReadCompletion in my call to ReadPipeAsync() } is invoked and the result argument contains 0xe00002eb (kIOReturnAborted). I have an Ellisys hardware USB logger device hooked up which shows that my control request gets to my device, and the device responds with the expected Interrupt IN data within less than 200 msecs. There are no NAKs, STALLs, HALTs or other unexpected behavior that I can see,and yet my callback is told kIOReturnAborted. How should I interpret this error report? How can I find out why this particular error code is being reported to my callback? Looking up this error code in the Xcode documentation yields "The operation has been aborted (0xe00002eb)." I'm running OS X 10.4.3, Java 5, and the code sample is inside a JNI library called from the Java world. Here is the basic code snippet: // Associate the event source with the current run loop CFRunLoopAddSource(CFRunLoopGetCurrent(), pUSBObject->m_IORunLoopSourceRef, kCFRunLoopDefaultMode); // This async read returns immediately ioReturnValue = (*pUSBObject->m_intfInterface)->ReadPipeAsync(pUSBObject->m_intfInterface, pUSBObject->m_uiInPipeRef, pBuffer1, uiResponseSize, (IOAsyncCallback1)ReadCompletion, (void *)pUSBObject); if (ioReturnValue != kIOReturnSuccess) { if (gLogLevel > 1) { sprintf(pGlobalMsg, "OUSB2:readDataFromDevice - Data error on ReadPipeAsync, code = 0x%04x", (int)err_get_code(ioReturnValue)); writeLogMsg(pGlobalMsg); } // Not success *pResponseSize = 0; free(pBuffer1); return ioReturnValue; } else // ReadPipeAsync was successful { // Wait for the data (and the callback)(and the timeout) SInt32 sStatus = CFRunLoopRunInMode(kCFRunLoopDefaultMode, (CFTimeInterval)1, TRUE); ... code waits here for runloop release, done in the callback This is part of the callback, that shows how it is exiting with the error void ReadCompletion(void * refCon, IOReturn result, void *arg0) { if (result != kIOReturnSuccess) { // An error condition #ifdef _DEBUG if (gLogLevel > 1) { sprintf(pGlobalMsg, "OUSB2:ReadCompletion - Data retrieval encountered error # 0x%04x, bytes read=%d", (int)result, (int)*arg0); writeLogMsg(pGlobalMsg); The error message is "OUSB:ReadCompletion - Data retrieval encountered error # 0xe00002eb, bytes read=0" Thanks. /Don |
_______________________________________________ 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
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.