3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

test: Update python scripts with dbus interface changes

This commit is contained in:
Andrew Zaborowski 2016-05-21 03:39:37 +02:00 committed by Denis Kenzior
parent ab1319a9d5
commit ea6db49e8d
2 changed files with 22 additions and 16 deletions

View File

@ -6,31 +6,37 @@ import dbus
bus = dbus.SystemBus() bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("net.connman.iwd", "/"), manager = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
"net.connman.iwd.Manager") "org.freedesktop.DBus.ObjectManager")
devices = manager.GetDevices() objects = manager.GetManagedObjects()
for path in objects:
if 'net.connman.iwd.Device' not in objects[path]:
continue
device = objects[path]['net.connman.iwd.Device']
for path in devices:
print("[ %s ]" % path) print("[ %s ]" % path)
properties = devices[path]
for key in properties.keys(): for key in device.keys():
val = properties[key] val = device[key]
print(" %s = %s" % (key, val)) print(" %s = %s" % (key, val))
print(" Networks:") print(" Networks:")
device = dbus.Interface(bus.get_object("net.connman.iwd", path), for path2 in objects:
"net.connman.iwd.Device") if not path2.startswith(path) or \
networks = device.GetNetworks() 'net.connman.iwd.Network' not in objects[path2]:
for path in networks: continue
print(" [ %s ]" % path)
properties = networks[path]
for key in properties.keys(): network = objects[path2]['net.connman.iwd.Network']
print(" [ %s ]" % path2)
for key in network.keys():
if key in ["SSID"]: if key in ["SSID"]:
val = properties[key] val = network[key]
val = "".join(map(chr, val)) val = "".join(map(chr, val))
else: else:
val = properties[key] val = network[key]
print(" %s = %s" % (key, val)) print(" %s = %s" % (key, val))

View File

@ -55,7 +55,7 @@ if __name__ == '__main__':
bus = dbus.SystemBus() bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('net.connman.iwd', "/"), manager = dbus.Interface(bus.get_object('net.connman.iwd', "/"),
'net.connman.iwd.Manager') 'net.connman.iwd.AgentManager')
path = "/test/agent/" + str(randrange(100)) path = "/test/agent/" + str(randrange(100))
object = Agent(bus, path) object = Agent(bus, path)