mirror of git://git.sysmocom.de/ofono
Add test script for showing primary data contexts
This commit is contained in:
parent
8864778c02
commit
0516900c72
|
@ -229,7 +229,7 @@ test_files = test/test-manager test/test-modem test/test-voicecall \
|
|||
test/test-ss-control-cs \
|
||||
test/monitor-ofono test/list-modems test/enable-modem \
|
||||
test/list-operators test/dial-number test/hangup-all \
|
||||
test/receive-sms test/send-sms
|
||||
test/receive-sms test/send-sms test/list-contexts
|
||||
|
||||
conf_files = src/ofono.conf plugins/modem.conf
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import dbus
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||
'org.ofono.Manager')
|
||||
|
||||
properties = manager.GetProperties()
|
||||
|
||||
for path in properties["Modems"]:
|
||||
modem = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.Modem')
|
||||
|
||||
properties = modem.GetProperties()
|
||||
|
||||
print "[ %s ]" % (path)
|
||||
|
||||
if "org.ofono.DataConnectionManager" not in properties["Interfaces"]:
|
||||
continue
|
||||
|
||||
netreg = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.DataConnectionManager')
|
||||
|
||||
properties = netreg.GetProperties()
|
||||
|
||||
for path in properties["PrimaryContexts"]:
|
||||
context = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.PrimaryDataContext')
|
||||
|
||||
properties = context.GetProperties()
|
||||
|
||||
print " [ %s ]" % (path)
|
||||
|
||||
for key in properties.keys():
|
||||
val = str(properties[key])
|
||||
print " %s = %s" % (key, val)
|
||||
|
||||
print
|
Loading…
Reference in New Issue