mirror of git://git.sysmocom.de/ofono
test: Add modem argument to initiate-ussd
This commit is contained in:
parent
f746cba504
commit
85b0d8accb
|
@ -4,7 +4,7 @@ import sys
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
if (len(sys.argv) < 2):
|
if (len(sys.argv) < 2):
|
||||||
print "Usage: %s <ussd-string>" % (sys.argv[0])
|
print "Usage: %s [modem] <ussd-string>" % (sys.argv[0])
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
|
@ -13,7 +13,13 @@ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||||
'org.ofono.Manager')
|
'org.ofono.Manager')
|
||||||
|
|
||||||
modems = manager.GetModems()
|
modems = manager.GetModems()
|
||||||
path = modems[0][0]
|
|
||||||
|
if (len(sys.argv) == 2):
|
||||||
|
path = modems[0][0]
|
||||||
|
ussdstring = sys.argv[1]
|
||||||
|
else:
|
||||||
|
path = sys.argv[1]
|
||||||
|
ussdstring = sys.argv[2]
|
||||||
|
|
||||||
ussd = dbus.Interface(bus.get_object('org.ofono', path),
|
ussd = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
'org.ofono.SupplementaryServices')
|
'org.ofono.SupplementaryServices')
|
||||||
|
@ -26,7 +32,7 @@ print "State: %s" % (state)
|
||||||
if state != "idle":
|
if state != "idle":
|
||||||
sys.exit(1);
|
sys.exit(1);
|
||||||
|
|
||||||
result = ussd.Initiate(sys.argv[1], timeout=100)
|
result = ussd.Initiate(ussdstring, timeout=100)
|
||||||
|
|
||||||
properties = ussd.GetProperties()
|
properties = ussd.GetProperties()
|
||||||
state = properties["State"]
|
state = properties["State"]
|
||||||
|
|
Loading…
Reference in New Issue