Move scanner UI out of the main package
[wifihood] / wifiscand / do_scan
1 #!/usr/bin/python
2
3 import osso
4
5 osso_context = osso.Context("test_scanner", "1.0", False)
6 osso_rpc = osso.Rpc(osso_context)
7
8 scan = osso_rpc.rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "scan", wait_reply = True)
9
10 fps = {}
11 for fingerprint in scan.split(" ") :
12     items = fingerprint.split(":")
13     rssi = int( items.pop() )
14     if rssi != -256 :
15         fps["".join(items)] = rssi
16 print fps
17