* [PATCH 7/7] test: Add CDMA Signal Strength Support
@ 2011-02-08 21:05 Dara Spieker-Doyle
0 siblings, 0 replies; only message in thread
From: Dara Spieker-Doyle @ 2011-02-08 21:05 UTC (permalink / raw
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-08 21:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-08 21:05 [PATCH 7/7] test: Add CDMA Signal Strength Support Dara Spieker-Doyle
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.