Blob: exchange-business-cards

Blob id: f28d90e302f1181913ea83c5570e5b6c06daa1c6

Size: 564 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later

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