Add wifi scan page to networks module.

This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2015-04-06 22:21:28 +05:30
1 parent 9b201a2daf
commit c0cd01221e
4 files changed
+64

No files matched your search

+11
View File
@@ -235,3 +235,14 @@ def delete_connection(name):
_('Failed to delete connection %s: '
'Connection not found.') % name)
conn.Delete()
def wifi_scan():
aps = []
for dev in NetworkManager.NetworkManager.GetDevices():
if dev.DeviceType != NetworkManager.NM_DEVICE_TYPE_WIFI:
continue
for ap in dev.SpecificDevice().GetAccessPoints():
aps.append({'ssid': ap.Ssid,
'strength': ord(ap.Strength)})
return aps