[PATCH] Add ability to select modem on test-voicecall

João Paulo Rechi Vita jprvita at profusion.mobi
Thu Jan 28 13:56:22 PST 2010


---
 test/test-voicecall |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/test/test-voicecall b/test/test-voicecall
index 13f371a..2da7703 100755
--- a/test/test-voicecall
+++ b/test/test-voicecall
@@ -39,11 +39,9 @@ if __name__ == "__main__":
 	global vcmanager
 
 	if (len(sys.argv) < 2):
-		print "Useage: %s <number>" % (sys.argv[0])
+		print "Useage: %s [modem] <number>" % (sys.argv[0])
 		sys.exit(1)
 
-	number = sys.argv[1]
-
 	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
 	bus = dbus.SystemBus()
@@ -52,9 +50,17 @@ if __name__ == "__main__":
 							'org.ofono.Manager')
 
 	modems = manager.GetProperties()['Modems']
+	modem = modems[0]
 	print modems
 
-	vcmanager = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+	if (len(sys.argv) == 3):
+		modem = sys.argv[1]
+		number = sys.argv[2]
+	else:
+		number = sys.argv[1]
+	print "Using modem %s" % modem
+
+	vcmanager = dbus.Interface(bus.get_object('org.ofono', modem),
 						'org.ofono.VoiceCallManager')
 
 	vcmanager.connect_to_signal("PropertyChanged",
-- 
1.6.3.3



More information about the ofono mailing list