All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] test: Fix getting devices in health test scripts
@ 2014-07-03 14:32 Szymon Janc
  2014-07-03 14:32 ` [PATCH 2/2] test: Allow to pass custom DataType to test-health-sink Szymon Janc
  2014-07-03 14:51 ` [PATCH 1/2] test: Fix getting devices in health test scripts Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Szymon Janc @ 2014-07-03 14:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] test: Allow to pass custom DataType to test-health-sink
  2014-07-03 14:32 [PATCH 1/2] test: Fix getting devices in health test scripts Szymon Janc
@ 2014-07-03 14:32 ` Szymon Janc
  2014-07-03 14:51 ` [PATCH 1/2] test: Fix getting devices in health test scripts Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2014-07-03 14:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

---
 test/test-health-sink | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/test-health-sink b/test/test-health-sink
index 2343a23..37e630a 100755
--- a/test/test-health-sink
+++ b/test/test-health-sink
@@ -23,9 +23,13 @@ loop = GObject.MainLoop()
 
 bus = dbus.SystemBus()
 
+type = 4103
+if len(sys.argv) > 1:
+	type = int(sys.argv[1])
+
 hdp_manager = dbus.Interface(bus.get_object(BUS_NAME, PATH),
 						HEALTH_MANAGER_INTERFACE)
-app_path = hdp_manager.CreateApplication({"DataType": dbus.types.UInt16(4103),
+app_path = hdp_manager.CreateApplication({"DataType": dbus.types.UInt16(type),
 					"Role": "sink"})
 
 print(app_path)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] test: Fix getting devices in health test scripts
  2014-07-03 14:32 [PATCH 1/2] test: Fix getting devices in health test scripts Szymon Janc
  2014-07-03 14:32 ` [PATCH 2/2] test: Allow to pass custom DataType to test-health-sink Szymon Janc
@ 2014-07-03 14:51 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2014-07-03 14:51 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Thu, Jul 03, 2014, Szymon Janc wrote:
> ---
>  test/test-health      | 12 +++++++++++-
>  test/test-health-sink | 12 +++++++++++-
>  2 files changed, 22 insertions(+), 2 deletions(-)

Both patches have been applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-03 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-03 14:32 [PATCH 1/2] test: Fix getting devices in health test scripts Szymon Janc
2014-07-03 14:32 ` [PATCH 2/2] test: Allow to pass custom DataType to test-health-sink Szymon Janc
2014-07-03 14:51 ` [PATCH 1/2] test: Fix getting devices in health test scripts Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.