2009-09-02 10:35:09 +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)
|
|
|
|
|
|
|
|
for key in properties.keys():
|
|
|
|
if key in ["Interfaces"]:
|
|
|
|
val = ""
|
|
|
|
for i in properties[key]:
|
|
|
|
val += i + " "
|
|
|
|
else:
|
|
|
|
val = str(properties[key])
|
|
|
|
print " %s = %s" % (key, val)
|
|
|
|
|
|
|
|
for interface in properties["Interfaces"]:
|
|
|
|
object = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
interface)
|
|
|
|
|
|
|
|
properties = object.GetProperties()
|
|
|
|
|
|
|
|
print " [ %s ]" % (interface)
|
|
|
|
|
|
|
|
for key in properties.keys():
|
2009-09-03 17:07:20 +00:00
|
|
|
if key in ["AvailableOperators", "SubscriberNumbers"]:
|
2009-09-02 10:35:09 +00:00
|
|
|
val = ""
|
|
|
|
for i in properties[key]:
|
|
|
|
val += i + " "
|
|
|
|
else:
|
|
|
|
val = str(properties[key])
|
|
|
|
print " %s = %s" % (key, val)
|
|
|
|
|
|
|
|
print
|