Re: NM automatically reconnects to WIFI AP automatically after commanded to disconnect from it.



On Wednesday 22 of December 2010 03:51:44 Greg Suarez wrote:
> Hi,
> 
> What I'm seeing in my application is when I command NM to disconnect from
> an AP (via DBUS) NM disconnects but then reconnects right away.
> AM I missing a step that needs to be done first?
> 
> I'm using the method org.freedesktop.NetworkManager.DeactivateConnection
> 

DeactivateConnection() method deactivates the connection, but if another (or 
the same) connection is marked as "Connect automatically" it will be re-
connected right away.

If you want to prevent reconnecting, you need to use another method (that is 
called by nm-applet as well): org.freedesktop.NetworkManager.Device.Disconnect

This method disconnects the device and prevents it from auto-connecting until 
it is connected manually again.

Example:
dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager 
/org/freedesktop/NetworkManager/Devices/1 
org.freedesktop.NetworkManager.Device.Disconnect

(Change /org/freedesktop/NetworkManager/Devices/1 to your device)

You can use too:
nmcli dev disconnect iface wlan0   (for Disconnect)
or
nmcli con down id "Auto APNAME"  (for DeactivateConnection)


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

Jirka


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