summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)