• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisiond3974ad35223794c79434d9c74074a8791a286c4 (tree)
Time2016-10-03 18:36:45
AuthorLinux Build Service Account <lnxbuild@loca...>
CommiterGerrit - the friendly Code Review server

Log Message

Merge "Update Interop datatbase to prevent preferred conn updates" into bt.lnx.2.1-dev

Change Summary

Incremental Difference

--- a/bta/hh/bta_hh_le.c
+++ b/bta/hh/bta_hh_le.c
@@ -31,6 +31,7 @@
3131 #include "btm_api.h"
3232 #include "btm_ble_api.h"
3333 #include "btm_int.h"
34+#include "device/include/interop.h"
3435 #include "osi/include/log.h"
3536 #include "srvc_api.h"
3637 #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)
17361737 {
17371738 tBTA_GATTC_READ * p_data = (tBTA_GATTC_READ *)p_buf;
17381739 UINT8 *pp ;
1740+ BD_NAME bdname;
17391741
17401742 const tBTA_GATTC_CHARACTERISTIC *p_char = BTA_GATTC_GetCharacteristic(p_dev_cb->conn_id,
17411743 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)
17661768 tout = BTM_BLE_CONN_TIMEOUT_MIN_DEF;
17671769
17681770 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+ }
17701777 }
17711778 else
17721779 {
--- a/device/include/interop.h
+++ b/device/include/interop.h
@@ -96,6 +96,11 @@ typedef enum {
9696 //Few carkits take long time to start sending AT commands
9797 //Increase AG_CONN TIMEOUT so that AG connection go through
9898 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,
99104 } interop_feature_t;
100105
101106 // Check if a given |addr| matches a known interoperability workaround as identified
--- a/device/include/interop_database.h
+++ b/device/include/interop_database.h
@@ -149,6 +149,10 @@ static const interop_name_entry_t interop_name_database[] = {
149149
150150 // HID Authentication Blacklist
151151 {"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},
152156 };
153157
154158 typedef struct {
--- a/device/src/interop.c
+++ b/device/src/interop.c
@@ -159,6 +159,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
159159 CASE_RETURN_STR(INTEROP_REMOVE_HID_DIG_DESCRIPTOR)
160160 CASE_RETURN_STR(INTEROP_DISABLE_SNIFF_DURING_SCO)
161161 CASE_RETURN_STR(INTEROP_INCREASE_AG_CONN_TIMEOUT)
162+ CASE_RETURN_STR(INTEROP_DISABLE_LE_CONN_PREFERRED_PARAMS)
162163 }
163164
164165 return "UNKNOWN";
--- a/stack/btm/btm_ble.c
+++ b/stack/btm/btm_ble.c
@@ -33,6 +33,7 @@
3333
3434 #include "bt_types.h"
3535 #include "bt_utils.h"
36+#include "btif/include/btif_storage.h"
3637 #include "btm_ble_api.h"
3738 #include "btm_int.h"
3839 #include "btu.h"
@@ -124,6 +125,37 @@ BOOLEAN BTM_SecAddBleDevice (BD_ADDR bd_addr, BD_NAME bd_name, tBT_DEVICE_TYPE d
124125
125126 /*******************************************************************************
126127 **
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+**
127159 ** Function BTM_SecAddBleKey
128160 **
129161 ** 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)
27452777 btm_cb.devcb.keep_rfu_in_auth_req = keep_rfu;
27462778 }
27472779
2780+
27482781 #endif /* BTM_BLE_CONFORMANCE_TESTING */
27492782
27502783 #endif /* BLE_INCLUDED */
--- a/stack/include/btm_ble_api.h
+++ b/stack/include/btm_ble_api.h
@@ -1861,6 +1861,20 @@ extern tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback
18611861 *******************************************************************************/
18621862 extern tBTM_STATUS BTM_SetBleDataLength(BD_ADDR bd_addr, UINT16 tx_pdu_length);
18631863
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+
18641878 #ifdef __cplusplus
18651879 }
18661880 #endif
--- a/stack/l2cap/l2c_ble.c
+++ b/stack/l2cap/l2c_ble.c
@@ -31,6 +31,7 @@
3131 #include "btm_int.h"
3232 #include "hcimsgs.h"
3333 #include "device/include/controller.h"
34+#include "device/include/interop.h"
3435 #include "stack_config.h"
3536
3637 #if (BLE_INCLUDED == TRUE)
@@ -283,6 +284,7 @@ void l2cble_notify_le_connection (BD_ADDR bda)
283284 tL2C_LCB *p_lcb = l2cu_find_lcb_by_bd_addr (bda, BT_TRANSPORT_LE);
284285 tACL_CONN *p_acl = btm_bda_to_acl(bda, BT_TRANSPORT_LE) ;
285286 tL2C_CCB *p_ccb;
287+ BD_NAME bdname;
286288
287289 if (p_lcb != NULL && p_acl != NULL && p_lcb->link_state != LST_CONNECTED)
288290 {
@@ -305,7 +307,12 @@ void l2cble_notify_le_connection (BD_ADDR bda)
305307 l2c_csm_execute (p_ccb, L2CEVT_LP_CONNECT_CFM, NULL);
306308 }
307309
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+ }
309316 }
310317
311318 /*******************************************************************************