diff options
author | Nitin Arora <niarora@codeaurora.org> | 2015-05-28 12:08:42 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:21:58 -0600 |
commit | 5d5d2121ec0095cd22d28a2f7d749ae6e701ca1a (patch) | |
tree | 59939303def4bc18824f8a1bb27c0c0374df1e65 /stack/l2cap | |
parent | 98c43652ddac38e0ef500a2518ca21464d769418 (diff) | |
download | android_system_bt-5d5d2121ec0095cd22d28a2f7d749ae6e701ca1a.tar.gz android_system_bt-5d5d2121ec0095cd22d28a2f7d749ae6e701ca1a.tar.bz2 android_system_bt-5d5d2121ec0095cd22d28a2f7d749ae6e701ca1a.zip |
Bluetooth: Cancel connection to remote if already connected
This patch will ensure that a direct connection is cancelled by
the host if a connection from the same remote takes place
as an advertiser.
Change-Id: I0419de6f4d05837b7772ac4336713bb7a7c6eefe
Diffstat (limited to 'stack/l2cap')
-rw-r--r-- | stack/l2cap/l2c_ble.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stack/l2cap/l2c_ble.c b/stack/l2cap/l2c_ble.c index db9eae6b4..34fa4defd 100644 --- a/stack/l2cap/l2c_ble.c +++ b/stack/l2cap/l2c_ble.c @@ -807,7 +807,9 @@ void l2cble_advertiser_conn_comp (UINT16 handle, BD_ADDR bda, tBLE_ADDR_TYPE typ } /* when adv and initiating are both active, cancel the direct connection */ - if (l2cb.is_ble_connecting && memcmp(bda, l2cb.ble_connecting_bda, BD_ADDR_LEN) == 0) + if (l2cb.is_ble_connecting && + ((memcmp(bda, l2cb.ble_connecting_bda, BD_ADDR_LEN) == 0) || + memcmp(p_dev_rec->ble.static_addr, l2cb.ble_connecting_bda, BD_ADDR_LEN) == 0)) { L2CA_CancelBleConnectReq(bda); } |