summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rwxr-xr-xtest/display-icon34
2 files changed, 36 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index f045107b..163ba4bd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -654,7 +654,8 @@ test_scripts = test/backtrace \
test/release-and-swap \
test/hold-and-answer \
test/hangup-multiparty \
- test/hangup-call
+ test/hangup-call \
+ test/display-icon
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/display-icon b/test/display-icon
new file mode 100755
index 00000000..0be30d5d
--- /dev/null
+++ b/test/display-icon
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 2):
+ print "Usage: %s [modem] icon_id" % (sys.argv[0])
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+modem = modems[0][0]
+
+if (len(sys.argv) == 2):
+ icon = sys.argv[1]
+elif (len(sys.argv) == 3):
+ modem = sys.argv[1]
+ icon = sys.argv[2]
+
+print "Using modem %s" % modem
+
+sim = dbus.Interface(bus.get_object('org.ofono', modem),
+ 'org.ofono.SimManager')
+icon = sim.GetIcon(dbus.Byte(int(icon)))
+xpm = ""
+for byte in icon:
+ xpm += str(byte)
+f = open("/tmp/icon.xpm", 'w')
+f.write(xpm)
+f.close()