aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2016-05-26 15:13:04 -0700
committerAndre Eisenbach <eisenbach@google.com>2016-05-26 22:28:17 +0000
commitbfc90ee868b042aa245eed8305047b35bddfdc5c (patch)
tree1c8e9e13b749daeca1251a1941c2a7f9c1ab1b06
parent77c3905fe7907bd10b0d24dbe469ba74f546e00e (diff)
downloadbt-bfc90ee868b042aa245eed8305047b35bddfdc5c.tar.gz
Add minimum LE connection timeout that can be used for HID devices
Fixes: 28979841 Change-Id: I520608a13224601fb9101d00c08b34cdb0f8d374
-rw-r--r--bta/hh/bta_hh_le.c3
-rw-r--r--stack/include/btm_ble_api.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/bta/hh/bta_hh_le.c b/bta/hh/bta_hh_le.c
index d115d8710..4aefd5db9 100644
--- a/bta/hh/bta_hh_le.c
+++ b/bta/hh/bta_hh_le.c
@@ -1758,6 +1758,9 @@ void bta_hh_w4_le_read_char_cmpl(tBTA_HH_DEV_CB *p_dev_cb, tBTA_HH_DATA *p_buf)
if (max < BTM_BLE_CONN_INT_MIN_LIMIT)
max = BTM_BLE_CONN_INT_MIN_LIMIT;
+ if (tout < BTM_BLE_CONN_TIMEOUT_MIN_DEF)
+ tout = BTM_BLE_CONN_TIMEOUT_MIN_DEF;
+
BTM_BleSetPrefConnParams (p_dev_cb->addr, min, max, latency, tout);
L2CA_UpdateBleConnParams(p_dev_cb->addr, min, max, latency, tout);
}
diff --git a/stack/include/btm_ble_api.h b/stack/include/btm_ble_api.h
index e63cb0701..ab5ea38b1 100644
--- a/stack/include/btm_ble_api.h
+++ b/stack/include/btm_ble_api.h
@@ -182,6 +182,11 @@ typedef UINT8 tBTM_BLE_SFP;
#define BTM_BLE_CONN_TIMEOUT_DEF 2000
#endif
+/* minimum supervision timeout */
+#ifndef BTM_BLE_CONN_TIMEOUT_MIN_DEF
+#define BTM_BLE_CONN_TIMEOUT_MIN_DEF 100
+#endif
+
/* minimum acceptable connection interval */
#ifndef BTM_BLE_CONN_INT_MIN_LIMIT
#define BTM_BLE_CONN_INT_MIN_LIMIT 0x0009