2016-04-28 01:27:25 +02:00
|
|
|
#!/usr/bin/python3
|
2015-03-26 06:11:18 +01:00
|
|
|
|
|
|
|
import sys
|
|
|
|
import dbus
|
|
|
|
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
|
|
|
|
manager = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
|
2016-05-21 03:39:37 +02:00
|
|
|
"org.freedesktop.DBus.ObjectManager")
|
|
|
|
objects = manager.GetManagedObjects()
|
|
|
|
|
|
|
|
for path in objects:
|
|
|
|
if 'net.connman.iwd.Device' not in objects[path]:
|
|
|
|
continue
|
|
|
|
|
2016-07-14 02:38:07 +02:00
|
|
|
properties = objects[path]['net.connman.iwd.Device']
|
|
|
|
device = dbus.Interface(bus.get_object("net.connman.iwd", path),
|
|
|
|
'net.connman.iwd.Device')
|
2015-03-26 06:11:18 +01:00
|
|
|
|
|
|
|
print("[ %s ]" % path)
|
|
|
|
|
2016-07-14 02:38:07 +02:00
|
|
|
for key in properties:
|
|
|
|
val = properties[key]
|
2015-03-26 06:11:18 +01:00
|
|
|
print(" %s = %s" % (key, val))
|
|
|
|
|
2016-07-14 02:38:07 +02:00
|
|
|
print(" Sorted networks:")
|
2016-05-21 03:39:37 +02:00
|
|
|
|
2016-07-14 02:38:07 +02:00
|
|
|
for path2, ssid, rssi, security in device.GetOrderedNetworks():
|
2016-05-21 03:39:37 +02:00
|
|
|
print(" [ %s ]" % path2)
|
2015-03-26 06:11:18 +01:00
|
|
|
|
2016-07-14 02:38:07 +02:00
|
|
|
print(" SSID = %s" % (ssid,))
|
|
|
|
print(" Signal strength = %i dBm" % (rssi / 100,))
|
|
|
|
print(" Security = %s" % (security,))
|