* [PATCH] Fix test/test-attrib script
@ 2011-02-24 21:47 Anderson Lizardo
2011-02-24 21:59 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Anderson Lizardo @ 2011-02-24 21:47 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Anderson Lizardo
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.
---
test/test-attrib | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/test-attrib b/test/test-attrib
index 05ee381..dc3f804 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):
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-24 21:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24 21:47 [PATCH] Fix test/test-attrib script Anderson Lizardo
2011-02-24 21:59 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox