diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/disable-device | 11 | ||||
-rwxr-xr-x | test/enable-device | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/test/disable-device b/test/disable-device index 31e9f951..7aadab01 100755 --- a/test/disable-device +++ b/test/disable-device @@ -1,7 +1,12 @@ #!/usr/bin/python +import sys import dbus +if (len(sys.argv) < 2): + print "Usage: %s <device>" % (sys.argv[0]) + sys.exit(1) + bus = dbus.SystemBus() manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), @@ -15,9 +20,9 @@ for path in properties["Devices"]: properties = device.GetProperties() - if (properties["Powered"] == dbus.Boolean(0)): - continue + if properties["Interface"] != sys.argv[1]: + continue; - print "[ %s ]" % (path) + print "Disabling device %s" % (path) device.SetProperty("Powered", dbus.Boolean(0)); diff --git a/test/enable-device b/test/enable-device index e79b7361..b5b1a9cc 100755 --- a/test/enable-device +++ b/test/enable-device @@ -1,7 +1,12 @@ #!/usr/bin/python +import sys import dbus +if (len(sys.argv) < 2): + print "Usage: %s <device>" % (sys.argv[0]) + sys.exit(1) + bus = dbus.SystemBus() manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), @@ -15,9 +20,9 @@ for path in properties["Devices"]: properties = device.GetProperties() - if (properties["Powered"] == dbus.Boolean(1)): - continue + if properties["Interface"] != sys.argv[1]: + continue; - print "[ %s ]" % (path) + print "Enabling device %s" % (path) device.SetProperty("Powered", dbus.Boolean(1)); |