Discussion:
[BitPim-devel] USB Port Auto Notification to BitPim
Joe Pham
2006-08-31 03:13:16 UTC
Permalink
Yet another approach:

1. Using dnotify, BitPim monitors '/var/bitpim'.
2. Hotplug script updates '/var/bitpim/dnotify.log'
3. After being signaled, BitPim reads '/var/bitpim/dnotify.log' and
processes the data (add/del what port) accordingly.

This works well, though there's some lag between when a phone is
connected and when BitPim is notified. I'll also look into DBUS and
see if that'd work any better.

Thoughts or comments?

-Joe Pham



_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Roger Binns
2006-08-31 05:12:05 UTC
Permalink
Post by Joe Pham
1. Using dnotify, BitPim monitors '/var/bitpim'.
Just monitor /proc/bus/usb or whatever it is called. You don't care
what the specific change is, just that there is one.

Roger
Joe Pham
2006-08-31 17:23:12 UTC
Permalink
Post by Roger Binns
Just monitor /proc/bus/usb or whatever it is called
Good suggestion. However:

1. dnotify does not work with /proc until 2.6-15 or so.
2. dnotify does not work with subdirs.

-Joe Pham



_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Roger Binns
2006-09-01 02:48:12 UTC
Permalink
Post by Joe Pham
Post by Roger Binns
Just monitor /proc/bus/usb or whatever it is called
1. dnotify does not work with /proc until 2.6-15 or so.
2. dnotify does not work with subdirs.
inotify is the replacement for dnotify and should be used instead.

http://lwn.net/Articles/104343/
Loading...