diff options
author | Satya Calloji <satyac@broadcom.com> | 2015-03-06 10:38:22 -0800 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-04-13 00:09:06 -0700 |
commit | 444a8da807abaf5f9e813ce70c56a79160495fb3 (patch) | |
tree | 20a35a257203d1a87f34d887ffba13672af4288a /stack/l2cap/l2c_api.c | |
parent | 8372aa5fa535ee4f09c09981b6125b54ace31fe2 (diff) | |
download | android_system_bt-444a8da807abaf5f9e813ce70c56a79160495fb3.tar.gz android_system_bt-444a8da807abaf5f9e813ce70c56a79160495fb3.tar.bz2 android_system_bt-444a8da807abaf5f9e813ce70c56a79160495fb3.zip |
LE Privacy 1.2 and LE secure connections
Bug: 19816438
Original author: Chaojing Sun <cjsun@broadcom.com>
Change-Id: I5951f4d4e038f8348a62aa6d19b2111bae0b3ecc
Diffstat (limited to 'stack/l2cap/l2c_api.c')
-rw-r--r-- | stack/l2cap/l2c_api.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/stack/l2cap/l2c_api.c b/stack/l2cap/l2c_api.c index 839ad1b5e..3a8d5de48 100644 --- a/stack/l2cap/l2c_api.c +++ b/stack/l2cap/l2c_api.c @@ -833,17 +833,22 @@ BOOLEAN L2CA_SetIdleTimeout (UINT16 cid, UINT16 timeout, BOOLEAN is_global) ** NOTE This timeout applies to all logical channels active on the ** ACL link. *******************************************************************************/ -BOOLEAN L2CA_SetIdleTimeoutByBdAddr(BD_ADDR bd_addr, UINT16 timeout) +BOOLEAN L2CA_SetIdleTimeoutByBdAddr(BD_ADDR bd_addr, UINT16 timeout, tBT_TRANSPORT transport) { tL2C_LCB *p_lcb; if (memcmp (BT_BD_ANY, bd_addr, BD_ADDR_LEN)) { - p_lcb = l2cu_find_lcb_by_bd_addr( bd_addr, BT_TRANSPORT_BR_EDR); + p_lcb = l2cu_find_lcb_by_bd_addr( bd_addr, transport); if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) + { p_lcb->idle_timeout = timeout; + + if (!p_lcb->ccb_queue.p_first_ccb) + l2cu_no_dynamic_ccbs (p_lcb); + } else - return (FALSE); + return FALSE; } else { @@ -855,11 +860,14 @@ BOOLEAN L2CA_SetIdleTimeoutByBdAddr(BD_ADDR bd_addr, UINT16 timeout) if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) { p_lcb->idle_timeout = timeout; + + if (!p_lcb->ccb_queue.p_first_ccb) + l2cu_no_dynamic_ccbs (p_lcb); } } } - return (TRUE); + return TRUE; } /******************************************************************************* @@ -1639,18 +1647,6 @@ BOOLEAN L2CA_RemoveFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda) p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] = NULL; p_lcb->disc_reason = HCI_ERR_CONN_CAUSE_LOCAL_HOST; -#if BLE_INCLUDED == TRUE - /* retain the link for a few more seconds after SMP pairing is done, since Android - platformalways do service discovery after pairing complete. This way would avoid - the link down (pairing is complete) and an immediate reconnection for service - discovery. Some devices do not do auto advertising when link is dropped, thus fail - the second connection and service discovery. - BEFORE :if ((fixed_cid == L2CAP_ATT_CID || fixed_cid == L2CAP_SMP_CID) - && !p_lcb->ccb_queue.p_first_ccb)*/ - if ((fixed_cid == L2CAP_ATT_CID ) && !p_lcb->ccb_queue.p_first_ccb) - p_lcb->idle_timeout = 0; -#endif - l2cu_release_ccb (p_ccb); return (TRUE); @@ -1700,7 +1696,7 @@ BOOLEAN L2CA_SetFixedChannelTout (BD_ADDR rem_bda, UINT16 fixed_cid, UINT16 idle l2cu_no_dynamic_ccbs (p_lcb); } - return (TRUE); + return TRUE; } #endif /* #if (L2CAP_NUM_FIXED_CHNLS > 0) */ |