mirror of git://git.sysmocom.de/ofono
65 lines
1.4 KiB
Python
Executable File
65 lines
1.4 KiB
Python
Executable File
#!/usr/bin/python
|
|
|
|
import dbus
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
|
'org.ofono.Manager')
|
|
|
|
modems = manager.GetModems()
|
|
|
|
for path, properties in modems:
|
|
print "[ %s ]" % (path)
|
|
|
|
for key in properties.keys():
|
|
if key in ["Interfaces", "Features"]:
|
|
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)
|
|
|
|
try:
|
|
properties = object.GetProperties()
|
|
except:
|
|
continue
|
|
|
|
for key in properties.keys():
|
|
if key in ["Calls",
|
|
"MultipartyCalls",
|
|
"EmergencyNumbers",
|
|
"SubscriberNumbers",
|
|
"PreferredLanguages",
|
|
"PrimaryContexts",
|
|
"LockedPins"]:
|
|
val = ""
|
|
for i in properties[key]:
|
|
val += i + " "
|
|
elif key in ["ServiceNumbers"]:
|
|
val = ""
|
|
for i in properties[key]:
|
|
val += "[" + i + "] = '"
|
|
val += properties[key][i] + "' "
|
|
elif key in ["MobileNetworkCodeLength",
|
|
"VoicemailMessageCount",
|
|
"MicrophoneVolume",
|
|
"SpeakerVolume",
|
|
"Strength"]:
|
|
val = int(properties[key])
|
|
elif key in ["MainMenu"]:
|
|
val = ", ".join([ text + " (" + str(int(icon)) +
|
|
")" for text, icon in properties[key] ])
|
|
else:
|
|
val = str(properties[key])
|
|
print " %s = %s" % (key, val)
|
|
|
|
print
|