[PATCH] service: Added a script for toggling AutoConnect flag.

Jukka Rissanen jukka.rissanen at nokia.com
Tue Jan 25 03:28:10 PST 2011


---
A simple script for setting and getting the service auto connect
flag.

 test/set-autoconnect |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100755 test/set-autoconnect

diff --git a/test/set-autoconnect b/test/set-autoconnect
new file mode 100755
index 0000000..decc7de
--- /dev/null
+++ b/test/set-autoconnect
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 2):
+	print "Usage: %s <service> [0 | 1]" % (sys.argv[0])
+	sys.exit(1)
+
+bus = dbus.SystemBus()
+path = "/profile/default/" + sys.argv[1]
+service = dbus.Interface(bus.get_object('net.connman', path),
+					'net.connman.Service')
+
+properties = service.GetProperties()
+
+if (len(sys.argv) < 3):
+	print "Current AutoConnect value is %s" % properties["AutoConnect"]
+else:
+	print "Setting autoconnect to %s" % (sys.argv[2])
+	service.SetProperty("AutoConnect", dbus.Boolean(int(sys.argv[2])))
-- 
1.7.0.4




More information about the connman mailing list