Add test script for input service

This commit is contained in:
Marcel Holtmann 2007-05-09 07:09:58 +00:00
parent c4f49954f4
commit 011badf1a1
2 changed files with 23 additions and 1 deletions

View File

@ -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

22
input/test-input Executable file
View File

@ -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)