]> granicus.if.org Git - esp-idf/commitdiff
Component/bt: fix update connection params error in smp
authorzhiweijian <zhiweijian@espressif.com>
Fri, 12 Jan 2018 09:19:36 +0000 (17:19 +0800)
committerzhiweijian <zhiweijian@espressif.com>
Mon, 15 Jan 2018 07:38:08 +0000 (15:38 +0800)
components/bt/bluedroid/stack/l2cap/l2c_ble.c
components/bt/bluedroid/stack/smp/smp_utils.c

index 0332366d8fd89200e51d01237a770cdc8f462dd0..a416826ae46790dbcd174a72a59ea2d967c2334f 100644 (file)
@@ -1025,10 +1025,16 @@ void l2cble_process_rc_param_request_evt(UINT16 handle, UINT16 int_min, UINT16 i
         if ((p_lcb->conn_update_mask & L2C_BLE_CONN_UPDATE_DISABLE) == 0) {
             p_lcb->conn_update_mask |= L2C_BLE_UPDATE_PENDING;
             btsnd_hcic_ble_rc_param_req_reply(handle, int_min, int_max, latency, timeout, 0, 0);
-        } else {
-            L2CAP_TRACE_EVENT ("L2CAP - LE - update currently disabled");
-            p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM;
-            btsnd_hcic_ble_rc_param_req_neg_reply (handle, HCI_ERR_UNACCEPT_CONN_INTERVAL);
+        }else {
+            /* always accept connection parameters request which is sent by itself */
+            if (int_max == BTM_BLE_CONN_INT_MIN) {
+                p_lcb->conn_update_mask |= L2C_BLE_UPDATE_PENDING;
+                btsnd_hcic_ble_rc_param_req_reply(handle, int_min, int_max, latency, timeout, 0, 0);
+            }else {
+                L2CAP_TRACE_EVENT ("L2CAP - LE - update currently disabled");
+                p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM;
+                btsnd_hcic_ble_rc_param_req_neg_reply (handle, HCI_ERR_UNACCEPT_CONN_INTERVAL);
+            }
         }
 
     } else {
index 05cabc92a9fc09006ca57572abcb93d934ca43df..aa596df1d5ef987bad14dca69e38553f7e702806 100644 (file)
@@ -974,6 +974,9 @@ void smp_proc_pairing_cmpl(tSMP_CB *p_cb)
 
     memcpy (pairing_bda, p_cb->pairing_bda, BD_ADDR_LEN);
 
+    if (p_cb->role == HCI_ROLE_SLAVE) {
+        L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, TRUE);
+    }
     smp_reset_control_value(p_cb);
 
     if (p_callback) {