Re: how to let http brings up networkmanager modem connectivity?



On Wednesday 15 of September 2010 23:49:56 hong sheng wrote:
> Hi
> 
> I would skip the networkmanager applet in our platform. In stead, I want to
> let the http brower automatically bring up the 3G connectivity for
> NetworkManager. So, what d-bus message I should send to bring up the 3G
> connectivity ?
> 
> Thanks
> 
> Hong

To activate a connection, ActivateConnection method should be called via D-Bus 
on org.freedesktop.NetworkManager interface. The NM D-Bus API can be found at 
http://projects.gnome.org/NetworkManager/developers/spec-08.html

You can do it e.g.:
#!/bin/bash

SERVICE="org.freedesktop.NetworkManagerSystemSettings"
CONNECTION="/org/freedesktop/NetworkManagerSettings/2"
DEVICE="/org/freedesktop/NetworkManager/Devices/0"

dbus-send --system --print-reply --type=method_call --
dest='org.freedesktop.NetworkManager' \
'/org/freedesktop/NetworkManager' 
org.freedesktop.NetworkManager.ActivateConnection \
string:"$SERVICE" objpath:"$CONNECTION" objpath:"$DEVICE" objpath:"/"

or use command line tool nmcli:
nmcli nm con up id "your connection name"
or
nmcli nm con up uuid <connection uuid>

List connections with:
nmcli con list

Jirka

Note:
org.freedesktop.NetworkManagerSystemSettings service means system connections 
managed by NM itself (and stored via a plugin, e.g. keyfile) ~ "Available to 
all users"
org.freedesktop.NetworkManagerUserSettings service is run by clients (nm-
applet) and is available just while the client is up.


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