wpa_supplicant: Initial Revision 0.8.X
Based on:
commit 0725cc7b7efc434910e89865c42eda7ce61bbf08
Author: Jouni Malinen <j@w1.fi>
Date: Thu Apr 21 20:41:01 2011 +0300
Enable CONFIG_DRIVER_NL80211=y in the default configuration
nl80211 should be preferred over WEXT with any recent Linux
kernel version.
Change-Id: I26aec5afbbd4f4a1f5fd900912545b6f5050de64
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_supplicant/examples/wpas-dbus-new-getall.py b/wpa_supplicant/examples/wpas-dbus-new-getall.py
new file mode 100755
index 0000000..03da187
--- /dev/null
+++ b/wpa_supplicant/examples/wpas-dbus-new-getall.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+import dbus
+import sys, os
+import time
+import gobject
+
+def main():
+ bus = dbus.SystemBus()
+ wpas_obj = bus.get_object("fi.w1.wpa_supplicant1",
+ "/fi/w1/wpa_supplicant1")
+ props = wpas_obj.GetAll("fi.w1.wpa_supplicant1",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print "GetAll(fi.w1.wpa_supplicant1, /fi/w1/wpa_supplicant1):"
+ print props
+
+ if len(sys.argv) != 2:
+ os._exit(1)
+
+ ifname = sys.argv[1]
+
+ wpas = dbus.Interface(wpas_obj, "fi.w1.wpa_supplicant1")
+ path = wpas.GetInterface(ifname)
+ if_obj = bus.get_object("fi.w1.wpa_supplicant1", path)
+ props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print
+ print "GetAll(fi.w1.wpa_supplicant1.Interface, %s):" % (path)
+ print props
+
+ props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface.WPS",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print
+ print "GetAll(fi.w1.wpa_supplicant1.Interface.WPS, %s):" % (path)
+ print props
+
+ res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'BSSs',
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ if len(res) > 0:
+ bss_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0])
+ props = bss_obj.GetAll("fi.w1.wpa_supplicant1.BSS",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print
+ print "GetAll(fi.w1.wpa_supplicant1.BSS, %s):" % (res[0])
+ print props
+
+ res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'Networks',
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ if len(res) > 0:
+ net_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0])
+ props = net_obj.GetAll("fi.w1.wpa_supplicant1.Network",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print
+ print "GetAll(fi.w1.wpa_supplicant1.Network, %s):" % (res[0])
+ print props
+
+if __name__ == "__main__":
+ main()
+