tags:

views:

33

answers:

2

Hello Experts

I am working on a project that will run on a small linux platform. All applications on the system must be written in c# that will be executed via mono. But that is causing me some problems with the network information port. All the examples I have been able to find on the topic on the internet is for .net, and it seems that the WlanInterface module is not implemented in mono.

So the simple question is then, how do I get information such as ssid, rssi, available APs, and its like in mono on linux? Is there a simple way, or do I have to write a service object in e.g. c++ or java to get the information?

A: 

You can invoke the command line utilities and parse their output via a pipe or something e.g.

iwconfig
iwlist

etc which will ship with a wifi-enabled Linux system.

MarkR
That was also my first idea, but I thought the guys behind mono would have done something brilliant :) Do you know for sure that the iwlist/iwconfig-path is my only option?
I assume that in principle you can call into the wireless library, but that might be a bit complicated. Invoking the executables sounds safer.
MarkR
A: 

damn, not what I was hoping to hear :)

Anyway, I found another solution I will try to pursue. Since the machine has got gnome on it, hijacking the information from the network manager via dbus could be the solution. This might also be a good idea, since I would like to receive an event when connection is lost.

I would still like to hear comments both on this idea, MarkR's idea and any other alternatives.

+1 for using NetworkManager via dbus. There's a rather nice 100% C# dbus library you can use.
mhutch
You wouldn't have to have an example of how to use that in c#? I have only been able to find python examples.
I *think* Banshee accesses NetworkManager over dbus to determine network state.
mhutch