Mailing Lists: Apple Mailing Lists

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

Handle to USB device



Hi List:

I'm working on a USB device that uses the EZ-USB AN2131 chip. I am writing a framework which will eventually serve as a USB driver for the device. The manufacturer insists that in order for this device to work under OS X, that a handle to the device must be created and this handle is referenced in every command sent to it. They say the reason is that more than one device can be plugged into the usb box. They also say that without a created handle to the device that this will not work. Below is the Windows code that they supplied. They explain that they create the handle by creating a file and the code is shown below.



bool
OpenUsbDriver(){
char completeDeviceName[64] = "";
strcat (completeDeviceName,"\\\\.\\");
strcat (completeDeviceName,"xxxxx-0");


hDeviceHandle = CreateFile( completeDeviceName,
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
if (hDeviceHandle == INVALID_HANDLE_VALUE) {
return (false);
}
return (true);
}

Is there a way to duplicate this in OS X? Or is there another way to create the handle? Help is appreciated.

Sincerely,


Mike Krugman
 _______________________________________________
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.