mirror of git://git.sysmocom.de/ofono
Add two extra test programs for modem interface
This commit is contained in:
parent
9deaa6e70f
commit
57dce83f0f
|
@ -142,7 +142,8 @@ test_files = test/test-manager test/test-modem test/test-voicecall \
|
||||||
test/test-advice-of-charge test/test-call-settings \
|
test/test-advice-of-charge test/test-call-settings \
|
||||||
test/test-call-forwarding test/test-call-barring \
|
test/test-call-forwarding test/test-call-barring \
|
||||||
test/test-ss-control-cb test/test-ss-control-cf \
|
test/test-ss-control-cb test/test-ss-control-cf \
|
||||||
test/test-ss-control-cs
|
test/test-ss-control-cs \
|
||||||
|
test/list-modems test/enable-modem
|
||||||
|
|
||||||
EXTRA_DIST = src/genbuiltin src/ofono.conf $(doc_files) $(test_files)
|
EXTRA_DIST = src/genbuiltin src/ofono.conf $(doc_files) $(test_files)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import dbus
|
||||||
|
|
||||||
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||||
|
'org.ofono.Manager')
|
||||||
|
|
||||||
|
properties = manager.GetProperties()
|
||||||
|
|
||||||
|
path = properties["Modems"][0]
|
||||||
|
|
||||||
|
modem = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
|
'org.ofono.Modem')
|
||||||
|
|
||||||
|
modem.SetProperty("Powered", dbus.Boolean(1))
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/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():
|
||||||
|
if key in ["AvailableOperators"]:
|
||||||
|
val = ""
|
||||||
|
for i in properties[key]:
|
||||||
|
val += i + " "
|
||||||
|
else:
|
||||||
|
val = str(properties[key])
|
||||||
|
print " %s = %s" % (key, val)
|
||||||
|
|
||||||
|
print
|
Loading…
Reference in New Issue