]> granicus.if.org Git - esp-idf/commitdiff
component/bt: fix the bug when close the SMP module in the menuconfig will lead to...
authorYulong <huangyulong@espressif.com>
Thu, 14 Sep 2017 13:01:12 +0000 (09:01 -0400)
committeryulong <huangyulong@espressif.com>
Fri, 15 Sep 2017 02:32:28 +0000 (10:32 +0800)
components/bt/bluedroid/api/esp_gap_ble_api.c
components/bt/bluedroid/api/include/esp_gap_ble_api.h
components/bt/bluedroid/btc/core/btc_dm.c
components/bt/bluedroid/stack/btm/btm_ble.c
components/bt/bluedroid/stack/l2cap/l2c_ble.c

index 6b4ba68018231ff92afb9f14aa01117a48fecd6b..5367ea0f9e2a94e7d72608966a79eb01644e0e40 100644 (file)
@@ -262,7 +262,7 @@ esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_d
 
 }
 
-
+#if (SMP_INCLUDED == TRUE)
 esp_err_t esp_ble_gap_set_security_param(esp_ble_sm_param_t param_type,
         void *value, uint8_t len)
 {
@@ -392,6 +392,7 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis
 
     return (ret == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
 }
+#endif /* #if (SMP_INCLUDED == TRUE) */
 
 esp_err_t esp_ble_gap_disconnect(esp_bd_addr_t remote_device)
 {
index 942a5499fcc6f70b1dc972013ab17ac3d71ecffa..3d835d04b4404fa250f43c455a395d6d4ae67e53 100644 (file)
@@ -780,7 +780,7 @@ esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_l
  */
 esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_data_len);
 
-
+#if (SMP_INCLUDED == TRUE)
 /**
 * @brief             Set a GAP security parameter value. Overrides the default value.
 *
@@ -888,6 +888,8 @@ int esp_ble_get_bond_device_num(void);
 */
 esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_list);
 
+#endif /* #if (SMP_INCLUDED == TRUE) */
+
 /**
 * @brief           This function is to disconnect the physical connection of the peer device
 *
index e43b5ede9e33d8191a08503de989afd498508ace..a0bc44ec39cb442093f00ac6a2cd4e73b1badb13 100644 (file)
@@ -461,6 +461,7 @@ void btc_dm_sec_cb_handler(btc_msg_t *msg)
     case BTA_DM_SP_KEY_NOTIF_EVT:
         break;
     case BTA_DM_DEV_UNPAIRED_EVT: {
+#if (SMP_INCLUDED == TRUE)
         bt_bdaddr_t bd_addr;
         rsp_app = true;
         LOG_ERROR("BTA_DM_DEV_UNPAIRED_EVT");
@@ -473,6 +474,7 @@ void btc_dm_sec_cb_handler(btc_msg_t *msg)
         ble_msg.act = ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT;
         param.remove_bond_dev_cmpl.status = (p_data->link_down.status == HCI_SUCCESS) ? ESP_BT_STATUS_SUCCESS : ESP_BT_STATUS_FAIL;
         memcpy(param.remove_bond_dev_cmpl.bd_addr, p_data->link_down.bd_addr, sizeof(BD_ADDR));
+#endif /* #if (SMP_INCLUDED == TRUE) */
         break;
     }
     case BTA_DM_BUSY_LEVEL_EVT:
index c4fdbffa67ebdb727338967542cd22dd6151fb27..d1bb913d548eb42c5f12998f7988d25402ce9c0f 100644 (file)
@@ -830,6 +830,7 @@ tBTM_STATUS BTM_SetBleDataLength(BD_ADDR bd_addr, UINT16 tx_pdu_length)
     }
 }
 
+#if (SMP_INCLUDED == TRUE)
 /*******************************************************************************
 **
 ** Function         btm_ble_determine_security_act
@@ -919,7 +920,6 @@ tBTM_SEC_ACTION btm_ble_determine_security_act(BOOLEAN is_originator, BD_ADDR bd
     return BTM_SEC_OK;
 }
 
-
 /*******************************************************************************
 **
 ** Function         btm_ble_start_sec_check
@@ -1006,7 +1006,6 @@ BOOLEAN btm_ble_start_sec_check(BD_ADDR bd_addr, UINT16 psm, BOOLEAN is_originat
 ** Returns          void
 **
 *******************************************************************************/
-#if (SMP_INCLUDED == TRUE)
 void btm_ble_rand_enc_complete (UINT8 *p, UINT16 op_code, tBTM_RAND_ENC_CB *p_enc_cplt_cback)
 {
     tBTM_RAND_ENC   params;
index 9f180fe0411efcd65f6e0a9559f363e7dbbe879c..96498b1d343546220944da26f2469fde03a241ce 100644 (file)
@@ -1305,6 +1305,7 @@ void l2cble_send_peer_disc_req(tL2C_CCB *p_ccb)
     return;
 }
 
+#if (SMP_INCLUDED == TRUE)
 /*******************************************************************************
 **
 ** Function         l2cble_sec_comp
@@ -1437,5 +1438,5 @@ BOOLEAN l2ble_sec_access_req(BD_ADDR bd_addr, UINT16 psm, BOOLEAN is_originator,
 
     return status;
 }
-
+#endif /* #if (SMP_INCLUDED == TRUE) */
 #endif /* (BLE_INCLUDED == TRUE) */