aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-02-01 10:45:28 -0600
committerDan Williams <dcbw@redhat.com>2012-02-01 10:45:28 -0600
commit70978d58a0db9691fa7583cf1d8df839ac18431b (patch)
tree190f0d3773c1b2c60ba9cf8851af3ff8eb529c68 /test
parent20a1c412fdf9dcc85fe97aa8053286032677938f (diff)
test: pretty-print SMS messages in sms-get.py
Diffstat (limited to 'test')
-rwxr-xr-xtest/sms-get.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/sms-get.py b/test/sms-get.py
index c302459e..7bfb3125 100755
--- a/test/sms-get.py
+++ b/test/sms-get.py
@@ -52,4 +52,23 @@ if modem.Get(MM_DBUS_INTERFACE_MODEM, "Enabled") == False:
sms = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_SMS)
msgs = sms.List()
-print msgs
+i = 0
+for m in msgs:
+ print "-------------------------------------------------------------------"
+ print "%d: From: %s Time: %s SMSC: %s" % (m["index"], m["number"], m["timestamp"], m["smsc"])
+ if len(m["text"]):
+ print " %s\n" % m["text"]
+ elif len(m["data"]):
+ print " Coding: %d" % m["data-coding-scheme"]
+ z = 1
+ s = ""
+ for c in m["data"]:
+ s += "%02X " % c
+ if not z % 16:
+ print " %s" % s
+ s = ""
+ z += 1
+ if len(s):
+ print " %s" % s
+ i += 1
+