From 011badf1a19bb52052a0c5d3c7b77ce454a4ca25 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 May 2007 07:09:58 +0000 Subject: [PATCH] Add test script for input service --- input/Makefile.am | 2 +- input/test-input | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 input/test-input diff --git a/input/Makefile.am b/input/Makefile.am index 576580f9f..339a166dd 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 000000000..689e4723a --- /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)