summaryrefslogtreecommitdiffstats
path: root/test/test-ussd
diff options
context:
space:
mode:
authorBertrand Aygon <bertrand.aygon@intel.com>2011-06-08 15:50:39 +0200
committerDenis Kenzior <denkenz@gmail.com>2011-06-06 15:08:19 -0500
commitfa88c1a6b0aa223b0f6b8b8ffb30ea76089ffe15 (patch)
treeca77f73b785e6dc68ed0aa01bae72510a233f1e1 /test/test-ussd
parentc93d3eb1298c05f7d161c248c8f40f42cbe19e76 (diff)
downloadofono-fa88c1a6b0aa223b0f6b8b8ffb30ea76089ffe15.tar.bz2
test: Add modem argument to test-ussd
Diffstat (limited to 'test/test-ussd')
-rwxr-xr-xtest/test-ussd16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/test-ussd b/test/test-ussd
index d4c1e279..c21f5e3a 100755
--- a/test/test-ussd
+++ b/test/test-ussd
@@ -37,7 +37,7 @@ def stdin_handler(fd, condition):
if __name__ == "__main__":
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)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -48,8 +48,16 @@ if __name__ == "__main__":
'org.ofono.Manager')
modems = manager.GetModems()
- ss = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
- 'org.ofono.SupplementaryServices')
+ modem = modems[0][0]
+
+ if (len(sys.argv) == 2):
+ ussd = sys.argv[1]
+ else:
+ modem = sys.argv[1]
+ ussd = sys.argv[2]
+
+ ss = dbus.Interface(bus.get_object('org.ofono', modem),
+ 'org.ofono.SupplementaryServices')
props = ss.GetProperties()
for p in props:
@@ -59,7 +67,7 @@ if __name__ == "__main__":
ss.connect_to_signal("RequestReceived", ussd_request_received)
ss.connect_to_signal("PropertyChanged", ussd_property_changed)
- print ss.Initiate(sys.argv[1], timeout=100)
+ print ss.Initiate(ussd, timeout=100)
gobject.io_add_watch(sys.stdin, gobject.IO_IN, stdin_handler)