From 011badf1a19bb52052a0c5d3c7b77ce454a4ca25 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 May 2007 07:09:58 +0000 Subject: Add test script for input service --- input/test-input | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 input/test-input (limited to 'input/test-input') diff --git a/input/test-input b/input/test-input new file mode 100755 index 00000000..689e4723 --- /dev/null +++ b/input/test-input @@ -0,0 +1,22 @@ +#!/usr/bin/python + +import sys +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), + 'org.bluez.Manager') + +conn = manager.ActivateService('input') + +input = dbus.Interface(bus.get_object(conn, '/org/bluez/input'), + 'org.bluez.input.Manager') + +if (len(sys.argv) < 1): + print "Usage: %s
" % (sys.argv[0]) + sys.exit(1) + +address = sys.argv[1] + +device = input.CreateDevice(address) -- cgit From 90ca244669504fe6a1a6a2760da9ce71c8742f4c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 8 Oct 2007 11:14:20 +0000 Subject: Use the CreateSecureDevice method --- input/test-input | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'input/test-input') diff --git a/input/test-input b/input/test-input index 689e4723..a5fe9605 100755 --- a/input/test-input +++ b/input/test-input @@ -19,4 +19,4 @@ if (len(sys.argv) < 1): address = sys.argv[1] -device = input.CreateDevice(address) +device = input.CreateSecureDevice(address) -- cgit From 957ead88e8a90526631f1a767ba1006bc03b8084 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 22 Mar 2008 15:27:02 +0000 Subject: Update test script for input service --- input/test-input | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'input/test-input') diff --git a/input/test-input b/input/test-input index a5fe9605..7f41b6f6 100755 --- a/input/test-input +++ b/input/test-input @@ -13,10 +13,33 @@ conn = manager.ActivateService('input') input = dbus.Interface(bus.get_object(conn, '/org/bluez/input'), 'org.bluez.input.Manager') -if (len(sys.argv) < 1): - print "Usage: %s
" % (sys.argv[0]) +if (len(sys.argv) < 2): + print "Usage: %s " % (sys.argv[0]) + print "" + print " list" + print " create
" + print " remove " sys.exit(1) -address = sys.argv[1] - -device = input.CreateSecureDevice(address) +if (sys.argv[1] == "list"): + list = input.ListDevices() + print list + sys.exit(0) + +if (sys.argv[1] == "create"): + if (len(sys.argv) < 3): + print "Need address parameter" + else: + device = input.CreateSecureDevice(sys.argv[2]) + print device + sys.exit(0) + +if (sys.argv[1] == "remove"): + if (len(sys.argv) < 3): + print "Need object path parameter" + else: + input.RemoveDevice(sys.argv[2]) + sys.exit(0) + +print "Unknown command" +sys.exit(1) -- cgit