fix(ble/bluedroid): Align config, controller indent and init error paths

- bt_target: remove/align obsolete macros with Kconfig
- device/controller: fix start_up() Secure Connections indent,
  get_ble_resolving_list_max_size return type
- controller.h: align type/interface declarations with implementation
- bte_init: remove unused/redundant code
- bte_main: return -1 on osi_init failure, null check in bte_main_hci_send

(cherry picked from commit b83647f5ea)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
Zhi Wei Jian
2026-03-25 13:58:40 +08:00
committed by zhiweijian
parent e3410cbcae
commit 4b4c493a45
5 changed files with 11 additions and 13 deletions
@@ -631,10 +631,6 @@
#define BTA_DM_QOS_INCLUDED FALSE
#endif
#ifndef BTA_PAN_INCLUDED
#define BTA_PAN_INCLUDED FALSE
#endif
#ifndef BTA_HD_INCLUDED
#define BTA_HD_INCLUDED FALSE
#endif
@@ -546,7 +546,7 @@ static uint8_t get_ble_resolving_list_max_size(void)
return controller_param.ble_resolving_list_max_size;
}
static void set_ble_resolving_list_max_size(int resolving_list_max_size)
static void set_ble_resolving_list_max_size(uint8_t resolving_list_max_size)
{
assert(controller_param.readable);
assert(controller_param.ble_supported);
@@ -78,7 +78,7 @@ typedef struct controller_t {
uint8_t (*get_ble_white_list_size)(void);
uint8_t (*get_ble_resolving_list_max_size)(void);
void (*set_ble_resolving_list_max_size)(int resolving_list_max_size);
void (*set_ble_resolving_list_max_size)(uint8_t resolving_list_max_size);
#if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_50_EXTEND_ADV_EN == TRUE)
@@ -442,9 +442,6 @@ bt_status_t BTE_InitStack(void)
}
memset((void *)bta_jv_cb_ptr, 0, sizeof(tBTA_JV_CB));
#endif //JV
#if BTA_HS_INCLUDED == TRUE
memset((void *)bta_hs_cb_ptr, 0, sizeof(tBTA_HS_CB));
#endif
#if BTA_SDP_INCLUDED == TRUE
if ((bta_sdp_cb_ptr = (tBTA_SDP_CB *)osi_malloc(sizeof(tBTA_SDP_CB))) == NULL) {
goto error_exit;
@@ -486,9 +483,6 @@ bt_status_t BTE_InitStack(void)
}
memset((void *)bta_hd_cb_ptr, 0, sizeof(tBTA_HD_CB));
#endif
#if BTA_HL_INCLUDED==TRUE
memset((void *)bta_hl_cb_ptr, 0, sizeof(tBTA_HL_CB));
#endif
#if GATTC_INCLUDED==TRUE
if ((bta_gattc_cb_ptr = (tBTA_GATTC_CB *)osi_malloc(sizeof(tBTA_GATTC_CB))) == NULL) {
goto error_exit;
+9 -1
View File
@@ -86,7 +86,10 @@ int bte_main_boot_entry(bluedroid_init_done_cb_t cb)
bluedroid_init_done_cb = cb;
osi_init();
if (osi_init() != 0) {
APPL_TRACE_ERROR("%s failed to initialize OS layer.\n", __func__);
return -1;
}
//Enable HCI
bte_main_enable();
@@ -235,6 +238,11 @@ void bte_main_lpm_wake_bt_device(void)
******************************************************************************/
void bte_main_hci_send (BT_HDR *p_msg, UINT16 event)
{
if (!p_msg) {
APPL_TRACE_ERROR("%s null message\n", __func__);
return;
}
UINT16 sub_event = event & BT_SUB_EVT_MASK; /* local controller ID */
p_msg->event = event;