diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-04 08:16:20 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-04 08:16:20 +0000 |
commit | 3f756f2aa21b6f442451fd816aa8a313ed65f226 (patch) | |
tree | 74ba47cdfad5890f19cffb806cffca68fe21431c | |
parent | 12f87334e7f68864c3dbe2c753a5422249b30730 (diff) |
Add code for calling CreatePairedDevice
-rwxr-xr-x | hcid/simple-agent | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hcid/simple-agent b/hcid/simple-agent index f770e22a..e502ed0d 100755 --- a/hcid/simple-agent +++ b/hcid/simple-agent @@ -5,6 +5,7 @@ import gobject import dbus import dbus.service import dbus.mainloop.glib +import sys class Agent(dbus.service.Object): @dbus.service.method("org.bluez.Agent", @@ -55,6 +56,9 @@ class Agent(dbus.service.Object): print "Cancel" return +def create_device_reply(reply): + print "Got reply" + if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) @@ -72,6 +76,11 @@ if __name__ == '__main__': adapter.RegisterAgent(path, "DisplayOnly") print "Agent registered" + if len(sys.argv) > 1: + adapter.CreatePairedDevice(sys.argv[1], "/", "DisplayOnly", + reply_handler=create_device_reply, + error_handler=create_device_reply) + mainloop = gobject.MainLoop() mainloop.run() |