From 3ed9073f44107ef63b8852532020a84f450a158b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Jul 2014 22:13:48 +0200 Subject: [PATCH] core: Allow auto-connection only for LE devices and use action 2 --- src/adapter.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index e98b604b1..60509ec07 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3450,10 +3450,15 @@ void adapter_auto_connect_add(struct btd_adapter *adapter, bdaddr = device_get_address(device); bdaddr_type = btd_device_get_bdaddr_type(device); + if (bdaddr_type == BDADDR_BREDR) { + DBG("auto-connection feature is not avaiable for BR/EDR"); + return; + } + memset(&cp, 0, sizeof(cp)); bacpy(&cp.addr.bdaddr, bdaddr); cp.addr.type = bdaddr_type; - cp.action = 0x01; + cp.action = 0x02; id = mgmt_send(adapter->mgmt, MGMT_OP_ADD_DEVICE, adapter->dev_id, sizeof(cp), &cp, add_device_complete, @@ -3505,6 +3510,11 @@ void adapter_auto_connect_remove(struct btd_adapter *adapter, bdaddr = device_get_address(device); bdaddr_type = btd_device_get_bdaddr_type(device); + if (bdaddr_type == BDADDR_BREDR) { + DBG("auto-connection feature is not avaiable for BR/EDR"); + return; + } + memset(&cp, 0, sizeof(cp)); bacpy(&cp.addr.bdaddr, bdaddr); cp.addr.type = bdaddr_type; -- 2.47.3