diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-11-25 15:42:00 -0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-11-26 13:21:50 -0600 |
commit | cc96fdfff00a9e0ee74a0209c38a43ef7a6a6de2 (patch) | |
tree | dc06779880696a503a8f0902f283a6a25ebce42c /test/set-tty | |
parent | 77e9d6f6acc78d43a97ef0bda0257a53c23b7766 (diff) | |
download | ofono-cc96fdfff00a9e0ee74a0209c38a43ef7a6a6de2.tar.gz |
test: add test/set-tty script
To enable/disable text-telephony support
Diffstat (limited to 'test/set-tty')
-rwxr-xr-x | test/set-tty | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/set-tty b/test/set-tty new file mode 100755 index 00000000..67876af0 --- /dev/null +++ b/test/set-tty @@ -0,0 +1,25 @@ +#!/usr/bin/python + +import dbus +import sys + +bus = dbus.SystemBus() + +if len(sys.argv) == 3: + path = sys.argv[1] + enable = int(sys.argv[2]) +elif len(sys.argv) == 2: + manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + modems = manager.GetModems() + path = modems[0][0] + enable = int(sys.argv[1]) +else: + print "%s [PATH] {0|1}" % (sys.argv[0]) + exit(1) + +print "Setting TTY for modem %s..." % path +texttelephony = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.TextTelephony') + +texttelephony.SetProperty("Enabled", dbus.Boolean(enable)); |