[PATCH 1/2] test: Fix getting devices in health test scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 test/test-health      | 12 +++++++++++-
 test/test-health-sink | 12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/test/test-health b/test/test-health
index 343f29c..24afa79 100755
--- a/test/test-health
+++ b/test/test-health
@@ -170,7 +170,17 @@ while select == None:
 
 adapter = dbus.Interface(bus.get_object(BUS_NAME, select), ADAPTER_INTERFACE)
 
-devices = adapter.GetProperties()["Devices"]
+devices = []
+for path, interfaces in objects.iteritems():
+	if "org.bluez.Device1" not in interfaces:
+		continue
+	properties = interfaces["org.bluez.Device1"]
+	if properties["Adapter"] != select:
+		continue;
+
+	if HEALTH_DEVICE_INTERFACE not in interfaces:
+		continue
+	devices.append(path)
 
 if len(devices) == 0:
 	print("No devices available")
diff --git a/test/test-health-sink b/test/test-health-sink
index 52be535..2343a23 100755
--- a/test/test-health-sink
+++ b/test/test-health-sink
@@ -61,7 +61,17 @@ while select == None:
 adapter =  dbus.Interface(bus.get_object(BUS_NAME, select),
 						ADAPTER_INTERFACE)
 
-devices = adapter.GetProperties()["Devices"]
+devices = []
+for path, interfaces in objects.iteritems():
+	if "org.bluez.Device1" not in interfaces:
+		continue
+	properties = interfaces["org.bluez.Device1"]
+	if properties["Adapter"] != select:
+		continue;
+
+	if HEALTH_DEVICE_INTERFACE not in interfaces:
+		continue
+	devices.append(path)
 
 if len(devices) == 0:
 	print("No devices available")
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux