mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-04-13 12:17:53 +02:00
test: Update the list-devices script
This commit is contained in:
parent
175fd00c6b
commit
64398f3143
@ -31,6 +31,8 @@ for path, phy in tree.children.items():
|
|||||||
|
|
||||||
for key in properties:
|
for key in properties:
|
||||||
val = properties[key]
|
val = properties[key]
|
||||||
|
if key == 'SupportedModes':
|
||||||
|
val = [str(mode) for mode in val]
|
||||||
print(" %s = %s" % (key, val))
|
print(" %s = %s" % (key, val))
|
||||||
|
|
||||||
print(" Devices:")
|
print(" Devices:")
|
||||||
@ -39,21 +41,28 @@ for path, phy in tree.children.items():
|
|||||||
if 'net.connman.iwd.Device' not in device.interfaces:
|
if 'net.connman.iwd.Device' not in device.interfaces:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
properties = device.interfaces['net.connman.iwd.Device']
|
|
||||||
device = dbus.Interface(bus.get_object("net.connman.iwd", path2),
|
|
||||||
'net.connman.iwd.Device')
|
|
||||||
|
|
||||||
print(" [ %s ]" % path2)
|
print(" [ %s ]" % path2)
|
||||||
|
for interface in device.interfaces:
|
||||||
|
name = interface.rsplit('.', 1)[-1]
|
||||||
|
if name not in ('Device', 'Station', 'AccessPoint', 'AdHoc'):
|
||||||
|
continue
|
||||||
|
|
||||||
for key in properties:
|
properties = device.interfaces[interface]
|
||||||
val = properties[key]
|
for key in properties:
|
||||||
print(" %s = %s" % (key, val))
|
val = properties[key]
|
||||||
|
print(" %s.%s = %s" % (name, key, val))
|
||||||
|
|
||||||
print(" Sorted networks:")
|
if name != 'Station':
|
||||||
|
continue
|
||||||
|
|
||||||
for path3, ssid, rssi, security in device.GetOrderedNetworks():
|
print(" Sorted networks:")
|
||||||
print(" [ %s ]" % path3)
|
|
||||||
|
|
||||||
print(" SSID = %s" % (ssid,))
|
station = dbus.Interface(bus.get_object("net.connman.iwd", path2),
|
||||||
print(" Signal strength = %i dBm" % (rssi / 100,))
|
'net.connman.iwd.Station')
|
||||||
print(" Security = %s" % (security,))
|
for path3, rssi in station.GetOrderedNetworks():
|
||||||
|
print(" [ %s ]" % path3)
|
||||||
|
|
||||||
|
properties2 = objects[path3]['net.connman.iwd.Network']
|
||||||
|
print(" SSID = %s" % (properties2['Name'],))
|
||||||
|
print(" Signal strength = %i dBm" % (rssi / 100,))
|
||||||
|
print(" Security = %s" % (properties2['Type'],))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user