mirror of git://git.sysmocom.de/ofono
test: Add modem argument to send-vcard
This commit is contained in:
parent
aedd02a1fe
commit
fa552ed8c4
|
@ -3,18 +3,30 @@
|
||||||
import sys
|
import sys
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
|
if len(sys.argv) < 3:
|
||||||
|
print "Usage: %s [modem] <to> <vcard file>" % (sys.argv[0])
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
if len(sys.argv) == 4:
|
||||||
'org.ofono.Manager')
|
path = sys.argv[1]
|
||||||
|
else:
|
||||||
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||||
|
'org.ofono.Manager')
|
||||||
|
modems = manager.GetModems()
|
||||||
|
path = modems[0][0]
|
||||||
|
|
||||||
modems = manager.GetModems()
|
print "Send vcard using modem %s ..." % path
|
||||||
path = modems[0][0]
|
|
||||||
|
|
||||||
manager = dbus.Interface(bus.get_object('org.ofono', path),
|
sm = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
'org.ofono.SmartMessaging')
|
'org.ofono.SmartMessaging')
|
||||||
|
|
||||||
vcard = file(sys.argv[2]).read()
|
if len(sys.argv) == 4:
|
||||||
path = manager.SendBusinessCard(sys.argv[1], vcard)
|
vcard = file(sys.argv[3]).read()
|
||||||
|
path = sm.SendBusinessCard(sys.argv[2], vcard)
|
||||||
|
else:
|
||||||
|
vcard = file(sys.argv[2]).read()
|
||||||
|
path = sm.SendBusinessCard(sys.argv[1], vcard)
|
||||||
|
|
||||||
print path
|
print path
|
||||||
|
|
Loading…
Reference in New Issue