mirror of git://git.sysmocom.de/ofono
test: Add modem argument to send-sms
This commit is contained in:
parent
d6fc5ffd5b
commit
aedd02a1fe
|
@ -3,22 +3,32 @@
|
||||||
import sys
|
import sys
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
print "Usage: %s [modem] <to> <message> <delivery report>" %\
|
||||||
|
(sys.argv[0])
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
if len(sys.argv) == 5:
|
||||||
'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 message using modem %s ..." % path
|
||||||
path = modems[0][0]
|
|
||||||
|
|
||||||
manager = dbus.Interface(bus.get_object('org.ofono', path),
|
|
||||||
|
mm = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
'org.ofono.MessageManager')
|
'org.ofono.MessageManager')
|
||||||
|
|
||||||
if len(sys.argv) == 4:
|
if len(sys.argv) == 5:
|
||||||
manager.SetProperty("UseDeliveryReports",
|
mm.SetProperty("UseDeliveryReports",
|
||||||
dbus.Boolean(int(sys.argv[1])))
|
dbus.Boolean(int(sys.argv[4])))
|
||||||
path = manager.SendMessage(sys.argv[1], sys.argv[2])
|
path = mm.SendMessage(sys.argv[2], sys.argv[3])
|
||||||
else:
|
else:
|
||||||
path = manager.SendMessage(sys.argv[1], sys.argv[2])
|
path = mm.SendMessage(sys.argv[1], sys.argv[2])
|
||||||
|
|
||||||
print path
|
print path
|
||||||
|
|
Loading…
Reference in New Issue