Re: How to get the ESSID of the active wifi network?



On Tuesday 22 of March 2011 13:59:47 Jos Collin-ERS,HCLTech wrote:
> Hello,
> 
> I believe that "the current network" is the one which is Active.
> 
> Replace /org/freedesktop/NetworkManager/Devices/eth1 with the object path
> of the ActiveAccessPoint. Then get the Ssid property of that
> ActiveAccessPoint.
> 
> Regards,
> Jos Collin
>

Yeah, correct.

Use:
dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager 
/org/freedesktop/NetworkManager/Devices/1 org.freedesktop.DBus.Properties.Get 
string:org.freedesktop.NetworkManager string:ActiveAccessPoint

You'll get:
method return sender=:1.264 -> dest=:1.290 reply_serial=2
   variant       object path "/org/freedesktop/NetworkManager/AccessPoint/7"

and:
dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager 
/org/freedesktop/NetworkManager/AccessPoint/7
org.freedesktop.DBus.Properties.Get string:org.freedesktop.NetworkManager 
string:ssid

you'll get
method return sender=:1.264 -> dest=:1.291 reply_serial=2
   variant       array of bytes "THE_SSID"

Jirka

PS: devices are not marked as eth1, etc., but with D-Bus paths 
/org/freedesktop/NetworkManager/Devices/<number>

> _______________________________
> From: networkmanager-list-bounces gnome org
> [networkmanager-list-bounces gnome org] On Behalf Of Jonathan Haug
> [jonathanhaug wolke7 net] Sent: Tuesday, March 22, 2011 5:38 PM
> To: networkmanager-list gnome org
> Subject: How to get the ESSID of the active wifi network?
> 
> Hi there,
> 
> I'm looking for a bash command to get the ESSID of the current network
> via d-bus.
> 
> I tried
> 
> dbus-send --system --dest=org.freedesktop.NetworkManager
> --print-reply /org/freedesktop/NetworkManager/Devices/eth1
> org.freedesktop.NetworkManager.getActiveNetwork
> 
> but this one seems a bit outdate. Im using Network Manager 0.8.1.
> 
> Any help for me?
> 
> Thanks in advance
> 
> Jonathan



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