diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-03-14 22:09:37 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-03-14 22:09:37 +0000 |
commit | 0eff1c8f3f32cc248bae49ed2368c54117aa31e3 (patch) | |
tree | bdd7c78e0e86e191ff7da662273aad2e349025df /hcid | |
parent | ecebc8ccbdb75f8924648c640accdb8182c65182 (diff) | |
download | bluez-0eff1c8f3f32cc248bae49ed2368c54117aa31e3.tar.gz |
Add handling for mode/name setting and retrieval
Diffstat (limited to 'hcid')
-rwxr-xr-x | hcid/test-adapter | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/hcid/test-adapter b/hcid/test-adapter index c7540d325..4e5c1e568 100755 --- a/hcid/test-adapter +++ b/hcid/test-adapter @@ -13,14 +13,30 @@ adapter = dbus.Interface(bus.get_object('org.bluez', manager.DefaultAdapter()), if (len(sys.argv) < 2): print "Usage: %s <command>" % (sys.argv[0]) print "" + print " name [name]" + print " mode [mode]" print " requestmode <mode>" sys.exit(1) -if (len(sys.argv) < 3): - print "Need parameter" - sys.exit(1) +if (sys.argv[1] == "name"): + if (len(sys.argv) < 3): + properties = adapter.GetProperties() + print properties['Name'] + else: + adapter.SetProperty("Name", sys.argv[2]) + sys.exit(0) + +if (sys.argv[1] == "mode"): + if (len(sys.argv) < 3): + properties = adapter.GetProperties() + print properties['Mode'] + else: + adapter.SetProperty("Mode", sys.argv[2]) + sys.exit(0) if (sys.argv[1] == "requestmode"): - mode = sys.argv[2] - adapter.RequestMode(mode) + if (len(sys.argv) < 3): + print "Need mode parameter" + else: + adapter.RequestMode(sys.argv[2]) sys.exit(0) |