Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_some_bluedroid_bugs_2402' into 'master'
Browse files Browse the repository at this point in the history
fix(bt/blufi): Fixed BluFi module link error(C++ hybrid compilation)

See merge request espressif/esp-idf!29220
  • Loading branch information
Isl2017 committed Mar 6, 2024
2 parents eeb5e2f + 0950360 commit be29217
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
16 changes: 13 additions & 3 deletions components/bt/common/btc/profile/esp/blufi/include/blufi_int.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -9,6 +9,11 @@

#include "btc/btc_task.h"
#include "esp_blufi_api.h"

#ifdef __cplusplus
extern "C" {
#endif

#if (BLUFI_INCLUDED == TRUE)

#define BTC_BLUFI_GREAT_VER 0x01 //Version + Subversion
Expand Down Expand Up @@ -193,5 +198,10 @@ void btc_blufi_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);

void btc_blufi_cb_deep_free(btc_msg_t *msg);

#endif /* __BLUFI_INT_H__ */
#endif ///BLUFI_INCLUDED == TRUE
#endif ///BLUFI_INCLUDED == TRUE

#ifdef __cplusplus
}
#endif

#endif /* __BLUFI_INT_H__ */
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -20,6 +20,10 @@
#include "esp_gap_ble_api.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define BLUFI_APP_UUID 0xFFFF
#define BLUFI_DEVICE_NAME "BLUFI_DEVICE"

Expand Down Expand Up @@ -96,4 +100,7 @@ void esp_blufi_send_encap(void *arg);
int esp_blufi_handle_gap_events(struct ble_gap_event *event, void *arg);
#endif

#ifdef __cplusplus
}
#endif
#endif/* _ESP_BLUFI_ */
10 changes: 9 additions & 1 deletion components/bt/common/btc/profile/esp/include/btc_blufi_prf.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -21,6 +21,11 @@
#define ESP_BLUFI_SUCCESS 0x00
#endif


#ifdef __cplusplus
extern "C" {
#endif

#define BT_BD_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x"
#define BT_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]

Expand Down Expand Up @@ -100,4 +105,7 @@ void btc_blufi_call_deep_free(btc_msg_t *msg);

uint16_t btc_blufi_get_version(void);

#ifdef __cplusplus
}
#endif
#endif /* __BTC_BLUFI_PRF_H__ */
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ typedef struct {
esp_ble_gap_ext_adv_data_status_t data_status; /*!< data type */
uint8_t adv_data_len; /*!< extend advertising data length */
uint8_t adv_data[251]; /*!< extend advertising data */
} esp_ble_gap_ext_adv_reprot_t;
} esp_ble_gap_ext_adv_report_t;

/**
* @brief periodic adv report parameters
Expand Down Expand Up @@ -1410,7 +1410,7 @@ typedef union {
* @brief ESP_GAP_BLE_EXT_ADV_REPORT_EVT
*/
struct ble_ext_adv_report_param {
esp_ble_gap_ext_adv_reprot_t params; /*!< extend advertising report parameters */
esp_ble_gap_ext_adv_report_t params; /*!< extend advertising report parameters */
} ext_adv_report; /*!< Event parameter of ESP_GAP_BLE_EXT_ADV_REPORT_EVT */
/**
* @brief ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ static void btc_ble_5_gap_callback(tBTA_DM_BLE_5_GAP_EVENT event,
break;
case BTA_DM_BLE_5_GAP_EXT_ADV_REPORT_EVT:
msg.act = ESP_GAP_BLE_EXT_ADV_REPORT_EVT;
memcpy(&param.ext_adv_report.params, &params->ext_adv_report, sizeof(esp_ble_gap_ext_adv_reprot_t));
memcpy(&param.ext_adv_report.params, &params->ext_adv_report, sizeof(esp_ble_gap_ext_adv_report_t));
if (params->ext_adv_report.adv_data) {
memcpy(param.ext_adv_report.params.adv_data,
params->ext_adv_report.adv_data, params->ext_adv_report.adv_data_len);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
break;
}
ESP_LOGI(GATTC_TAG, "discover service complete conn_id %d", param->dis_srvc_cmpl.conn_id);
esp_ble_gattc_search_service(gattc_if, param->cfg_mtu.conn_id, &remote_filter_service_uuid);
esp_ble_gattc_search_service(gattc_if, param->dis_srvc_cmpl.conn_id, &remote_filter_service_uuid);
break;
case ESP_GATTC_CFG_MTU_EVT:
if (param->cfg_mtu.status != ESP_GATT_OK){
Expand Down

0 comments on commit be29217

Please sign in to comment.