2009-09-02 10:58:27 +00:00
|
|
|
#!/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()
|
|
|
|
|
2010-03-25 15:37:46 +00:00
|
|
|
for path in properties["Operators"]:
|
2009-09-02 10:58:27 +00:00
|
|
|
operator = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
'org.ofono.NetworkOperator')
|
|
|
|
|
|
|
|
properties = operator.GetProperties()
|
|
|
|
|
|
|
|
print " [ %s ]" % (path)
|
|
|
|
|
|
|
|
for key in properties.keys():
|
2009-11-18 10:52:39 +00:00
|
|
|
if key in ["Technologies"]:
|
|
|
|
val = ""
|
|
|
|
for i in properties[key]:
|
|
|
|
val += i + " "
|
|
|
|
else:
|
|
|
|
val = str(properties[key])
|
2009-09-02 10:58:27 +00:00
|
|
|
print " %s = %s" % (key, val)
|
|
|
|
|
|
|
|
print
|