diff options
author | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2011-02-24 18:47:00 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-02-24 18:59:04 -0300 |
commit | 22d7418014c46a081d0501dfa2b6fcc3bd42010b (patch) | |
tree | 5d0efed17138a55530831d187cc203008d4ed018 /test | |
parent | 5aa3f0880df880720cd5a68e53f8e2f34c89e986 (diff) |
Fix test/test-attrib script
Characteristics are not being fetched anymore when the device is
created. Discover method needs to be called actively to discover the
characteristics exposed by a given service.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-attrib | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test-attrib b/test/test-attrib index 05ee3812..dc3f804f 100755 --- a/test/test-attrib +++ b/test/test-attrib @@ -62,13 +62,17 @@ class Watcher(dbus.service.Object): print "Watcher: new value for %s: %s" % (char, dbus_type_to_str(newvalue)) def handle_characteristics(char): - for (path, props) in char.GetCharacteristics().iteritems(): - if options.char_path and path != options.char_path: + char.Discover() + for c in char.GetProperties()["Characteristics"]: + char = dbus.Interface(bus.get_object("org.bluez", c), + "org.bluez.Characteristic") + + if options.char_path and c != options.char_path: continue if not options.set_property: - ret = "Characteristic: %s\nProperties:\n" % path - for (k, v) in props.iteritems(): + ret = "Characteristic: %s\nProperties:\n" % c + for (k, v) in char.GetProperties().iteritems(): ret += "\t%s: %s\n" % (k, dbus_type_to_str(v)) print ret elif options.set_property.get(path, None): |