summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-05-09 07:09:58 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-05-09 07:09:58 +0000
commit011badf1a19bb52052a0c5d3c7b77ce454a4ca25 (patch)
treef4f131368aac402755cb91710f83bfef7ceb9a2d /input
parentc4f49954f44f66e88df64207437c9d3a0c0be49a (diff)
Add test script for input service
Diffstat (limited to 'input')
-rw-r--r--input/Makefile.am2
-rwxr-xr-xinput/test-input22
2 files changed, 23 insertions, 1 deletions
diff --git a/input/Makefile.am b/input/Makefile.am
index 576580f9..339a166d 100644
--- a/input/Makefile.am
+++ b/input/Makefile.am
@@ -22,6 +22,6 @@ AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@
INCLUDES = -I$(top_srcdir)/common
-EXTRA_DIST = input.service input-api.txt
+EXTRA_DIST = input.service input-api.txt test-input
MAINTAINERCLEANFILES = Makefile.in
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 <address>" % (sys.argv[0])
+ sys.exit(1)
+
+address = sys.argv[1]
+
+device = input.CreateDevice(address)