Waiting for a USB device to connect
Waiting for a USB device to connect
- Subject: Waiting for a USB device to connect
- From: Patrick Quinn-Graham <email@hidden>
- Date: Thu, 6 Sep 2007 10:38:32 +0100
Howdy all,
I have a little app that shows information from an attached Huawei
E220 HSDPA modem, does this by reading from /dev/tty.HUAWEIMobile-
Pcui. In general, not too difficult.
The only problem I have is with detecting it being plugged in. It's
easy to check (can we open the /dev/tty?), so a quick check on
startup is fine for that. But, if one isn't plugged in (or it's
unplugged while the app is running), then polling in the app to check
if it is there seems like totally the wrong way to do it - to me at
least.
Can I get a suggestion on the right way to do this? Is their a
notification I could subscribe to for USB devices being plugged in?
Or is there a "won't cause my head to explode too badly" way to watch
(without polling myself) to see if the /dev/tty comes into existence?
cheers,
Patrick Quinn-Graham - +44 78 7217 2213 - http://about.patrick.geek.nz
There's a 20% chance of tomorrow.
-- /usr/games/fortune
_______________________________________________
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