diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-08-08 12:48:37 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-08-08 12:48:37 +0300 |
commit | 7ddeb00c1a1c6ab53535155558d07f6fd4acf66f (patch) | |
tree | 6d40cd3cf5a041f0c015946d4fd91479200ed414 /tools/btiotest.c | |
parent | c4db4db6bfd5173e9c7e780089e3cecc93827f52 (diff) | |
download | bluez-7ddeb00c1a1c6ab53535155558d07f6fd4acf66f.tar.gz |
tools/btiotest: Fix applying voice setting for incoming connections
Diffstat (limited to 'tools/btiotest.c')
-rw-r--r-- | tools/btiotest.c | 11 |
1 files changed, 11 insertions, 0 deletions
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, |