mirror of git://git.sysmocom.de/ofono
41 lines
911 B
Plaintext
41 lines
911 B
Plaintext
|
#!/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.NetworkRegistration" not in properties["Interfaces"]:
|
||
|
continue
|
||
|
|
||
|
netreg = dbus.Interface(bus.get_object('org.ofono', path),
|
||
|
'org.ofono.NetworkRegistration')
|
||
|
|
||
|
properties = netreg.GetProperties()
|
||
|
|
||
|
for path in properties["AvailableOperators"]:
|
||
|
operator = dbus.Interface(bus.get_object('org.ofono', path),
|
||
|
'org.ofono.NetworkOperator')
|
||
|
|
||
|
properties = operator.GetProperties()
|
||
|
|
||
|
print " [ %s ]" % (path)
|
||
|
|
||
|
for key in properties.keys():
|
||
|
val = str(properties[key])
|
||
|
print " %s = %s" % (key, val)
|
||
|
|
||
|
print
|