• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Discovering USB devices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Discovering USB devices


  • Subject: Re: Discovering USB devices
  • From: Ian Keith <email@hidden>
  • Date: Tue, 10 Jul 2007 11:29:21 -0400

Not as easy as you'd like, I'm sure. You'll need to use IOKit to find the USB devices of interest. Apple's USBPrivateDataSample sample code shows you how to set up notifications and watch for devices coming and going. It also does things you don't need to do but that will get you started. Once you have the IORegistry entry representing a particular USB device of interest, you can walk down its child nodes in the tree using IORegistryEntryGetChildIterator until you find the one containing the device path.

It's not hard but IOKit can be a bit daunting if you've never worked with it before. You should play with IORegistryExplorer, installed with the developer tools, to get an idea of how the registry is organized.

Ian Keith


On Jul 10, 2007, at 5:52 AM, Pierre Bernard wrote:


Hi!

Is there an easy way to discover connected USB devices and get their
UNIX name (e.g. /dev/cu.USA19QI181P1.1) ?

I tried reading the docs, but was overwhelmed. This is overkill. All
I need is the name of the device so I can hand it to a command line
tool.

Best,
Pierre

---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Discovering USB devices
  • Next by Date: Re: reason for getting NSFileHandle:writeData exception
  • Previous by thread: Re: Discovering USB devices
  • Next by thread: [job posting] Senior Mac Software Developer (music 2.0) - Tuneup Media, Inc.
  • Index(es):
    • Date
    • Thread