From 8e0d244249c0ffdaef4ea3a2530cd356c7cc008f Mon Sep 17 00:00:00 2001 From: javiplx Date: Fri, 3 Dec 2010 22:34:49 +0000 Subject: [PATCH] Added fake service for x86 scratchbox git-svn-id: file:///svnroot/wifihood/trunk@74 c51dfc6a-5949-4919-9c8e-f207a149c383 --- wifiscand/wifiscand.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 wifiscand/wifiscand.py diff --git a/wifiscand/wifiscand.py b/wifiscand/wifiscand.py new file mode 100755 index 0000000..fe754e5 --- /dev/null +++ b/wifiscand/wifiscand.py @@ -0,0 +1,52 @@ +#!/usr/bin/python2.5 + +import osso +import gtk + +introspection = """\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n""" + +__version__ = "1.1" + +name = "wifiscan" +service = "org.javiplx." + name +object = "/org/javiplx/" + name +iface = "org.javiplx." + name + +def dbus_req_handler(interface, method, arguments, user_data): + if method == "Introspect" : + return introspection + if method == "wakeup" : + return "WifiScand ready" + if method == "start" : + return "Interface initialized" + if method == "stop" : + gtk.main_quit() + return + if method == "scan" : + print "return 00:1C:C0:CB:1A:72:-80" + return "00:1C:C0:CB:1A:72:-80" + return "Unknown method" + +osso_c = osso.Context(name, __version__, False) + +osso_rpc = osso.Rpc(osso_c) +osso_rpc.set_rpc_callback(service, object, iface, dbus_req_handler, ( "wlan0" , osso_c ) ) +gtk.main() + -- 1.7.9.5