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: [OSX] ReadPipe error UserSpace



I try read a pipe with the ReadPipeTO function but i've an error
e0004051. I don't understand where is the problem.

I'm pretty sure this is a time out error, its the sort of thing you'd expect to happen using ReadPipeTO, as the TO bit means use a timeout. What timeout values are you using?

To decode error messages, have a look in error.h, or
<http://developer.apple.com/techpubs/macosx/Darwin/IOKit/DeviceInterfaces/AccessingHardware/AH_Overview/Error_Return_Values.html>.

It turns out 0xe0004xxx is a USB error code. In USB.h you'll find a
USB error 0x51 is a time out.

#define kIOUSBTransactionTimeout iokit_usb_err(81) // 0x51  time out


With the ReadPipe function if i delete the
"numBytesread=sizeof(gBuffer);" line i've an e00002c8 return error.

That looks like a general IOKit error.

#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure

I don't know what your code change is doing, but maybe you're
poassing  uninitialised data as the size to read, this would
generally cause all sorts of memory errors.

Thanks ben

You'll find below the part of the source code concerned by the errors.
In fact, i serves me as this model to set up a driver for a USB modem.

With the ReadPipe function include in the driver modem return 10000003 error number.
It's an UserSpace Librairy error ??


Thank for your help

Manu

Sources of driver modem is available at : http://perso.wanadoo.fr/pxd/eci/FTP/Sources/eci-load2.sit



------------------------ USBSimple Source Code ---------------------------------

unsigned char		gBuffer[64];
UInt32			numBytesRead;
.
.
.

err = (*intf)->WritePipeTO(intf,1,kTestMessage,strlen(kTestMessage),1000,1000);

if(kIOReturnNoDevice == err)
{
	printf("erreur IOService :%08x\n",err);
	closeInterfaceInterface (intf);
	return 1;
}

if(kIOReturnNotOpen == err)
{
	printf("Interface Non Ouverte :%08x\n",err);
	closeInterfaceInterface (intf);
	return 1;
}

if(kIOReturnSuccess != err)
{
	printf("Echec par IOReturnSuccess :%08x\n",err);
	closeInterfaceInterface (intf);
	return 1;
}

printf("Ecriture de %s (%ld Bytes) \n",kTestMessage,strlen(kTestMessage));

numBytesRead = sizeof(gBuffer);

err = (*intf)->ReadPipeTO(intf,2,gBuffer, &numBytesRead,1000,1000);

if(kIOReturnNoDevice == err)
{
	printf("erreur IOService :%08x",err);
	closeInterfaceInterface (intf);
	return 1;
}

if(kIOReturnNotOpen == err)
{
	printf("Interface Non Ouverte :%08x",err);
	closeInterfaceInterface (intf);
	return 1;
}

if(kIOReturnSuccess != err)
{
	printf("Echec par IOReturnSuccess :%08x",err);
	closeInterfaceInterface (intf);
	return 1;
}

printf("Lu %ld bytes", numBytesRead);
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



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.