• 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: notification when device change in /dev
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: notification when device change in /dev


  • Subject: Re: notification when device change in /dev
  • From: Kyle Sluder <email@hidden>
  • Date: Wed, 26 Feb 2014 16:06:24 -0800

On Wed, Feb 26, 2014, at 03:19 PM, Roland King wrote:
> Is there an NSNotification or some other kind of notification you can
> subscribe to when there's a change in /dev? I'm dealing with an old
> USB-serial device which creates a cu/tty when inserted (and removed when
> removed)  and I'd like to get a notification when that happens so I can
> update UI.
>
> I've hunted around the docs but clearly haven't found the right one yet.
> I wish there were a master list of all system notifications somewhere,
> would be handy to find them, or rule out that they exist.

Use IOKitLib to hear about devices straight from the kernel, then work
out what /dev node they got mapped to.

See Finding and Accessing Devices in the Accessing Hardware from
Applications documentation, particularly the "Setting Up a Matching
Dictionary to Find Device Files" section:
<https://developer.apple.com/library/mac/documentation/devicedrivers/conceptual/AccessingHardware/AH_Finding_Devices/AH_Finding_Devices.html#//apple_ref/doc/uid/TP30000379-BAJDAJDJ>

--Kyle Sluder
_______________________________________________

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


References: 
 >notification when device change in /dev (From: Roland King <email@hidden>)

  • Prev by Date: notification when device change in /dev
  • Next by Date: Re: notification when device change in /dev
  • Previous by thread: notification when device change in /dev
  • Next by thread: Re: notification when device change in /dev
  • Index(es):
    • Date
    • Thread