All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test/test-message-waiting: Add a new test file to validate org.ofono.MessageWaiting
@ 2011-03-08 16:27 Bertrand Aygon
  2011-03-08 19:38 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Bertrand Aygon @ 2011-03-08 16:27 UTC (permalink / raw)
  To: ofono

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

---
 test/test-message-waiting |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100755 test/test-message-waiting

diff --git a/test/test-message-waiting b/test/test-message-waiting
new file mode 100755
index 0000000..79fe810
--- /dev/null
+++ b/test/test-message-waiting
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+import gobject
+import sys
+import dbus
+import dbus.mainloop.glib
+
+def mw_property_changed(name, value):
+  	if name == 'VoicemailMessageCount':
+		print "MessageWaiting property: '%s' changed to '%d'" % (name, value)
+	else:
+		print "MessageWaiting property: '%s' changed to '%s'" % (name, value)
+
+if __name__ == "__main__":
+	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+	bus = dbus.SystemBus()
+
+	manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+			'org.ofono.Manager')
+
+	modems = manager.GetModems()
+
+	mw = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
+			'org.ofono.MessageWaiting')
+
+	mw.connect_to_signal("PropertyChanged", mw_property_changed)
+
+	properties = mw.GetProperties()
+
+	print "Voicemail waiting: %s" % (properties['VoicemailWaiting'])
+	print "Voicemail message count: %d" % (properties['VoicemailMessageCount'])
+	print "Voicemail mailbox number: %s" % (properties['VoicemailMailboxNumber'])
+
+	mainloop = gobject.MainLoop()
+	mainloop.run()
-- 
1.7.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.

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

end of thread, other threads:[~2011-03-08 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 16:27 [PATCH] test/test-message-waiting: Add a new test file to validate org.ofono.MessageWaiting Bertrand Aygon
2011-03-08 19:38 ` 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.