Diff between c4db4db6bfd5173e9c7e780089e3cecc93827f52 and 7ddeb00c1a1c6ab53535155558d07f6fd4acf66f

Changed Files

File Additions Deletions Status
tools/btiotest.c +11 -0 modified

Full Patch

diff --git a/tools/btiotest.c b/tools/btiotest.c
index 9950fa9..a77eba1 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -46,6 +46,7 @@ struct io_data {
 	int reject;
 	int disconn;
 	int accept;
+	int voice;
 };
 
 static void io_data_unref(struct io_data *data)
@@ -238,6 +239,14 @@ static void confirm_cb(GIOChannel *io, gpointer user_data)
 		return;
 	}
 
+	if (data->voice) {
+		if (!bt_io_set(io, &err, BT_IO_OPT_VOICE, data->voice,
+							BT_IO_OPT_INVALID)) {
+			printf("bt_io_set(OPT_VOICE): %s\n", err->message);
+			g_clear_error(&err);
+		}
+	}
+
 	data->io = g_io_channel_ref(io);
 	io_data_ref(data);
 
@@ -499,6 +508,8 @@ static void sco_listen(const char *src, gboolean defer, int reject,
 
 	data = io_data_new(NULL, reject, disconn, accept);
 
+	data->voice = voice;
+
 	if (src)
 		sco_srv = bt_io_listen(conn, cfm, data,
 					(GDestroyNotify) io_data_unref,