fix(bt): disable dm1 for acl-u when aes-ccm is on in peripheral

This commit is contained in:
gongyantao
2025-05-08 15:30:49 +08:00
parent 2dfb97010c
commit fa57638bbf
6 changed files with 13 additions and 13 deletions

View File

@@ -144,7 +144,7 @@ esp_err_t esp_bluedroid_init_with_cfg(esp_bluedroid_config_t *cfg)
osi_mem_dbg_init(); osi_mem_dbg_init();
#endif #endif
ret = bluedriod_config_init(cfg); ret = bluedroid_config_init(cfg);
if (ret != BT_STATUS_SUCCESS) { if (ret != BT_STATUS_SUCCESS) {
LOG_ERROR("Bluedroid stack initialize fail, ret:%d", ret); LOG_ERROR("Bluedroid stack initialize fail, ret:%d", ret);
return ESP_FAIL; return ESP_FAIL;
@@ -228,7 +228,7 @@ esp_err_t esp_bluedroid_deinit(void)
btc_deinit(); btc_deinit();
bluedriod_config_deinit(); bluedroid_config_deinit();
#if (BT_HCI_LOG_INCLUDED == TRUE) #if (BT_HCI_LOG_INCLUDED == TRUE)
bt_hci_log_deinit(); bt_hci_log_deinit();

View File

@@ -322,7 +322,7 @@ esp_err_t esp_bt_gap_set_security_param(esp_bt_sp_param_t param_type,
return ESP_ERR_INVALID_STATE; return ESP_ERR_INVALID_STATE;
} }
if (!(bluedriod_config_get()->get_ssp_enabled())) { if (!(bluedroid_config_get()->get_ssp_enabled())) {
ESP_LOGE(TAG, "%s is not supported when `ssp_en` in `esp_bluedroid_config_t` is disabled!", __func__); ESP_LOGE(TAG, "%s is not supported when `ssp_en` in `esp_bluedroid_config_t` is disabled!", __func__);
return ESP_ERR_NOT_SUPPORTED; return ESP_ERR_NOT_SUPPORTED;
} }
@@ -347,7 +347,7 @@ esp_err_t esp_bt_gap_ssp_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint3
return ESP_ERR_INVALID_STATE; return ESP_ERR_INVALID_STATE;
} }
if (!(bluedriod_config_get()->get_ssp_enabled())) { if (!(bluedroid_config_get()->get_ssp_enabled())) {
ESP_LOGE(TAG, "%s is not supported when `ssp_en` in `esp_bluedroid_config_t` is disabled!", __func__); ESP_LOGE(TAG, "%s is not supported when `ssp_en` in `esp_bluedroid_config_t` is disabled!", __func__);
return ESP_ERR_NOT_SUPPORTED; return ESP_ERR_NOT_SUPPORTED;
} }
@@ -371,7 +371,7 @@ esp_err_t esp_bt_gap_ssp_confirm_reply(esp_bd_addr_t bd_addr, bool accept)
return ESP_ERR_INVALID_STATE; return ESP_ERR_INVALID_STATE;
} }
if (!(bluedriod_config_get()->get_ssp_enabled())) { if (!(bluedroid_config_get()->get_ssp_enabled())) {
ESP_LOGE(TAG, "%s is not supported when `ssp_en` in `esp_bluedroid_config_t` is disabled!", __func__); ESP_LOGE(TAG, "%s is not supported when `ssp_en` in `esp_bluedroid_config_t` is disabled!", __func__);
return ESP_ERR_NOT_SUPPORTED; return ESP_ERR_NOT_SUPPORTED;
} }

View File

@@ -14,8 +14,8 @@ struct bluedroid_config {
bool (*get_ssp_enabled)(void); bool (*get_ssp_enabled)(void);
}; };
bt_status_t bluedriod_config_init(esp_bluedroid_config_t *cfg); bt_status_t bluedroid_config_init(esp_bluedroid_config_t *cfg);
void bluedriod_config_deinit(void); void bluedroid_config_deinit(void);
const struct bluedroid_config *bluedriod_config_get(void); const struct bluedroid_config *bluedroid_config_get(void);

View File

@@ -25,7 +25,7 @@ static bool get_ssp_enabled(void)
return cfg->ssp_en; return cfg->ssp_en;
} }
bt_status_t bluedriod_config_init(esp_bluedroid_config_t *cfg) bt_status_t bluedroid_config_init(esp_bluedroid_config_t *cfg)
{ {
s_stack_config_env = osi_calloc(sizeof(struct stack_config_env_tag)); s_stack_config_env = osi_calloc(sizeof(struct stack_config_env_tag));
if (!s_stack_config_env) { if (!s_stack_config_env) {
@@ -40,7 +40,7 @@ bt_status_t bluedriod_config_init(esp_bluedroid_config_t *cfg)
return BT_STATUS_SUCCESS; return BT_STATUS_SUCCESS;
} }
void bluedriod_config_deinit(void) void bluedroid_config_deinit(void)
{ {
if (s_stack_config_env) { if (s_stack_config_env) {
osi_free(s_stack_config_env); osi_free(s_stack_config_env);
@@ -48,7 +48,7 @@ void bluedriod_config_deinit(void)
} }
} }
const struct bluedroid_config *bluedriod_config_get(void) const struct bluedroid_config *bluedroid_config_get(void)
{ {
assert(s_stack_config_env); assert(s_stack_config_env);
return &s_stack_config_env->interface; return &s_stack_config_env->interface;

View File

@@ -188,7 +188,7 @@ static void start_up(void)
// dependent on what we configure from page 0 and host SSP configuration // dependent on what we configure from page 0 and host SSP configuration
controller_param.simple_pairing_supported = HCI_SIMPLE_PAIRING_SUPPORTED( controller_param.simple_pairing_supported = HCI_SIMPLE_PAIRING_SUPPORTED(
controller_param.features_classic[0].as_array) && controller_param.features_classic[0].as_array) &&
(bluedriod_config_get()->get_ssp_enabled()); (bluedroid_config_get()->get_ssp_enabled());
if (controller_param.simple_pairing_supported) { if (controller_param.simple_pairing_supported) {
response = AWAIT_COMMAND(controller_param.packet_factory->make_write_simple_pairing_mode(HCI_SP_MODE_ENABLED)); response = AWAIT_COMMAND(controller_param.packet_factory->make_write_simple_pairing_mode(HCI_SP_MODE_ENABLED));
controller_param.packet_parser->parse_generic_command_complete(response); controller_param.packet_parser->parse_generic_command_complete(response);