[PATCH BlueZ v2 2/7] android/tester: Load audio module

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This is necessary to be able to do A2DP tests.
---
 android/tester-main.c | 11 ++++++++++-
 android/tester-main.h |  2 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/android/tester-main.c b/android/tester-main.c
index a9ccfcd..7d17470 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -1169,6 +1169,15 @@ static bool setup_base(struct test_data *data)
 
 	close(signal_fd[0]);
 
+	err = hw_get_module_by_class(AUDIO_HARDWARE_MODULE_ID,
+					AUDIO_HARDWARE_MODULE_ID_A2DP, &module);
+	if (err)
+		return false;
+
+	err = audio_hw_device_open(module, &data->audio);
+	if (err)
+		return false;
+
 	err = hw_get_module(BT_HARDWARE_MODULE_ID, &module);
 	if (err)
 		return false;
@@ -1187,7 +1196,6 @@ static bool setup_base(struct test_data *data)
 	if (!(data->steps = queue_new()))
 		return false;
 
-
 	return true;
 }
 
@@ -1418,6 +1426,7 @@ static void teardown(const void *test_data)
 	}
 
 	data->device->close(data->device);
+	audio_hw_device_close(data->audio);
 
 	if (!data->bluetoothd_pid)
 		tester_teardown_complete();
diff --git a/android/tester-main.h b/android/tester-main.h
index bdf54b2..ddca69c 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
@@ -43,6 +43,7 @@
 #include "src/shared/queue.h"
 
 #include <hardware/hardware.h>
+#include <hardware/audio.h>
 #include <hardware/bluetooth.h>
 #include <hardware/bt_sock.h>
 #include <hardware/bt_hh.h>
@@ -279,6 +280,7 @@ typedef enum {
 
 struct test_data {
 	struct mgmt *mgmt;
+	audio_hw_device_t *audio;
 	struct hw_device_t *device;
 	struct hciemu *hciemu;
 	enum hciemu_type hciemu_type;
-- 
1.9.3

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