From 6ca9fc9115f323d7358b146096994c7f2ba344b5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Oct 2008 14:36:57 +0200 Subject: [PATCH] Add scripts for enabling/disabling devices --- test/Makefile.am | 2 +- test/disable-device | 23 +++++++++++++++++++++++ test/enable-device | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 test/disable-device create mode 100755 test/enable-device diff --git a/test/Makefile.am b/test/Makefile.am index bcc9e5d..fe11939 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = list-profiles list-elements monitor-elements monitor-state \ get-state select-network disable-network monitor-networks \ - start-scanning simple-agent \ + enable-device disable-device start-scanning simple-agent \ show-introspection test-compat test-supplicant MAINTAINERCLEANFILES = Makefile.in diff --git a/test/disable-device b/test/disable-device new file mode 100755 index 0000000..ac55e77 --- /dev/null +++ b/test/disable-device @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), + 'org.moblin.connman.Manager') + +elements = manager.ListElements() + +for path in elements: + element = dbus.Interface(bus.get_object('org.moblin.connman', path), + 'org.moblin.connman.Element') + + properties = element.GetProperties() + + if (properties["Type"] != "device"): + continue + + print "[ %s ]" % (path) + + element.Disable() diff --git a/test/enable-device b/test/enable-device new file mode 100755 index 0000000..55bd1f1 --- /dev/null +++ b/test/enable-device @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), + 'org.moblin.connman.Manager') + +elements = manager.ListElements() + +for path in elements: + element = dbus.Interface(bus.get_object('org.moblin.connman', path), + 'org.moblin.connman.Element') + + properties = element.GetProperties() + + if (properties["Type"] != "device"): + continue + + print "[ %s ]" % (path) + + element.Enable() -- 2.7.4