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)
|
|
|
|
|
|
|
|
print " [ %s ]" % (interface)
|
|
|
|
|
2009-09-06 05:35:11 +00:00
|
|
|
try:
|
|
|
|
properties = object.GetProperties()
|
|
|
|
except:
|
|
|
|
continue
|
|
|
|
|
2009-09-02 10:35:09 +00:00
|
|
|
for key in properties.keys():
|
2009-09-06 05:35:11 +00:00
|
|
|
if key in ["AvailableOperators", "Calls",
|
|
|
|
"MultipartyCalls",
|
|
|
|
"EmergencyNumbers",
|
|
|
|
"SubscriberNumbers",
|
2009-09-25 21:05:32 +00:00
|
|
|
"ServiceDiallingNumbers",
|
|
|
|
"PreferredLanguages",
|
2009-10-24 15:42:23 +00:00
|
|
|
"PrimaryContexts",
|
2009-09-25 21:05:32 +00:00
|
|
|
"LockedPins"]:
|
2009-09-02 10:35:09 +00:00
|
|
|
val = ""
|
|
|
|
for i in properties[key]:
|
|
|
|
val += i + " "
|
2009-09-06 05:35:11 +00:00
|
|
|
elif key in ["MobileNetworkCodeLength",
|
2009-10-24 15:42:23 +00:00
|
|
|
"VoicemailMessageCount",
|
|
|
|
"MicrophoneVolume",
|
|
|
|
"SpeakerVolume"]:
|
2009-09-06 05:35:11 +00:00
|
|
|
val = int(properties[key])
|
2009-09-02 10:35:09 +00:00
|
|
|
else:
|
|
|
|
val = str(properties[key])
|
|
|
|
print " %s = %s" % (key, val)
|
|
|
|
|
|
|
|
print
|