tizen 2.3.1 release
[framework/connectivity/bluez.git] / test / exchange-business-cards
1 #!/usr/bin/python
2
3 import sys
4 import dbus
5
6 bus = dbus.SessionBus()
7 client = dbus.Interface(bus.get_object("org.bluez.obex", "/org/bluez/obex"),
8                                         "org.bluez.obex.Client")
9
10 if (len(sys.argv) < 4):
11         print "Usage: %s <device> <clientfile> <file>" % (sys.argv[0])
12         sys.exit(1)
13
14 print "Creating Session"
15 path = client.CreateSession(sys.argv[1], { "Target": "OPP" })
16 opp = dbus.Interface(bus.get_object("org.bluez.obex", path),
17                                         "org.bluez.obex.ObjectPush")
18
19 opp.ExchangeBusinessCards(sys.argv[2], sys.argv[3])