wpas-dbus-new-getall.py
Go to the documentation of this file.
00001 #!/usr/bin/python
00002 
00003 import dbus
00004 import sys, os
00005 import time
00006 import gobject
00007 
00008 def main():
00009         bus = dbus.SystemBus()
00010         wpas_obj = bus.get_object("fi.w1.wpa_supplicant1",
00011                                   "/fi/w1/wpa_supplicant1")
00012         props = wpas_obj.GetAll("fi.w1.wpa_supplicant1",
00013                                 dbus_interface=dbus.PROPERTIES_IFACE)
00014         print "GetAll(fi.w1.wpa_supplicant1, /fi/w1/wpa_supplicant1):"
00015         print props
00016 
00017         if len(sys.argv) != 2:
00018                 os._exit(1)
00019 
00020         ifname = sys.argv[1]
00021 
00022         wpas = dbus.Interface(wpas_obj, "fi.w1.wpa_supplicant1")
00023         path = wpas.GetInterface(ifname)
00024         if_obj = bus.get_object("fi.w1.wpa_supplicant1", path)
00025         props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface",
00026                               dbus_interface=dbus.PROPERTIES_IFACE)
00027         print
00028         print "GetAll(fi.w1.wpa_supplicant1.Interface, %s):" % (path)
00029         print props
00030 
00031         props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface.WPS",
00032                               dbus_interface=dbus.PROPERTIES_IFACE)
00033         print
00034         print "GetAll(fi.w1.wpa_supplicant1.Interface.WPS, %s):" % (path)
00035         print props
00036 
00037         res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'BSSs',
00038                          dbus_interface=dbus.PROPERTIES_IFACE)
00039         if len(res) > 0:
00040                 bss_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0])
00041                 props = bss_obj.GetAll("fi.w1.wpa_supplicant1.BSS",
00042                                        dbus_interface=dbus.PROPERTIES_IFACE)
00043                 print
00044                 print "GetAll(fi.w1.wpa_supplicant1.BSS, %s):" % (res[0])
00045                 print props
00046 
00047         res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'Networks',
00048                          dbus_interface=dbus.PROPERTIES_IFACE)
00049         if len(res) > 0:
00050                 net_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0])
00051                 props = net_obj.GetAll("fi.w1.wpa_supplicant1.Network",
00052                                        dbus_interface=dbus.PROPERTIES_IFACE)
00053                 print
00054                 print "GetAll(fi.w1.wpa_supplicant1.Network, %s):" % (res[0])
00055                 print props
00056 
00057 if __name__ == "__main__":
00058         main()
00059 


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:33:21