From 427f6eea4d46c59e5801107f5662923ccd9f6909 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 13 Dec 2013 12:28:18 +0200 Subject: [PATCH] btiotest: Add missing source type to bt_io_connect calls --- tools/btiotest.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/btiotest.c b/tools/btiotest.c index a77eba1a1..b06367bf3 100644 --- a/tools/btiotest.c +++ b/tools/btiotest.c @@ -35,6 +35,8 @@ #include +#include + #include #define DEFAULT_ACCEPT_TIMEOUT 2 @@ -274,16 +276,23 @@ static void l2cap_connect(const char *src, const char *dst, uint8_t addr_type, { struct io_data *data; GError *err = NULL; + uint8_t src_type; printf("Connecting to %s L2CAP PSM %u\n", dst, psm); data = io_data_new(NULL, -1, disconn, -1); + if (addr_type != BDADDR_BREDR) + src_type = BDADDR_LE_PUBLIC; + else + src_type = BDADDR_BREDR; + if (src) data->io = bt_io_connect(connect_cb, data, (GDestroyNotify) io_data_unref, &err, BT_IO_OPT_SOURCE, src, + BT_IO_OPT_SOURCE_TYPE, src_type, BT_IO_OPT_DEST, dst, BT_IO_OPT_DEST_TYPE, addr_type, BT_IO_OPT_PSM, psm, @@ -295,6 +304,7 @@ static void l2cap_connect(const char *src, const char *dst, uint8_t addr_type, data->io = bt_io_connect(connect_cb, data, (GDestroyNotify) io_data_unref, &err, + BT_IO_OPT_SOURCE_TYPE, src_type, BT_IO_OPT_DEST, dst, BT_IO_OPT_DEST_TYPE, addr_type, BT_IO_OPT_PSM, psm, -- 2.47.3