Help starting off with Glib/Dbus and HAL

Rob Taylor rob.taylor at codethink.co.uk
Thu Apr 24 19:08:31 PDT 2008


piroko wrote:
> Hello there. I have been trying to write a simple C program to listen to HAL
> events so that an action can be taken when an external hard drive (or
> similar device) is plugged in, for the past three days now. I've read loads
> of documentation, looked at example code from IBM and other sources, and
> still cannot for the life of me figure out this simple task. I started off
> trying to use the C API directly, but after being discouraged from this,
> have moved to trying the glib bindings, only to find that I still can't
> grasp it... Does anyone out there have some simple example code I could look
> at to try to figure out where to even begin? Anything would be very
> appreciated... Thank you.

Its probably best to just use libhal. Its pretty well documented, but 
you can look at lshal.c[1] for a simple(ish) example of how to use it.

Good luck,
Rob

[1] 
http://gitweb.freedesktop.org/?p=hal.git;a=blob;h=3bd39901293c5c1f7031be1fbafedad7ae86ef85;hb=59584aacf583b32cab917ba3922c103963df1402;f=tools/lshal.ch


More information about the dbus mailing list