| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Maybe I’m just asking for the wrong properties. I get a CFMutableDictionaryRef object from a call to IORegistryEntryCreateCFProperties, passing in the io_service_t that represents my USB device. Using that CFMutableDictionaryRef properties object I can access a variety of properties, using code like cfTypeObject = CFDictionaryGetValue(properties, CFSTR(kUSBManufacturerStringIndex)). However, the only property name definitions available for manufacturer string, product string and serial number appear to be kUSBManufacturerStringIndex, kUSBProductStringIndex and kUSBSerialNumberStringIndex, which each return an 8-bit string selector value. It appears that I then need to use something like the code that David Ferguson provided to access the actual strings.
From: Don Clark [mailto:email@hidden]
Sent: Wednesday, April 20, 2005 12:44 PM
To: Chris Reed; <email@hidden> Fernando Urbina; <email@hidden> David Ferguson
Cc: <email@hidden>
Subject: Re: Access to the strings indexed by the IOUSBDeviceDescriptor
There are also methods on the IOUSBDeviceInterface that provide access to properties, but again the methods appear to only provide access to the string index values. Hopefully I’m just missing something simple.
/Don
On 4/20/05 9:25 AM, "Chris Reed" <email@hidden> wrote:
Also, don't forget that many of these strings are available in the IORegistry as a property of the IOUSBObject. The ones you asked about in particular.
-chris
From: usb-bounces+creed=email@hidden <mailto:usb-bounces%2Bcreed=email@hidden> [mailto:usb-bounces+creed=email@hidden] On Behalf Of Fernando Urbina
Sent: Tuesday, April 19, 2005 4:07 PM
To: David Ferguson
Cc: email@hidden; Don Clark
Subject: Re: Access to the strings indexed by the IOUSBDeviceDescriptor
And of course, you can look at the IOUSBFamily in Darwin to see how we do it. IOUSBDevice.cpp has the GetStringDescriptor(). It does a lot of error checking and deals with the correct endianness and stuff...
--
Fernando Urbina
USB Technology Team
Apple Computer, Inc.
On Apr 19, 2005, at 2:58 PM, David Ferguson wrote:
To get a string, you use the standard device requests (GET_DESCRIPTOR) described in the USB spec, chapter 9. Your code to do that might look something like (not tested, top of my head, be on the lookout for possiblebyte-swapping issues in the wValue/wIndex fields):
_______________________________________________ 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.