]> granicus.if.org Git - esp-idf/commitdiff
Component/bt: update con params is rejected in smp when reconnection
authorzhiweijian <zhiweijian@espressif.com>
Thu, 26 Apr 2018 09:03:11 +0000 (17:03 +0800)
committerzhiweijian <zhiweijian@espressif.com>
Wed, 9 May 2018 12:28:13 +0000 (20:28 +0800)
components/bt/bluedroid/bta/gatt/bta_gattc_co.c
components/bt/bluedroid/stack/btm/btm_sec.c
components/bt/lib

index e6b49cb381eaa975a3cd802bf14ee0842d9b8241..6c6fc460d3f74350a6d02843334bd1d2220383bb 100644 (file)
@@ -331,7 +331,9 @@ void bta_gattc_co_cache_addr_init(void)
         cache_env.addr_fp = fp;
         // Read previously saved blob if available
         if ((err_code = nvs_get_blob(fp, cache_key, p_buf, &length)) != ESP_OK) {
-            APPL_TRACE_ERROR("%s, Line = %d, nvs flash get blob data fail, err_code = %x", __func__, __LINE__, err_code);
+            if(err_code != ESP_ERR_NVS_NOT_FOUND) {
+                APPL_TRACE_ERROR("%s, Line = %d, nvs flash get blob data fail, err_code = 0x%x", __func__, __LINE__, err_code);
+            }
             osi_free(p_buf);
             return;
         }
index 00923e9f8083ccf2c8d1d4ec27b8be3f2d77e881..c238051e76e0d96d955cf99ed002abf18c378a3d 100644 (file)
@@ -4018,6 +4018,7 @@ void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable)
 #if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
     tACL_CONN       *p_acl = NULL;
     UINT8           acl_idx = btm_handle_to_acl_index(handle);
+    tGATT_TCB       *p_tcb = NULL;
 #endif
     BTM_TRACE_EVENT ("Security Manager: encrypt_change status:%d State:%d, encr_enable = %d\n",
                      status, (p_dev_rec) ? p_dev_rec->sec_state : 0, encr_enable);
@@ -4045,6 +4046,11 @@ void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable)
                 p_dev_rec->sec_flags |= BTM_SEC_16_DIGIT_PIN_AUTHED;
             }
         } else {
+#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
+            if ((p_tcb = gatt_find_tcb_by_addr(p_dev_rec->ble.pseudo_addr, BT_TRANSPORT_LE)) == NULL) {
+               //do nothing
+            } else
+#endif
             p_dev_rec->sec_flags |= (BTM_SEC_LE_AUTHENTICATED | BTM_SEC_LE_ENCRYPTED);
         }
     }
index 34b64038d090fa172d9757e2fce293ff26e0a08c..a3e98f83144ee46c6ec9b53b1c838bcefdf26e97 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 34b64038d090fa172d9757e2fce293ff26e0a08c
+Subproject commit a3e98f83144ee46c6ec9b53b1c838bcefdf26e97