mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 01:04:40 +08:00
Add test script for input service
This commit is contained in:
parent
c4f49954f4
commit
011badf1a1
@ -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
22
input/test-input
Executable 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)
|
Loading…
Reference in New Issue
Block a user