mirror of git://git.sysmocom.de/ofono
test: Add get-icon script
This commit is contained in:
parent
bd8c7e92bb
commit
5524b17324
|
@ -407,7 +407,8 @@ test_scripts = test/backtrace \
|
||||||
test/lock-pin \
|
test/lock-pin \
|
||||||
test/unlock-pin \
|
test/unlock-pin \
|
||||||
test/enable-gprs \
|
test/enable-gprs \
|
||||||
test/disable-gprs
|
test/disable-gprs \
|
||||||
|
test/get-icon
|
||||||
|
|
||||||
if TEST
|
if TEST
|
||||||
testdir = $(pkglibdir)/test
|
testdir = $(pkglibdir)/test
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import dbus
|
||||||
|
import sys
|
||||||
|
|
||||||
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
|
if len(sys.argv) == 2:
|
||||||
|
id = sys.argv[1]
|
||||||
|
else:
|
||||||
|
print "%s <icon id>" % (sys.argv[0])
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
manager = dbus.Interface(bus.get_object("org.ofono", "/"),
|
||||||
|
"org.ofono.Manager")
|
||||||
|
|
||||||
|
modems = manager.GetModems()
|
||||||
|
|
||||||
|
for path, properties in modems:
|
||||||
|
if "org.ofono.SimManager" not in properties["Interfaces"]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
sim = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
|
'org.ofono.SimManager')
|
||||||
|
|
||||||
|
icon = sim.GetIcon(dbus.Byte(int(sys.argv[1])))
|
||||||
|
print icon
|
Loading…
Reference in New Issue