blob: 732f54d20f8b826f4c08cfaebc46484d4e0b55a5 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001#!/usr/bin/python
2
3import dbus
4import sys, os
5import time
6import gobject
7
8def main():
9 bus = dbus.SystemBus()
10 wpas_obj = bus.get_object("fi.w1.wpa_supplicant1",
11 "/fi/w1/wpa_supplicant1")
12 props = wpas_obj.GetAll("fi.w1.wpa_supplicant1",
13 dbus_interface=dbus.PROPERTIES_IFACE)
Hai Shalom74f70d42019-02-11 14:42:39 -080014 print("GetAll(fi.w1.wpa_supplicant1, /fi/w1/wpa_supplicant1):")
15 print(props)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070016
17 if len(sys.argv) != 2:
18 os._exit(1)
19
20 ifname = sys.argv[1]
21
22 wpas = dbus.Interface(wpas_obj, "fi.w1.wpa_supplicant1")
23 path = wpas.GetInterface(ifname)
24 if_obj = bus.get_object("fi.w1.wpa_supplicant1", path)
25 props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface",
26 dbus_interface=dbus.PROPERTIES_IFACE)
Hai Shalom74f70d42019-02-11 14:42:39 -080027 print('')
28 print("GetAll(fi.w1.wpa_supplicant1.Interface, %s):" % (path))
29 print(props)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070030
31 props = if_obj.GetAll("fi.w1.wpa_supplicant1.Interface.WPS",
32 dbus_interface=dbus.PROPERTIES_IFACE)
Hai Shalom74f70d42019-02-11 14:42:39 -080033 print('')
34 print("GetAll(fi.w1.wpa_supplicant1.Interface.WPS, %s):" % (path))
35 print(props)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070036
37 res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'BSSs',
38 dbus_interface=dbus.PROPERTIES_IFACE)
39 if len(res) > 0:
40 bss_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0])
41 props = bss_obj.GetAll("fi.w1.wpa_supplicant1.BSS",
42 dbus_interface=dbus.PROPERTIES_IFACE)
Hai Shalom74f70d42019-02-11 14:42:39 -080043 print('')
44 print("GetAll(fi.w1.wpa_supplicant1.BSS, %s):" % (res[0]))
45 print(props)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070046
47 res = if_obj.Get("fi.w1.wpa_supplicant1.Interface", 'Networks',
48 dbus_interface=dbus.PROPERTIES_IFACE)
49 if len(res) > 0:
50 net_obj = bus.get_object("fi.w1.wpa_supplicant1", res[0])
51 props = net_obj.GetAll("fi.w1.wpa_supplicant1.Network",
52 dbus_interface=dbus.PROPERTIES_IFACE)
Hai Shalom74f70d42019-02-11 14:42:39 -080053 print('')
54 print("GetAll(fi.w1.wpa_supplicant1.Network, %s):" % (res[0]))
55 print(props)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070056
57if __name__ == "__main__":
58 main()