summaryrefslogtreecommitdiff
path: root/tools/btiotest.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-12-13 12:28:18 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-12-13 12:51:23 +0200
commit427f6eea4d46c59e5801107f5662923ccd9f6909 (patch)
tree401eda2401ce4681ac6842e9d49876def89c5b1a /tools/btiotest.c
parent2de1d5a179220d2647923ead34b5de8bb8a702aa (diff)
downloadbluez-427f6eea4d46c59e5801107f5662923ccd9f6909.tar.gz
btiotest: Add missing source type to bt_io_connect calls
Diffstat (limited to 'tools/btiotest.c')
-rw-r--r--tools/btiotest.c10
1 files changed, 10 insertions, 0 deletions
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 <glib.h>
+#include <bluetooth/bluetooth.h>
+
#include <btio/btio.h>
#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,