All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test: Update test-voicecall to reflect DBus types
@ 2010-09-04 12:35 Jeevaka Badrappan
  2010-09-09 14:08 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Jeevaka Badrappan @ 2010-09-04 12:35 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3137 bytes --]

---
 test/test-voicecall |   55 ++++++++++++++++++++++++++------------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/test/test-voicecall b/test/test-voicecall
index e13da3f..2e3ed9e 100755
--- a/test/test-voicecall
+++ b/test/test-voicecall
@@ -10,31 +10,36 @@ def hangup_all():
 	print "Hanging up"
 	vcmanager.HangupAll()
 
-def print_calls(value):
-	for p in value:
-		call = dbus.Interface(bus.get_object('org.ofono', p),
-						'org.ofono.VoiceCall')
-		properties = call.GetProperties()
-		status = properties['State']
-		lineid = properties['LineIdentification']
-
-		print "Call %s, Status: %s, LineId: %s" %\
-			(p, status, lineid)
-
-def voicecalls_property_changed(name, value):
-	if name == 'Calls':
-		print "Call list modification>"
-		if len(value) == 0:
-			print "No calls in systems"
-		else:
-			print_calls(value)
+def print_calls():
+	calls = vcmanager.GetCalls()
+	if (len(calls) != 0):
+		print "No calls available"
 	else:
-		print "VoiceCallManager property: '%s' changed to '%s'" %\
-			(name, value)
+		for path, properties in calls:
+			print "    [ %s ]" % (path)
+
+			for key in properties.keys():
+				val = str(properties[key])
+				print "        %s = %s" % (key, val)
+			print
+
+def voicecalls_call_added(path, properties):
+	print "    Voice Call [ %s ] Added" % (path)
+
+	for key in properties.keys():
+		val = str(properties[key])
+		print "        %s = %s" % (key, val)
+	print
+
+def voicecalls_call_removed(path):
+	print "    Voice Call [ %s ] Removed" % (path)
 
 def voicecall_property_changed(name, value):
 	print "Voicecall property: '%s' changed to '%s'" % (name, value)
 
+def voicecall_disconnect_reason(reason):
+	print "Voicecall disconnect reason: '%s'" % (reason)
+
 if __name__ == "__main__":
 	global vcmanager
 
@@ -63,14 +68,11 @@ if __name__ == "__main__":
 	vcmanager = dbus.Interface(bus.get_object('org.ofono', modem),
 						'org.ofono.VoiceCallManager')
 
-	vcmanager.connect_to_signal("PropertyChanged",
-					voicecalls_property_changed)
-
-	properties = vcmanager.GetProperties()
+	vcmanager.connect_to_signal("CallAdded", voicecalls_call_added)
 
-	print properties['Calls']
+	vcmanager.connect_to_signal("CallRemoved", voicecalls_call_removed)
 
-	voicecalls_property_changed('Calls', properties['Calls'])
+	print_calls()
 
 	print "Dialing %s..." % number
 	obj = vcmanager.Dial(number, "")
@@ -85,6 +87,7 @@ if __name__ == "__main__":
 		(properties['State'], properties['LineIdentification'])
 
 	call.connect_to_signal("PropertyChanged", voicecall_property_changed)
+	call.connect_to_signal("DisconnectReason", voicecall_disconnect_reason)
 
 	gobject.timeout_add(1000000, hangup_all)
 
-- 
1.7.0.4



----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test: Update test-voicecall to reflect DBus types
  2010-09-04 12:35 [PATCH] test: Update test-voicecall to reflect DBus types Jeevaka Badrappan
@ 2010-09-09 14:08 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-09-09 14:08 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

Hi Jeevaka,

On 09/04/2010 07:35 AM, Jeevaka Badrappan wrote:
> ---
>  test/test-voicecall |   55 ++++++++++++++++++++++++++------------------------
>  1 files changed, 29 insertions(+), 26 deletions(-)

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-09 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-04 12:35 [PATCH] test: Update test-voicecall to reflect DBus types Jeevaka Badrappan
2010-09-09 14:08 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.