mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-21 18:04:00 +08:00
20 lines
512 B
Python
Executable File
20 lines
512 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) < 4):
|
|
print "Usage: %s <device> <clientfile> <file>" % (sys.argv[0])
|
|
sys.exit(1)
|
|
|
|
print "Creating Session"
|
|
path = client.CreateSession(sys.argv[1], { "Target": "OPP" })
|
|
opp = dbus.Interface(bus.get_object("org.bluez.obex", path),
|
|
"org.bluez.obex.ObjectPush")
|
|
|
|
opp.ExchangeBusinessCards(sys.argv[2], sys.argv[3])
|