diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-03-22 15:27:02 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-03-22 15:27:02 +0000 |
commit | 957ead88e8a90526631f1a767ba1006bc03b8084 (patch) | |
tree | f5440f95807874e7e7754d7c6ccfd3897d0f2e84 /input/test-input | |
parent | 5ef438457561a85d5d713fb57b6bc5058621d478 (diff) |
Update test script for input service
Diffstat (limited to 'input/test-input')
-rwxr-xr-x | input/test-input | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/input/test-input b/input/test-input index a5fe9605..7f41b6f6 100755 --- a/input/test-input +++ b/input/test-input @@ -13,10 +13,33 @@ conn = manager.ActivateService('input') input = dbus.Interface(bus.get_object(conn, '/org/bluez/input'), 'org.bluez.input.Manager') -if (len(sys.argv) < 1): - print "Usage: %s <address>" % (sys.argv[0]) +if (len(sys.argv) < 2): + print "Usage: %s <command>" % (sys.argv[0]) + print "" + print " list" + print " create <address>" + print " remove <path>" sys.exit(1) -address = sys.argv[1] - -device = input.CreateSecureDevice(address) +if (sys.argv[1] == "list"): + list = input.ListDevices() + print list + sys.exit(0) + +if (sys.argv[1] == "create"): + if (len(sys.argv) < 3): + print "Need address parameter" + else: + device = input.CreateSecureDevice(sys.argv[2]) + print device + sys.exit(0) + +if (sys.argv[1] == "remove"): + if (len(sys.argv) < 3): + print "Need object path parameter" + else: + input.RemoveDevice(sys.argv[2]) + sys.exit(0) + +print "Unknown command" +sys.exit(1) |