• 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: Firewire / USB load notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Firewire / USB load notifications


  • Subject: Re: Firewire / USB load notifications
  • From: Bob Ippolito <email@hidden>
  • Date: Wed, 28 Apr 2004 22:41:51 -0400

On Apr 28, 2004, at 1:40 PM, Matt Jaffa wrote:

Is there some way to use CoreFoundation, or Cocoa to be notified when a
Firewire HD Device or USB HD Device was plugged in?

And what disk it is (f.e. /dev/rdisk2 or /dev/rdisk3)

You need to use IOKit, which is more CoreFoundation than Cocoa, but will integrate just fine with NSRunLoop, etc.

First you should download the FireWire SDK and take a look at the FWNotifier and FWOffice (for Mr. Registry) examples.

For the implementation, you will probably set up IOServiceAddMatchingNotification calls to match the IOMediaBSDClient class on publish and terminated events. The BSD name should be the "BSD Name" property in the parent of each IOMediaBSDClient instance. This will match both devices ("disk0") and partitions ("disk0s3"), but you can always tell if it's a device if its "BSD Minor" is 0. It seems that a lot of things just can't be used in a matching dictionary, so you will have to do some experimenting to see how you can match it. I'm not sure if this is a bug, or just poor documentation...

-bob
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Fwd: Firewire / USB load notifications (From: Matt Jaffa <email@hidden>)

  • Prev by Date: Firewire / USB load notifications
  • Next by Date: Re: Firewire / USB load notifications
  • Previous by thread: Fwd: Firewire / USB load notifications
  • Next by thread: Re: Firewire / USB load notifications
  • Index(es):
    • Date
    • Thread