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: Access to the strings indexed by the IOUSBDeviceDescriptor



Title: Re: Access to the strings indexed by the IOUSBDeviceDescriptor
The property names should be "USB Product Name", "USB Vendor Name", and "USB Serial Number".
 
Your io_service_t is a IOUSBDevice object, right? Try using the IORegistryExplorer to see what all properties are available on the objects you are looking at, and to verify that the object your code is looking at is the one you really want.
 
You should only need to send your own descriptor requests for non-standard string indices, afaik. Just to be sure, I checked and every IOUSBDevice instance on my system has the above properties, unless the string index is 0.
 
-chris


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

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.  

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



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.