From: Johan Hedberg Date: Thu, 8 Aug 2013 09:48:37 +0000 (+0300) Subject: tools/btiotest: Fix applying voice setting for incoming connections X-Git-Tag: android-x86-4.4-r3~7785 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7ddeb00c1a1c6ab53535155558d07f6fd4acf66f;p=android-x86%2Fexternal-bluetooth-bluez.git tools/btiotest: Fix applying voice setting for incoming connections --- diff --git a/tools/btiotest.c b/tools/btiotest.c index 9950fa940..a77eba1a1 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,