Re: D-Bus Connection in NM 0.6.5 and i NM 0.7



On Tue, 2008-04-08 at 09:48 +0200, Marco Franke wrote:
> hi,
> I have written  a programm which connects over DBus to the networkmanager(NM) in version .6.5. For example, I ask the NM for the devices or for Wlans.
> 
> A question for 0.6.5: How can I ask over DBus, if i have a active connecton  with wired? I can ask if it is linked but I haven't found a function to get the information if a device  is connected? It is possible that the cable is plugged in but I have to active connection.

In 0.6.5, you ask for the list of devices, and then for each device you
check whether that device's state is CONNECTED.  If so, that's the
active connection, since NM 0.6.x and lower only support one active
connection at a time.

> I want to use this programm with the NM 0.7.  My question is : Can I use it the same way or  what do I change?

With the multiple connection support in 0.7, you ask the NM object for
the list of active connections using the D-Bus Properties interface.
For each of the active connections, you can query that active connection
and get the list of devices which are part of that active connection.

> If I have to change something, can I asked the version, so my programm can work with NM 0.6.5 and with 0.7 ? is There a overview about the functions, which I can use (in XML or in .h)?

There isn't a good overview for 0.6.x, but you can generate API
documentation from the NM sources quite easily; configure with
"--with-docs", then build, and it will spit out a spec.html in the doc/
directory.  Alternatively, you can take a look in the introspection/
directory which has a pretty understandable overview of the D-Bus
interface.

You can pretty easily test which version of NM you're running by calling
"GetDevices" (0.7) instead of "getDevices" (0.6.x).

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]