---
 Makefile.am                                   |    3 ++-
 test/cdma-get-current-network-signal-strength |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletions(-)
 create mode 100755 test/cdma-get-current-network-signal-strength

diff --git a/Makefile.am b/Makefile.am
index 272e28d..d7048f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -481,7 +481,8 @@ test_scripts = test/backtrace \
                test/cdma-hangup \
                test/disable-call-forwarding \
                test/list-messages \
-               test/test-sms
+               test/test-sms \
+               test/cdma-get-current-network-signal-strength
 
 if TEST
 testdir = $(pkglibdir)/test
diff --git a/test/cdma-get-current-network-signal-strength 
b/test/cdma-get-current-network-signal-strength
new file mode 100755
index 0000000..3c2a457
--- /dev/null
+++ b/test/cdma-get-current-network-signal-strength
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+
+import dbus, sys
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+                                               'org.ofono.Manager')
+modems = manager.GetModems()
+path = modems[0][0]
+
+netreg = dbus.Interface(bus.get_object('org.ofono', path),
+                               'org.ofono.cdma.NetworkRegistration')
+
+properties = netreg.GetProperties()
+
+if properties.has_key('Strength'):
+       print "Returned signal strength for current CDMA network is: '%d'" %\
+                                       (properties['Strength'])
+else:
+       print "No strength reported with GetProperties"
-- 
1.7.0.4

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to