system/bt
Revision | d3974ad35223794c79434d9c74074a8791a286c4 (tree) |
---|---|
Time | 2016-10-03 18:36:45 |
Author | Linux Build Service Account <lnxbuild@loca...> |
Commiter | Gerrit - the friendly Code Review server |
Merge "Update Interop datatbase to prevent preferred conn updates" into bt.lnx.2.1-dev
@@ -31,6 +31,7 @@ | ||
31 | 31 | #include "btm_api.h" |
32 | 32 | #include "btm_ble_api.h" |
33 | 33 | #include "btm_int.h" |
34 | +#include "device/include/interop.h" | |
34 | 35 | #include "osi/include/log.h" |
35 | 36 | #include "srvc_api.h" |
36 | 37 | #include "stack/include/l2c_api.h" |
@@ -1736,6 +1737,7 @@ void bta_hh_w4_le_read_char_cmpl(tBTA_HH_DEV_CB *p_dev_cb, tBTA_HH_DATA *p_buf) | ||
1736 | 1737 | { |
1737 | 1738 | tBTA_GATTC_READ * p_data = (tBTA_GATTC_READ *)p_buf; |
1738 | 1739 | UINT8 *pp ; |
1740 | + BD_NAME bdname; | |
1739 | 1741 | |
1740 | 1742 | const tBTA_GATTC_CHARACTERISTIC *p_char = BTA_GATTC_GetCharacteristic(p_dev_cb->conn_id, |
1741 | 1743 | p_data->handle); |
@@ -1766,7 +1768,12 @@ void bta_hh_w4_le_read_char_cmpl(tBTA_HH_DEV_CB *p_dev_cb, tBTA_HH_DATA *p_buf) | ||
1766 | 1768 | tout = BTM_BLE_CONN_TIMEOUT_MIN_DEF; |
1767 | 1769 | |
1768 | 1770 | BTM_BleSetPrefConnParams (p_dev_cb->addr, min, max, latency, tout); |
1769 | - L2CA_UpdateBleConnParams(p_dev_cb->addr, min, max, latency, tout); | |
1771 | + | |
1772 | + if (!BTM_GetRemoteDeviceName(p_dev_cb->addr, bdname) || !*bdname || | |
1773 | + (!interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, (const char*) bdname))) | |
1774 | + { | |
1775 | + L2CA_UpdateBleConnParams(p_dev_cb->addr, min, max, latency, tout); | |
1776 | + } | |
1770 | 1777 | } |
1771 | 1778 | else |
1772 | 1779 | { |
@@ -96,6 +96,11 @@ typedef enum { | ||
96 | 96 | //Few carkits take long time to start sending AT commands |
97 | 97 | //Increase AG_CONN TIMEOUT so that AG connection go through |
98 | 98 | INTEROP_INCREASE_AG_CONN_TIMEOUT, |
99 | + | |
100 | + // Some HOGP devices do not respond well when we switch from default LE conn parameters | |
101 | + // to preferred conn params immediately post connection. Disable automatic switching to | |
102 | + // preferred conn params for such devices and allow them to explicity ask for it. | |
103 | + INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, | |
99 | 104 | } interop_feature_t; |
100 | 105 | |
101 | 106 | // Check if a given |addr| matches a known interoperability workaround as identified |
@@ -149,6 +149,10 @@ static const interop_name_entry_t interop_name_database[] = { | ||
149 | 149 | |
150 | 150 | // HID Authentication Blacklist |
151 | 151 | {"Targus BT Laser Notebook Mouse", 30, INTEROP_DISABLE_AUTH_FOR_HID_POINTING}, |
152 | + | |
153 | + //Below devices reject connection updated with preferred | |
154 | + {"BSMBB09DS", 9, INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS}, | |
155 | + {"ELECOM", 6, INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS}, | |
152 | 156 | }; |
153 | 157 | |
154 | 158 | typedef struct { |
@@ -159,6 +159,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) { | ||
159 | 159 | CASE_RETURN_STR(INTEROP_REMOVE_HID_DIG_DESCRIPTOR) |
160 | 160 | CASE_RETURN_STR(INTEROP_DISABLE_SNIFF_DURING_SCO) |
161 | 161 | CASE_RETURN_STR(INTEROP_INCREASE_AG_CONN_TIMEOUT) |
162 | + CASE_RETURN_STR(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS) | |
162 | 163 | } |
163 | 164 | |
164 | 165 | return "UNKNOWN"; |
@@ -33,6 +33,7 @@ | ||
33 | 33 | |
34 | 34 | #include "bt_types.h" |
35 | 35 | #include "bt_utils.h" |
36 | +#include "btif/include/btif_storage.h" | |
36 | 37 | #include "btm_ble_api.h" |
37 | 38 | #include "btm_int.h" |
38 | 39 | #include "btu.h" |
@@ -124,6 +125,37 @@ BOOLEAN BTM_SecAddBleDevice (BD_ADDR bd_addr, BD_NAME bd_name, tBT_DEVICE_TYPE d | ||
124 | 125 | |
125 | 126 | /******************************************************************************* |
126 | 127 | ** |
128 | +** Function BTM_GetRemoteDeviceName | |
129 | +** | |
130 | +** Description This function is called to get the dev name of remote device | |
131 | +** from NV | |
132 | +** | |
133 | +** Returns TRUE if success; otherwise failed. | |
134 | +** | |
135 | +*******************************************************************************/ | |
136 | +BOOLEAN BTM_GetRemoteDeviceName(BD_ADDR bda, BD_NAME bd_name) | |
137 | +{ | |
138 | + BTM_TRACE_DEBUG("%s", __func__); | |
139 | + BOOLEAN ret = FALSE; | |
140 | + bt_bdname_t bdname; | |
141 | + bt_property_t prop_name; | |
142 | + bt_bdaddr_t bd_addr; | |
143 | + bdcpy(bd_addr.address, bda); | |
144 | + | |
145 | + BTIF_STORAGE_FILL_PROPERTY(&prop_name, BT_PROPERTY_BDNAME, | |
146 | + sizeof(bt_bdname_t), &bdname); | |
147 | + if (btif_storage_get_remote_device_property( | |
148 | + &bd_addr, &prop_name) == BT_STATUS_SUCCESS) | |
149 | + { | |
150 | + APPL_TRACE_DEBUG("%s, NV name = %s", __func__, bdname.name); | |
151 | + strlcpy((char*) bd_name, (char*) bdname.name, BD_NAME_LEN); | |
152 | + ret = TRUE; | |
153 | + } | |
154 | + return ret; | |
155 | +} | |
156 | + | |
157 | +/******************************************************************************* | |
158 | +** | |
127 | 159 | ** Function BTM_SecAddBleKey |
128 | 160 | ** |
129 | 161 | ** Description Add/modify LE device information. This function will be |
@@ -2745,6 +2777,7 @@ void btm_ble_set_keep_rfu_in_auth_req(BOOLEAN keep_rfu) | ||
2745 | 2777 | btm_cb.devcb.keep_rfu_in_auth_req = keep_rfu; |
2746 | 2778 | } |
2747 | 2779 | |
2780 | + | |
2748 | 2781 | #endif /* BTM_BLE_CONFORMANCE_TESTING */ |
2749 | 2782 | |
2750 | 2783 | #endif /* BLE_INCLUDED */ |
@@ -1861,6 +1861,20 @@ extern tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback | ||
1861 | 1861 | *******************************************************************************/ |
1862 | 1862 | extern tBTM_STATUS BTM_SetBleDataLength(BD_ADDR bd_addr, UINT16 tx_pdu_length); |
1863 | 1863 | |
1864 | + | |
1865 | + | |
1866 | +/******************************************************************************* | |
1867 | +** | |
1868 | +** Function BTM_GetRemoteDeviceName | |
1869 | +** | |
1870 | +** Description This function is called to get the dev name of remote device | |
1871 | +** from NV | |
1872 | +** | |
1873 | +** Returns TRUE if success; otherwise failed. | |
1874 | +** | |
1875 | +*******************************************************************************/ | |
1876 | +extern BOOLEAN BTM_GetRemoteDeviceName(BD_ADDR bda, BD_NAME bdname); | |
1877 | + | |
1864 | 1878 | #ifdef __cplusplus |
1865 | 1879 | } |
1866 | 1880 | #endif |
@@ -31,6 +31,7 @@ | ||
31 | 31 | #include "btm_int.h" |
32 | 32 | #include "hcimsgs.h" |
33 | 33 | #include "device/include/controller.h" |
34 | +#include "device/include/interop.h" | |
34 | 35 | #include "stack_config.h" |
35 | 36 | |
36 | 37 | #if (BLE_INCLUDED == TRUE) |
@@ -283,6 +284,7 @@ void l2cble_notify_le_connection (BD_ADDR bda) | ||
283 | 284 | tL2C_LCB *p_lcb = l2cu_find_lcb_by_bd_addr (bda, BT_TRANSPORT_LE); |
284 | 285 | tACL_CONN *p_acl = btm_bda_to_acl(bda, BT_TRANSPORT_LE) ; |
285 | 286 | tL2C_CCB *p_ccb; |
287 | + BD_NAME bdname; | |
286 | 288 | |
287 | 289 | if (p_lcb != NULL && p_acl != NULL && p_lcb->link_state != LST_CONNECTED) |
288 | 290 | { |
@@ -305,7 +307,12 @@ void l2cble_notify_le_connection (BD_ADDR bda) | ||
305 | 307 | l2c_csm_execute (p_ccb, L2CEVT_LP_CONNECT_CFM, NULL); |
306 | 308 | } |
307 | 309 | |
308 | - l2cble_use_preferred_conn_params(bda); | |
310 | + | |
311 | + if (!BTM_GetRemoteDeviceName(bda, bdname) || !*bdname || | |
312 | + (!interop_match_name(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS, (const char*) bdname))) | |
313 | + { | |
314 | + l2cble_use_preferred_conn_params(bda); | |
315 | + } | |
309 | 316 | } |
310 | 317 | |
311 | 318 | /******************************************************************************* |