From ab712f8d8240f5e2e0dc431bcf3148dcbe80b100 Mon Sep 17 00:00:00 2001 From: Zhi Wei Jian Date: Tue, 14 Jul 2026 12:04:38 +0800 Subject: [PATCH] fix(ble/bluedroid): use BOOLEAN for BLE HCI command builders (cherry picked from commit abbf00112084a0dccd74e7a1138fda611f94a1b7) Co-authored-by: zhiweijian --- .../bt/host/bluedroid/stack/hcic/hciblecmds.c | 34 +++++++++---------- .../bluedroid/stack/include/stack/hcimsgs.h | 34 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/components/bt/host/bluedroid/stack/hcic/hciblecmds.c b/components/bt/host/bluedroid/stack/hcic/hciblecmds.c index 1dbe71b2886..34d611a3ea5 100644 --- a/components/bt/host/bluedroid/stack/hcic/hciblecmds.c +++ b/components/bt/host/bluedroid/stack/hcic/hciblecmds.c @@ -1169,7 +1169,7 @@ BOOLEAN btsnd_hcic_ble_set_phy(UINT16 conn_handle, } #if (BLE_50_DTM_TEST_EN == TRUE) -UINT8 btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy, +BOOLEAN btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy, UINT8 modulation_idx) { BT_HDR *p; @@ -1190,7 +1190,7 @@ UINT8 btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy, return TRUE; } -UINT8 btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len, +BOOLEAN btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len, UINT8 packect, UINT8 phy) { @@ -2160,7 +2160,7 @@ BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask) #if (BLE_FEAT_ISO_EN == TRUE) #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE) -UINT8 btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, +BOOLEAN btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency, uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing, uint8_t encryption, uint8_t *broadcast_code) @@ -2196,7 +2196,7 @@ UINT8 btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t return TRUE; } -UINT8 btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, +BOOLEAN btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, uint32_t sdu_interval, uint16_t iso_interval, uint8_t nse, uint16_t max_sdu, uint16_t max_pdu, uint8_t phy, uint8_t packing, uint8_t framing, uint8_t bn, uint8_t irc, @@ -2237,7 +2237,7 @@ UINT8 btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uin return TRUE; } -UINT8 btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason) +BOOLEAN btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason) { BT_HDR *p; UINT8 *pp; @@ -2259,7 +2259,7 @@ UINT8 btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason) } #endif // #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE) #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE) -UINT8 btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle, +BOOLEAN btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle, uint8_t encryption, uint8_t *bc_code, uint8_t mse, uint16_t big_sync_timeout, uint8_t num_bis, uint8_t *bis) @@ -2471,7 +2471,7 @@ UINT8 btsnd_hcic_ble_iso_set_cig_params_test(uint8_t cig_id, uint32_t sdu_int_c_ return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p); } -UINT8 btsnd_hcic_ble_iso_create_cis(uint8_t cis_count, struct ble_hci_cis_hdls *cis_hdls) +BOOLEAN btsnd_hcic_ble_iso_create_cis(uint8_t cis_count, struct ble_hci_cis_hdls *cis_hdls) { BT_HDR *p; UINT8 *pp; @@ -2524,7 +2524,7 @@ UINT8 btsnd_hcic_ble_iso_remove_cig(uint8_t cig_id) #endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE) #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE) -UINT8 btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle) +BOOLEAN btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle) { BT_HDR *p; UINT8 *pp; @@ -2802,7 +2802,7 @@ UINT8 btsnd_hcic_ble_enh_read_trans_power_level(uint16_t conn_handle, uint8_t ph return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p); } -UINT8 btsnd_hcic_ble_read_remote_trans_power_level(uint16_t conn_handle, uint8_t phy) +BOOLEAN btsnd_hcic_ble_read_remote_trans_power_level(uint16_t conn_handle, uint8_t phy) { BT_HDR *p; UINT8 *pp; @@ -2916,7 +2916,7 @@ UINT8 btsnd_hcic_ble_set_default_subrate(UINT16 subrate_min, UINT16 subrate_max, return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p); } -UINT8 btsnd_hcic_ble_subrate_request(UINT16 conn_handle, UINT16 subrate_min, UINT16 subrate_max, UINT16 max_latency, +BOOLEAN btsnd_hcic_ble_subrate_request(UINT16 conn_handle, UINT16 subrate_min, UINT16 subrate_max, UINT16 max_latency, UINT16 continuation_number, UINT16 supervision_timeout) { BT_HDR *p; @@ -3451,7 +3451,7 @@ UINT8 btsnd_hcic_ble_set_periodic_sync_subevt(UINT16 sync_handle, UINT16 periodi #endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE) #if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE) -UINT8 btsnd_hcic_ble_cs_read_local_supported_caps(void) +BOOLEAN btsnd_hcic_ble_cs_read_local_supported_caps(void) { BT_HDR *p; UINT8 *pp; @@ -3469,7 +3469,7 @@ UINT8 btsnd_hcic_ble_cs_read_local_supported_caps(void) return (TRUE); } -UINT8 btsnd_hcic_ble_cs_read_remote_supported_capabilities(UINT16 conn_handle) +BOOLEAN btsnd_hcic_ble_cs_read_remote_supported_capabilities(UINT16 conn_handle) { BT_HDR *p; UINT8 *pp; @@ -3541,7 +3541,7 @@ UINT8 btsnd_hcic_ble_cs_write_cached_remote_supported_capabilities(UINT16 conn_h } -UINT8 btsnd_hcic_ble_cs_security_enable(UINT16 conn_handle) +BOOLEAN btsnd_hcic_ble_cs_security_enable(UINT16 conn_handle) { BT_HDR *p; UINT8 *pp; @@ -3581,7 +3581,7 @@ UINT8 btsnd_hcic_ble_cs_set_default_settings(UINT16 conn_handle, UINT8 role_enab return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p); } -UINT8 btsnd_hcic_ble_cs_read_remote_fae_table(UINT16 conn_handle) +BOOLEAN btsnd_hcic_ble_cs_read_remote_fae_table(UINT16 conn_handle) { BT_HDR *p; UINT8 *pp; @@ -3620,7 +3620,7 @@ UINT8 btsnd_hcic_ble_cs_write_cached_remote_fae_table(UINT16 conn_handle, UINT8 return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p); } -UINT8 btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 create_context, +BOOLEAN btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 create_context, UINT8 main_mode_type, UINT8 sub_mode_type, UINT8 min_main_mode_steps, UINT8 max_main_mode_steps, UINT8 main_mode_repetition, UINT8 mode_0_steps, UINT8 role, UINT8 rtt_type, UINT8 cs_sync_phy, UINT8 *channel_map, @@ -3667,7 +3667,7 @@ UINT8 btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 return (TRUE); } -UINT8 btsnd_hcic_ble_cs_remove_config(UINT16 conn_handle, UINT8 config_id) +BOOLEAN btsnd_hcic_ble_cs_remove_config(UINT16 conn_handle, UINT8 config_id) { BT_HDR *p; UINT8 *pp; @@ -3748,7 +3748,7 @@ UINT8 btsnd_hcic_ble_cs_set_procedure_params(UINT16 conn_handle, UINT8 config_id return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p); } -UINT8 btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable) +BOOLEAN btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable) { BT_HDR *p; UINT8 *pp; diff --git a/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h b/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h index 30b2f5794e8..5af2d52a01a 100644 --- a/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h +++ b/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h @@ -1056,10 +1056,10 @@ BOOLEAN btsnd_hcic_ble_set_phy(UINT16 conn_handle, UINT8 rx_phys, UINT16 phy_options); #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) #if (BLE_50_DTM_TEST_EN == TRUE) -UINT8 btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy, +BOOLEAN btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy, UINT8 modulation_idx); -UINT8 btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len, +BOOLEAN btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len, UINT8 packect, UINT8 phy); #endif // #if (BLE_50_DTM_TEST_EN == TRUE) @@ -1227,32 +1227,32 @@ UINT8 btsnd_hcic_ble_iso_set_cig_params(uint8_t cig_id, uint32_t sdu_int_c_to_p, UINT8 btsnd_hcic_ble_iso_set_cig_params_test(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c, uint16_t iso_interval, uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt, struct ble_hci_le_cis_params_test *cis_params_test); -UINT8 btsnd_hcic_ble_iso_create_cis(uint8_t cis_count, struct ble_hci_cis_hdls *cis_hdls); +BOOLEAN btsnd_hcic_ble_iso_create_cis(uint8_t cis_count, struct ble_hci_cis_hdls *cis_hdls); UINT8 btsnd_hcic_ble_iso_remove_cig(uint8_t cig_id); #endif // (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE) #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE) -UINT8 btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle); +BOOLEAN btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle); UINT8 btsnd_hcic_ble_iso_reject_cis_req(uint16_t cis_handle, uint8_t reason); #endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE) #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE) -UINT8 btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, +BOOLEAN btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency, uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing, uint8_t encryption, uint8_t *broadcast_code); -UINT8 btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, +BOOLEAN btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, uint32_t sdu_interval, uint16_t iso_interval, uint8_t nse, uint16_t max_sdu, uint16_t max_pdu, uint8_t phy, uint8_t packing, uint8_t framing, uint8_t bn, uint8_t irc, uint8_t pto, uint8_t encryption, uint8_t *broadcast_code); -UINT8 btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason); +BOOLEAN btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason); #endif // #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE) #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE) -UINT8 btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle, +BOOLEAN btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle, uint8_t encryption, uint8_t *bc_code, uint8_t mse, uint16_t big_sync_timeout, uint8_t num_bis, uint8_t *bis); @@ -1309,7 +1309,7 @@ UINT8 btsnd_hcic_ble_read_antenna_info(void); #define HCIC_PARAM_SIZE_SET_TRANS_PWR_REPORTING_ENABLE 4 UINT8 btsnd_hcic_ble_enh_read_trans_power_level(uint16_t conn_handle, uint8_t phy); -UINT8 btsnd_hcic_ble_read_remote_trans_power_level(uint16_t conn_handle, uint8_t phy); +BOOLEAN btsnd_hcic_ble_read_remote_trans_power_level(uint16_t conn_handle, uint8_t phy); UINT8 btsnd_hcic_ble_set_path_loss_rpt_params(uint16_t conn_handle, uint8_t high_threshold, uint8_t high_hysteresis, uint8_t low_threshold, uint8_t low_hysteresis, uint16_t min_time_spent); UINT8 btsnd_hcic_ble_set_path_loss_rpt_enable(uint16_t conn_handle, uint8_t enable); @@ -1322,7 +1322,7 @@ UINT8 btsnd_hcic_ble_set_trans_pwr_rpt_enable(uint16_t conn_handle, uint8_t loca UINT8 btsnd_hcic_ble_set_default_subrate(UINT16 subrate_min, UINT16 subrate_max, UINT16 max_latency, UINT16 continuation_number, UINT16 supervision_timeout); -UINT8 btsnd_hcic_ble_subrate_request(UINT16 conn_handle, UINT16 subrate_min, UINT16 subrate_max, UINT16 max_latency, +BOOLEAN btsnd_hcic_ble_subrate_request(UINT16 conn_handle, UINT16 subrate_min, UINT16 subrate_max, UINT16 max_latency, UINT16 continuation_number, UINT16 supervision_timeout); #endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE) @@ -1384,8 +1384,8 @@ UINT8 btsnd_hcic_ble_set_ext_adv_params_v2(UINT8 adv_handle, UINT16 properties, #define HCIC_PARAM_SIZE_SET_PROCEDURE_PARAMS_LEN 23 #define HCIC_PARAM_SIZE_SET_PROCEDURE_ENABLE_PARAMS_LEN 4 -UINT8 btsnd_hcic_ble_cs_read_local_supported_caps(void); -UINT8 btsnd_hcic_ble_cs_read_remote_supported_capabilities(UINT16 conn_handle); +BOOLEAN btsnd_hcic_ble_cs_read_local_supported_caps(void); +BOOLEAN btsnd_hcic_ble_cs_read_remote_supported_capabilities(UINT16 conn_handle); UINT8 btsnd_hcic_ble_cs_write_cached_remote_supported_capabilities(UINT16 conn_handle, UINT8 num_config_supported, UINT16 max_consecutive_proc_supported, UINT8 num_ant_supported, UINT8 max_ant_paths_supported, UINT8 roles_supported, UINT8 modes_supported, UINT8 rtt_capability, UINT8 rtt_aa_only_n, @@ -1394,17 +1394,17 @@ UINT8 btsnd_hcic_ble_cs_write_cached_remote_supported_capabilities(UINT16 conn_h UINT16 T_IP1_times_supported, UINT16 T_IP2_times_supported, UINT16 T_FCS_times_supported, UINT16 T_PM_times_supported, UINT8 T_SW_times_supported, UINT8 TX_SNR_capability); -UINT8 btsnd_hcic_ble_cs_security_enable(UINT16 conn_handle); +BOOLEAN btsnd_hcic_ble_cs_security_enable(UINT16 conn_handle); UINT8 btsnd_hcic_ble_cs_set_default_settings(UINT16 conn_handle, UINT8 role_enable, UINT8 cs_sync_ant_selection, INT8 max_tx_power); -UINT8 btsnd_hcic_ble_cs_read_remote_fae_table(UINT16 conn_handle); +BOOLEAN btsnd_hcic_ble_cs_read_remote_fae_table(UINT16 conn_handle); UINT8 btsnd_hcic_ble_cs_write_cached_remote_fae_table(UINT16 conn_handle, UINT8 *remote_fae_table); -UINT8 btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 create_context, +BOOLEAN btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 create_context, UINT8 main_mode_type, UINT8 sub_mode_type, UINT8 min_main_mode_steps, UINT8 max_main_mode_steps, UINT8 main_mode_repetition, UINT8 mode_0_steps, UINT8 role, UINT8 rtt_type, UINT8 cs_sync_phy, UINT8 *channel_map, UINT8 channel_map_repetition, UINT8 channel_selection_type, UINT8 ch3c_shape, UINT8 ch3c_jump,UINT8 reserved); -UINT8 btsnd_hcic_ble_cs_remove_config(UINT16 conn_handle, UINT8 config_id); +BOOLEAN btsnd_hcic_ble_cs_remove_config(UINT16 conn_handle, UINT8 config_id); UINT8 btsnd_hcic_ble_cs_set_channel_classification(UINT8 *channel_class); UINT8 btsnd_hcic_ble_cs_set_procedure_params(UINT16 conn_handle, UINT8 config_id, UINT16 max_procedure_len, UINT16 min_procedure_interval, UINT16 max_procedure_interval, @@ -1412,7 +1412,7 @@ UINT8 btsnd_hcic_ble_cs_set_procedure_params(UINT16 conn_handle, UINT8 config_id UINT32 max_subevent_len, UINT8 tone_ant_config_selection, UINT8 phy, UINT8 tx_power_delta, UINT8 preferred_peer_antenna, UINT8 SNR_control_initiator, UINT8 SNR_control_reflector); -UINT8 btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable); +BOOLEAN btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable); #endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE) #if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)