Hal and Mono

Nil Gradisnik ghaefbgtk at gmail.com
Mon Jun 19 06:46:59 PDT 2006


I'm interested in using Hal with my Mono code i.e. C#

My main interest is to extract information about computer hardware, I
can see a lot of information in hal-device-manager, so I want to
access this info from my C# code.

I belive I can "comunicate" with Hal using DBus(dbus-sharp). I found
some info in mono/REDME and mono/example/ files found in DBus souce
package. I don't quite understand how to use it with Hal.

This is what I have so far:

[CODE]
using DBus;
...
Connection connection = Bus.GetSessionBus();
Service service = new Service(connection, "org.feedesktop.Hal");

service.GetObject(???, "/org/freedesktop/Hal/Manager");
...
[/CODE]

It's not much as you can see. I don't know what to use as System.Type
there. I was looking at the python example found on redhat site:
http://www.redhat.com/magazine/003jan05/features/hal/#notifdesktop
But I didn't managed to translate it to my C# project.

I searched Google a lot about this, I just want to see some example
code or something. Searching through Banshee,Beagle,... code is really
hard.

So how would I get a simple information like harddisk model name or
capacity from Hal using C# code ? I just need some pointers on this
please.

Thanks


More information about the hal mailing list