diff options
-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) |