mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-11 21:14:36 +08:00
20 lines
504 B
Python
Executable File
20 lines
504 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import sys
|
|
import dbus
|
|
|
|
bus = dbus.SessionBus()
|
|
client = dbus.Interface(bus.get_object("org.bluez.obex", "/org/bluez/obex"),
|
|
"org.bluez.obex.Client")
|
|
|
|
if (len(sys.argv) < 3):
|
|
print "Usage: %s <device> <target>" % (sys.argv[0])
|
|
sys.exit(1)
|
|
|
|
print "Creating Session"
|
|
session_path = client.CreateSession(sys.argv[1], { "Target": sys.argv[2] })
|
|
session = dbus.Interface(bus.get_object("org.bluez.obex", session_path),
|
|
"org.bluez.obex.Session")
|
|
|
|
print session.GetCapabilities()
|