Added dbus test program
authorjaviplx <javiplx@gmail.com>
Fri, 8 Oct 2010 14:11:22 +0000 (14:11 +0000)
committerjaviplx <javiplx@gmail.com>
Fri, 8 Oct 2010 14:11:22 +0000 (14:11 +0000)
git-svn-id: file:///svnroot/wifihood/trunk@23 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiscand/do_dbus [new file with mode: 0755]

diff --git a/wifiscand/do_dbus b/wifiscand/do_dbus
new file mode 100755 (executable)
index 0000000..05ba495
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SessionBus()
+
+object_path = "/org/javiplx/wifiscan"
+object_name = "org.javiplx.wifiscan"
+
+proxy = bus.get_object( object_name , object_path )
+
+proxy.wakeup()
+
+fps = {}
+if proxy.start() == "Interface initialized" :
+
+    scan = proxy.scan()
+    if scan :
+        for fingerprint in scan.split(" ") :
+            items = fingerprint.split(":")
+            rssi = int( items.pop() )
+            if rssi != -256 :
+                fps["".join(items)] = rssi
+print fps
+
+proxy.stop()
+