Re: networkmanager control issue



On Tue, 2010-03-16 at 10:52 +0800, Edward_Doong wistron com wrote:
> Dear,
> 
>            I study network-manager 0.8 first time by myself.
> 
> And I meet some issue. Now I use python & gtk+ language.
> 
> I want to control all network interfaces in my window.
> 
> What do I add D-bus script in my language,
> 
> Like this : 
> 
> First window I can scan AP & choice.

NetworkManager periodically scans for you, though we're looking into
making a scan request call via D-Bus if you want updated AP lists more
often than every 2 minutes, which I suspect you'd be interested in.

You can get the list of all APs the devices sees via D-Bus; see the NM
D-Bus API spec here:

http://projects.gnome.org/NetworkManager/developers/spec-08.html

This allows you to ask NetworkManager for the AP list for a specific
wifi device and get each AP's details like signal strength and
encryption type.

> Second window I can type password.

NetworkManager doesn't quite operate like that; instead you have "saved
connections" (representing all the parameters needed to connect to a
specific network) that the user-interface applet provides to
NetworkManager via D-Bus.  NM will only connect to APs that are
specified by these "saved connections".  How you store that saved
connection is up to your applet; the GNOME nm-applet saves them in
GConf, the KDE networkmanager applet saves them in other ways.  The
programs that provide this connection data to NM are called "settings
services".

So when you want to connect, your applet does the following:

1) do I have a saved connection that matches up with this access point?
If so, tell NM to connect to the AP using this saved connection.

2) If not, create a saved connection, tell NetworkManager that you've
created a new saved connection via D-Bus (see the system settings
interface documentation [1]), then tell NM that you want to connect to
the AP using that saved connection.

3) When the D-Bus ActivateConnection() call returns, it'll send an
"ActiveConnection" object back to you, which you can use to track the
status of the in-progress connection to the access point, and you can
show that progress in the UI.

If you want any other help or clarification, let me know.

Dan

[1] http://projects.gnome.org/NetworkManager/developers/spec-08.html#org.freedesktop.NetworkManagerSettings




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