mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 09:14:32 +08:00
23 lines
447 B
Plaintext
23 lines
447 B
Plaintext
|
#!/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)
|