Mailing Lists: Apple Mailing Lists

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

ReadPipe returns kIOReturnOverrun error



Hello, all.

Today I encountered "kIOReturnOverrun" when reading pipe.

I cannot find out why this error occurred, because I use almost same source for UNIX tool, and it works for same USB device. I'm now Converting Objective-C class. The code follows:

Please tell me what should I check.

- (int)read:(void *)buf
           :(const size_t)size
{
    int err;

    UInt32 readSize = (UInt32)size;

    memset(buf, 0, size);

for (int i = 0; i < 10; ++i) {
usleep(WAIT_TIME);
err = (int)(*interfaceIntf)->GetPipeStatus(interfaceIntf, inPipeRef);
if (err) {
if (err == kIOUSBPipeStalled) {
DEBUGF("pipe stalled. (%d)\n", (int)err);
err = (int)(*interfaceIntf)->ClearPipeStall (interfaceIntf, inPipeRef);
if (err) {
DEBUGF("ClearPipeStall failed. (0x%08x)\n", (int) err);
return err;
}
}
else {
DEBUGF("PipeStatus failed. (0x%08x)\n", (int)err);
}
}


usleep(WAIT_TIME);
err = (int)(*interfaceIntf)->ReadPipe(interfaceIntf,
inPipeRef,
buf,
&readSize);
if (err) {
ERRORF("ReadPipe failed. (0x%08x)\n", err); // <- got error here
return err;
}
else if (!readSize) {
continue;
}
else if (size != readSize) {
ERRORF("read size error. (%d != %d)\n", readSize, size);
return READ_SIZE_ERR;
}
break;
}


    [self dumpIO:NO :buf :size];

    return err;
}

_______________________________________________
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


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.