---
test/test-ussd | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/test/test-ussd b/test/test-ussd
index d4c1e27..c21f5e3 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)
--
1.7.4.1
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Show replies by date
Hi Bertrand,
On 06/08/2011 08:50 AM, Bertrand Aygon wrote:
---
test/test-ussd | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
Patch has been applied with a modified commit message.
Regards,
-Denis