mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 18:10:57 +02:00
Merge branch 'opt/opt_ble_log' into 'master'
feat(ble/bluedroid): Added BLE debug LOG for bluedroid Closes BLERP-2258 See merge request espressif/esp-idf!41567
This commit is contained in:
@@ -12,7 +12,7 @@ void btc_alarm_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_alarm_args_t *arg = (btc_alarm_args_t *)msg->arg;
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
if (arg->cb) {
|
||||
arg->cb(arg->cb_data);
|
||||
|
@@ -63,7 +63,15 @@ void bta_dm_co_security_param_init(void)
|
||||
bte_appl_cfg.ble_min_key_size = BTM_BLE_MIN_KEY_SIZE;
|
||||
bte_appl_cfg.ble_accept_auth_enable = BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE;
|
||||
bte_appl_cfg.oob_support = BTM_BLE_OOB_DISABLE;
|
||||
};
|
||||
|
||||
APPL_TRACE_DEBUG("%s: auth_req=%u, io_cap=%u, init_key=%u, resp_key=%u, "
|
||||
"max_key_size=%u, min_key_size=%u, accept_auth=%u, oob=%u",
|
||||
__func__,
|
||||
bte_appl_cfg.ble_auth_req, bte_appl_cfg.ble_io_cap,
|
||||
bte_appl_cfg.ble_init_key, bte_appl_cfg.ble_resp_key,
|
||||
bte_appl_cfg.ble_max_key_size, bte_appl_cfg.ble_min_key_size,
|
||||
bte_appl_cfg.ble_accept_auth_enable, bte_appl_cfg.oob_support);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined CLASSIC_BT_INCLUDED && CLASSIC_BT_INCLUDED == TRUE)
|
||||
@@ -379,6 +387,7 @@ void bta_dm_co_ble_set_io_cap(UINT8 ble_io_cap)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
if(ble_io_cap < BTM_IO_CAP_MAX ) {
|
||||
bte_appl_cfg.ble_io_cap = ble_io_cap;
|
||||
APPL_TRACE_DEBUG("%s: ble_io_cap set to %u", __func__, ble_io_cap);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s error:Invalid io cap value.",__func__);
|
||||
}
|
||||
@@ -389,22 +398,25 @@ void bta_dm_co_ble_set_auth_req(UINT8 ble_auth_req)
|
||||
{
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
bte_appl_cfg.ble_auth_req = ble_auth_req;
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
APPL_TRACE_DEBUG("%s: ble_auth_req set to %u", __func__, ble_auth_req);
|
||||
#endif
|
||||
}
|
||||
|
||||
void bta_dm_co_ble_set_init_key_req(UINT8 init_key)
|
||||
{
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
init_key &= 0x0f; // 4~7bit reservd, only used the 0~3bit
|
||||
init_key &= 0x0f; // 4~7bit reserved, only used the 0~3bit
|
||||
bte_appl_cfg.ble_init_key = init_key;
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
APPL_TRACE_DEBUG("%s: init_key set to 0x%x", __func__, init_key);
|
||||
#endif
|
||||
}
|
||||
|
||||
void bta_dm_co_ble_set_rsp_key_req(UINT8 rsp_key)
|
||||
{
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
rsp_key &= 0x0f; // 4~7bit reservd, only used the 0~3bit
|
||||
rsp_key &= 0x0f; // 4~7bit reserved, only used the 0~3bit
|
||||
bte_appl_cfg.ble_resp_key = rsp_key;
|
||||
APPL_TRACE_DEBUG("%s: rsp_key set to 0x%x", __func__, rsp_key);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
}
|
||||
|
||||
@@ -413,6 +425,7 @@ void bta_dm_co_ble_set_max_key_size(UINT8 ble_key_size)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
if(ble_key_size >= bte_appl_cfg.ble_min_key_size && ble_key_size <= BTM_BLE_MAX_KEY_SIZE) {
|
||||
bte_appl_cfg.ble_max_key_size = ble_key_size;
|
||||
APPL_TRACE_DEBUG("%s: max_key_size set to %d", __func__, ble_key_size);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s error:Invalid key size value, key_size =%d",__func__, ble_key_size);
|
||||
}
|
||||
@@ -424,6 +437,7 @@ void bta_dm_co_ble_set_min_key_size(UINT8 ble_key_size)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
if(ble_key_size >= BTM_BLE_MIN_KEY_SIZE && ble_key_size <= bte_appl_cfg.ble_max_key_size) {
|
||||
bte_appl_cfg.ble_min_key_size = ble_key_size;
|
||||
APPL_TRACE_DEBUG("%s: min_key_size set to %u", __func__, ble_key_size);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s error:Invalid key size value, key_size =%d",__func__, ble_key_size);
|
||||
}
|
||||
@@ -437,6 +451,7 @@ void bta_dm_co_ble_set_accept_auth_enable(UINT8 enable)
|
||||
enable = BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_ENABLE;
|
||||
}
|
||||
bte_appl_cfg.ble_accept_auth_enable = enable;
|
||||
APPL_TRACE_DEBUG("%s: accept_auth_enable set to %u", __func__, enable);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
}
|
||||
|
||||
@@ -464,6 +479,7 @@ void bta_dm_co_ble_oob_support(UINT8 enable)
|
||||
} else {
|
||||
bte_appl_cfg.oob_support = BTM_BLE_OOB_DISABLE;
|
||||
}
|
||||
APPL_TRACE_DEBUG("%s: oob_support set to %u", __func__, bte_appl_cfg.oob_support);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
}
|
||||
|
||||
|
@@ -523,7 +523,8 @@ BOOLEAN bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
cmd_data->api_write.p_value = (UINT8 *)(cmd_data + 1);
|
||||
memcpy(cmd_data->api_write.p_value, p_data->api_write.p_value, len);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s(), line = %d, alloc fail, no memory.", __func__, __LINE__);
|
||||
APPL_TRACE_ERROR("%s(), line = %d, alloc fail, size %d,no memory. free=%d, largest_block=%d", __func__, __LINE__,
|
||||
heap_caps_get_free_size(MALLOC_CAP_DEFAULT), heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT));
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
|
@@ -95,7 +95,7 @@ void btc_dev_cb_arg_deep_free(btc_msg_t *msg)
|
||||
|
||||
void btc_dev_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
@@ -117,6 +117,8 @@ void btc_dev_cb_handler(btc_msg_t *msg)
|
||||
{
|
||||
esp_bt_dev_cb_param_t *param = (esp_bt_dev_cb_param_t *)msg->arg;
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
if (msg->act < ESP_BT_DEV_EVT_MAX) {
|
||||
btc_dev_cb_to_app(msg->act, param);
|
||||
} else {
|
||||
|
@@ -784,6 +784,7 @@ void btc_dm_sec_cb_handler(btc_msg_t *msg)
|
||||
ble_msg->pid = BTC_PID_GAP_BLE;
|
||||
// tBTA_SERVICE_MASK service_mask;
|
||||
BTC_TRACE_DEBUG("btc_dm_upstreams_cback ev: %d\n", msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTA_DM_ENABLE_EVT: {
|
||||
|
@@ -97,7 +97,7 @@ static void btc_deinit_bluetooth(void)
|
||||
|
||||
void btc_main_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __func__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_MAIN_ACT_INIT:
|
||||
@@ -127,101 +127,132 @@ uint32_t btc_get_ble_status(void)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
// Number of active advertising
|
||||
extern uint8_t btm_ble_adv_active_count(void);
|
||||
if (btm_ble_adv_active_count()) {
|
||||
uint8_t adv_cnt = btm_ble_adv_active_count();
|
||||
if (adv_cnt) {
|
||||
BTC_TRACE_WARNING("%s advertising active, cnt %d", __func__, adv_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_ADV);
|
||||
}
|
||||
|
||||
// Number of active scanning
|
||||
extern uint8_t btm_ble_scan_active_count(void);
|
||||
if (btm_ble_scan_active_count()) {
|
||||
uint8_t scan_cnt = btm_ble_scan_active_count();
|
||||
if (scan_cnt) {
|
||||
BTC_TRACE_WARNING("%s scan active, cnt %d", __func__, scan_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_SCAN);
|
||||
}
|
||||
|
||||
// Number of active GATT tcb
|
||||
extern uint8_t gatt_tcb_active_count(void);
|
||||
if (gatt_tcb_active_count()) {
|
||||
uint8_t gatt_tcb_cnt = gatt_tcb_active_count();
|
||||
if (gatt_tcb_cnt) {
|
||||
BTC_TRACE_WARNING("%s gatt tcb active, cnt %d", __func__, gatt_tcb_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_CONN);
|
||||
}
|
||||
|
||||
// Number of active ACL connection
|
||||
extern uint8_t btm_ble_acl_active_count(void);
|
||||
if (btm_ble_acl_active_count()) {
|
||||
uint8_t acl_cnt = btm_ble_acl_active_count();
|
||||
if (acl_cnt) {
|
||||
BTC_TRACE_WARNING("%s acl connection active, cnt %d", __func__, acl_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_CONN);
|
||||
}
|
||||
|
||||
// Number of active L2C plcb
|
||||
extern uint8_t l2cu_ble_plcb_active_count(void);
|
||||
if (l2cu_ble_plcb_active_count()) {
|
||||
uint8_t plcb_cnt = l2cu_ble_plcb_active_count();
|
||||
if (plcb_cnt) {
|
||||
BTC_TRACE_WARNING("%s l2c plcb active, cnt %d", __func__, plcb_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_CONN);
|
||||
}
|
||||
|
||||
// Address resolve status
|
||||
extern uint8_t btm_get_ble_addr_resolve_disable_status(void);
|
||||
if (btm_get_ble_addr_resolve_disable_status()) {
|
||||
uint8_t addr_resolve_disable = btm_get_ble_addr_resolve_disable_status();
|
||||
if (addr_resolve_disable) {
|
||||
BTC_TRACE_WARNING("%s address resolve disabled", __func__);
|
||||
status |= BIT(BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE);
|
||||
}
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
// Number of recorded devices
|
||||
extern uint8_t btm_ble_sec_dev_record_count(void);
|
||||
if (btm_ble_sec_dev_record_count()) {
|
||||
uint8_t sec_dev_cnt = btm_ble_sec_dev_record_count();
|
||||
if (sec_dev_cnt) {
|
||||
BTC_TRACE_WARNING("%s security device record count %d", __func__, sec_dev_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_DEVICE_REC);
|
||||
}
|
||||
|
||||
// Number of saved bonded devices
|
||||
if (btc_storage_get_num_ble_bond_devices()) {
|
||||
int bond_cnt = btc_storage_get_num_ble_bond_devices();
|
||||
if (bond_cnt) {
|
||||
BTC_TRACE_WARNING("%s bonded devices count %d", __func__, bond_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_BOND);
|
||||
}
|
||||
#endif
|
||||
#endif // SMP_INCLUDED
|
||||
|
||||
#if (BLE_PRIVACY_SPT == TRUE)
|
||||
#if (BLE_PRIVACY_SPT == TRUE)
|
||||
// Privacy enabled
|
||||
extern uint8_t btm_ble_privacy_is_enabled(void);
|
||||
if (btm_ble_privacy_is_enabled()) {
|
||||
uint8_t privacy_en = btm_ble_privacy_is_enabled();
|
||||
if (privacy_en) {
|
||||
BTC_TRACE_WARNING("%s privacy enabled", __func__);
|
||||
status |= BIT(BTC_BLE_STATUS_PRIVACY);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // BLE_PRIVACY_SPT
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
// Number of active extended advertsing
|
||||
#endif // BLE_INCLUDED
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
// Number of active extended advertising
|
||||
extern uint8_t btm_ble_ext_adv_active_count(void);
|
||||
if (btm_ble_ext_adv_active_count()) {
|
||||
uint8_t ext_adv_cnt = btm_ble_ext_adv_active_count();
|
||||
if (ext_adv_cnt) {
|
||||
BTC_TRACE_WARNING("%s extended advertising active, cnt %d", __func__, ext_adv_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_EXT_ADV);
|
||||
}
|
||||
#endif
|
||||
#endif // BLE_50_EXTEND_ADV_EN
|
||||
|
||||
#if (GATTC_INCLUDED == TRUE)
|
||||
#if (GATTC_INCLUDED == TRUE)
|
||||
// Number of registered GATTC APP
|
||||
extern uint8_t bta_gattc_cl_rcb_active_count(void);
|
||||
if (bta_gattc_cl_rcb_active_count()) {
|
||||
uint8_t gattc_app_cnt = bta_gattc_cl_rcb_active_count();
|
||||
if (gattc_app_cnt) {
|
||||
BTC_TRACE_WARNING("%s GATTC app active, cnt %d", __func__, gattc_app_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_GATTC_APP);
|
||||
}
|
||||
|
||||
// Number of saved GATTC cache
|
||||
extern UINT8 bta_gattc_co_get_addr_num(void);
|
||||
if (bta_gattc_co_get_addr_num()) {
|
||||
uint8_t gattc_cache_cnt = bta_gattc_co_get_addr_num();
|
||||
if (gattc_cache_cnt) {
|
||||
BTC_TRACE_WARNING("%s GATTC cache count %d", __func__, gattc_cache_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_GATTC_CACHE);
|
||||
}
|
||||
#endif
|
||||
#endif // GATTC_INCLUDED
|
||||
|
||||
#if (GATTS_INCLUDED == TRUE)
|
||||
#if (GATTS_INCLUDED == TRUE)
|
||||
// Number of registered GATTS service
|
||||
extern uint8_t bta_gatts_srvc_active_count(void);
|
||||
if (bta_gatts_srvc_active_count()) {
|
||||
uint8_t gatts_srvc_cnt = bta_gatts_srvc_active_count();
|
||||
if (gatts_srvc_cnt) {
|
||||
BTC_TRACE_WARNING("%s GATTS service active, cnt %d", __func__, gatts_srvc_cnt);
|
||||
status |= BIT(BTC_BLE_STATUS_GATTS_SRVC);
|
||||
}
|
||||
#endif
|
||||
#endif // GATTS_INCLUDED
|
||||
|
||||
#if SMP_INCLUDED == TRUE
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
extern uint8_t smp_get_state(void);
|
||||
if (smp_get_state()) {
|
||||
uint8_t smp_state = smp_get_state();
|
||||
if (smp_state) {
|
||||
BTC_TRACE_WARNING("%s SMP state active, state=%d", __func__, smp_state);
|
||||
status |= BIT(BTC_BLE_STATUS_SMP_STATE);
|
||||
}
|
||||
#endif
|
||||
#endif // SMP_INCLUDED
|
||||
|
||||
BTC_TRACE_WARNING("%s exit, final status=0x%x", __func__, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@@ -62,6 +62,9 @@ static void queue_int_advance(void)
|
||||
void btc_profile_queue_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_prf_que_args_t *arg = (btc_prf_que_args_t *)(msg->arg);
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_PRF_QUE_CONNECT:
|
||||
queue_int_add(&(arg->connect_node));
|
||||
|
@@ -339,7 +339,7 @@ void btc_ble_cte_call_handler(btc_msg_t *msg)
|
||||
#if ((BLE_FEAT_CTE_CONNECTIONLESS_EN == TRUE) || (BLE_FEAT_CTE_CONNECTION_EN == TRUE))
|
||||
btc_ble_cte_args_t *arg = (btc_ble_cte_args_t *)msg->arg;
|
||||
#endif // #if ((BLE_FEAT_CTE_CONNECTIONLESS_EN == TRUE) || (BLE_FEAT_CTE_CONNECTION_EN == TRUE))
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
#if (BLE_FEAT_CTE_CONNECTIONLESS_EN == TRUE)
|
||||
|
@@ -61,6 +61,7 @@ static inline void btc_gap_ble_cb_to_app(esp_gap_ble_cb_event_t event, esp_ble_g
|
||||
esp_gap_ble_cb_t btc_gap_ble_cb = (esp_gap_ble_cb_t)btc_profile_cb_get(BTC_PID_GAP_BLE);
|
||||
if (btc_gap_ble_cb) {
|
||||
btc_gap_ble_cb(event, param);
|
||||
BTC_TRACE_DEBUG("btc_gap_ble_cb_to_app, event=%d", event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1769,8 @@ void btc_gap_ble_cb_handler(btc_msg_t *msg)
|
||||
{
|
||||
esp_ble_gap_cb_param_t *param = (esp_ble_gap_cb_param_t *)msg->arg;
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
if (msg->act < ESP_GAP_BLE_EVT_MAX) {
|
||||
btc_gap_ble_cb_to_app(msg->act, param);
|
||||
} else {
|
||||
@@ -2177,7 +2180,7 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
btc_ble_5_gap_args_t *arg_5 = (btc_ble_5_gap_args_t *)msg->arg;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
|
@@ -1063,7 +1063,9 @@ void btc_gap_bt_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_gap_bt_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_gap_bt_args_t *arg = (btc_gap_bt_args_t *)msg->arg;
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __func__, msg->act);
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_GAP_BT_ACT_SET_SCAN_MODE: {
|
||||
btc_bt_set_scan_mode(arg->set_scan_mode.c_mode, arg->set_scan_mode.d_mode);
|
||||
|
@@ -23,7 +23,8 @@ static void btc_set_local_mtu(uint16_t mtu)
|
||||
|
||||
void btc_gatt_com_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __func__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_GATT_ACT_SET_LOCAL_MTU:
|
||||
{
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
@@ -24,6 +24,7 @@ static inline void btc_gattc_cb_to_app(esp_gattc_cb_event_t event, esp_gatt_if_t
|
||||
esp_gattc_cb_t btc_gattc_cb = (esp_gattc_cb_t )btc_profile_cb_get(BTC_PID_GATTC);
|
||||
if (btc_gattc_cb) {
|
||||
btc_gattc_cb(event, gattc_if, param);
|
||||
BTC_TRACE_DEBUG("btc_gattc_cb_to_app, gattc_if %d, event=%d", gattc_if, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,6 +715,9 @@ static void btc_gattc_unreg_for_notify(btc_ble_gattc_args_t *arg)
|
||||
void btc_gattc_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_gattc_args_t *arg = (btc_ble_gattc_args_t *)(msg->arg);
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_GATTC_ACT_APP_REGISTER:
|
||||
btc_gattc_app_register(arg);
|
||||
@@ -803,6 +807,8 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
|
||||
|
||||
memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t));
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTA_GATTC_REG_EVT: {
|
||||
tBTA_GATTC_REG *reg_oper = &arg->reg_oper;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -37,6 +37,7 @@ static inline void btc_gatts_cb_to_app(esp_gatts_cb_event_t event, esp_gatt_if_t
|
||||
{
|
||||
esp_gatts_cb_t btc_gatts_cb = (esp_gatts_cb_t)btc_profile_cb_get(BTC_PID_GATTS);
|
||||
if (btc_gatts_cb) {
|
||||
BTC_TRACE_DEBUG("btc_gatts_cb_to_app, gatts_if %d, event=%d", gatts_if, event);
|
||||
btc_gatts_cb(event, gatts_if, param);
|
||||
}
|
||||
}
|
||||
@@ -616,6 +617,8 @@ void btc_gatts_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_gatts_args_t *arg = (btc_ble_gatts_args_t *)msg->arg;
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_GATTS_ACT_APP_REGISTER: {
|
||||
tBT_UUID uuid;
|
||||
@@ -764,6 +767,8 @@ void btc_gatts_cb_handler(btc_msg_t *msg)
|
||||
tBTA_GATTS *p_data = (tBTA_GATTS *)msg->arg;
|
||||
esp_gatt_if_t gatts_if;
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTA_GATTS_REG_EVT: {
|
||||
gatts_if = p_data->reg_oper.server_if;
|
||||
|
@@ -1114,6 +1114,8 @@ void btc_hf_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_hf_args_t *arg = (btc_hf_args_t *)(msg->arg);
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_HF_INIT_EVT:
|
||||
{
|
||||
|
@@ -721,6 +721,9 @@ static void btc_hd_call_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_hd_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_hidd_args_t *arg = (btc_hidd_args_t *)(msg->arg);
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_HD_INIT_EVT:
|
||||
btc_hd_init();
|
||||
@@ -779,6 +782,8 @@ void btc_hd_cb_handler(btc_msg_t *msg)
|
||||
esp_hidd_cb_param_t param = {0};
|
||||
BTC_TRACE_API("%s: event=%s", __func__, dump_hd_event(event));
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (event) {
|
||||
case BTA_HD_ENABLE_EVT:
|
||||
BTC_TRACE_DEBUG("%s: status=%d", __func__, p_data->status);
|
||||
|
@@ -1119,6 +1119,8 @@ static void btc_hh_call_arg_deep_free(btc_msg_t *msg)
|
||||
void btc_hh_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_hidh_args_t *arg = (btc_hidh_args_t *)(msg->arg);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_HH_INIT_EVT:
|
||||
btc_hh_init();
|
||||
@@ -1227,6 +1229,7 @@ void btc_hh_cb_handler(btc_msg_t *msg)
|
||||
btc_hh_device_t *p_dev = NULL;
|
||||
int len, i;
|
||||
BTC_TRACE_DEBUG("%s: event=%s dereg = %d", __func__, dump_hh_event(msg->act), btc_hh_cb.service_dereg_active);
|
||||
|
||||
switch (msg->act) {
|
||||
case BTA_HH_ENABLE_EVT:
|
||||
if (p_data->status == BTA_HH_OK) {
|
||||
|
@@ -297,7 +297,7 @@ void btc_iso_ble_cb_deep_free(btc_msg_t *msg)
|
||||
void btc_iso_ble_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_ble_iso_args_t *arg = (btc_ble_iso_args_t *)msg->arg;
|
||||
BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (msg->act) {
|
||||
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||
|
@@ -300,6 +300,7 @@ static inline void btc_l2cap_cb_to_app(esp_bt_l2cap_cb_event_t event, esp_bt_l2c
|
||||
{
|
||||
esp_bt_l2cap_cb_t btc_l2cap_cb = (esp_bt_l2cap_cb_t)btc_profile_cb_get(BTC_PID_L2CAP);
|
||||
if (btc_l2cap_cb) {
|
||||
BTC_TRACE_DEBUG("btc_l2cap_cb_to_app, event=%d", event);
|
||||
btc_l2cap_cb(event, param);
|
||||
}
|
||||
}
|
||||
@@ -772,6 +773,7 @@ static void btc_l2cap_disconnect(uint32_t handle)
|
||||
void btc_l2cap_call_handler(btc_msg_t *msg)
|
||||
{
|
||||
btc_l2cap_args_t *arg = (btc_l2cap_args_t *)(msg->arg);
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
switch (msg->act) {
|
||||
case BTC_L2CAP_ACT_INIT:
|
||||
btc_l2cap_init();
|
||||
@@ -809,6 +811,8 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
|
||||
uint8_t serial = 0;
|
||||
uint32_t count = 0;
|
||||
|
||||
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);
|
||||
|
||||
switch (event) {
|
||||
case BTA_JV_ENABLE_EVT:
|
||||
param.init.status = p_data->status;
|
||||
|
@@ -614,3 +614,96 @@ const hci_t *hci_layer_get_interface(void)
|
||||
init_layer_interface();
|
||||
return &interface;
|
||||
}
|
||||
|
||||
#if !UC_BT_STACK_NO_LOG
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function hci_status_code_to_string
|
||||
**
|
||||
** Description Converts an HCI status code to a human-readable string.
|
||||
** If the code is not defined in the specification, the
|
||||
** function returns "Unknown Status (0xXX)" where XX is the
|
||||
** actual code value.
|
||||
** Reference: BLUETOOTH CORE SPECIFICATION Version 5.4,
|
||||
** Vol 1, Part F, p. 376
|
||||
**
|
||||
** Parameters status : HCI status code
|
||||
**
|
||||
** Returns const char* : readable description of the status
|
||||
**
|
||||
*******************************************************************************/
|
||||
const char *hci_status_code_to_string(uint8_t status)
|
||||
{
|
||||
switch (status) {
|
||||
case HCI_SUCCESS: return "Success"; /* 0x00 */
|
||||
case HCI_ERR_ILLEGAL_COMMAND: return "Illegal Command"; /* 0x01 */
|
||||
case HCI_ERR_NO_CONNECTION: return "No Connection"; /* 0x02 */
|
||||
case HCI_ERR_HW_FAILURE: return "HW Failure"; /* 0x03 */
|
||||
case HCI_ERR_PAGE_TIMEOUT: return "Page Timeout"; /* 0x04 */
|
||||
case HCI_ERR_AUTH_FAILURE: return "Auth Failure"; /* 0x05 */
|
||||
case HCI_ERR_KEY_MISSING: return "Key Missing"; /* 0x06 */
|
||||
case HCI_ERR_MEMORY_FULL: return "Memory Full"; /* 0x07 */
|
||||
case HCI_ERR_CONNECTION_TOUT: return "Conn Timeout"; /* 0x08 */
|
||||
case HCI_ERR_MAX_NUM_OF_CONNECTIONS: return "Conn Limit Exceeded"; /* 0x09 */
|
||||
case HCI_ERR_MAX_NUM_OF_SCOS: return "Sync Conn Limit Exceeded"; /* 0x0A */
|
||||
case HCI_ERR_CONNECTION_EXISTS: return "Conn Exists"; /* 0x0B */
|
||||
case HCI_ERR_COMMAND_DISALLOWED: return "Cmd Disallowed"; /* 0x0C */
|
||||
case HCI_ERR_HOST_REJECT_RESOURCES: return "Rejected: Resources"; /* 0x0D */
|
||||
case HCI_ERR_HOST_REJECT_SECURITY: return "Rejected: Security"; /* 0x0E */
|
||||
case HCI_ERR_HOST_REJECT_DEVICE: return "Rejected: BD_ADDR"; /* 0x0F */
|
||||
case HCI_ERR_HOST_TIMEOUT: return "Accept Timeout"; /* 0x10 */
|
||||
case HCI_ERR_UNSUPPORTED_VALUE: return "Unsupported Value"; /* 0x11 */
|
||||
case HCI_ERR_ILLEGAL_PARAMETER_FMT: return "Invalid Param"; /* 0x12 */
|
||||
case HCI_ERR_PEER_USER: return "Terminated by Peer"; /* 0x13 */
|
||||
case HCI_ERR_PEER_LOW_RESOURCES: return "Peer Low Resources"; /* 0x14 */
|
||||
case HCI_ERR_PEER_POWER_OFF: return "Peer Power Off"; /* 0x15 */
|
||||
case HCI_ERR_CONN_CAUSE_LOCAL_HOST: return "Terminated by Host"; /* 0x16 */
|
||||
case HCI_ERR_REPEATED_ATTEMPTS: return "Repeated Attempts"; /* 0x17 */
|
||||
case HCI_ERR_PAIRING_NOT_ALLOWED: return "Pairing Not Allowed"; /* 0x18 */
|
||||
case HCI_ERR_UNKNOWN_LMP_PDU: return "Unknown LMP PDU"; /* 0x19 */
|
||||
case HCI_ERR_UNSUPPORTED_REM_FEATURE: return "Unsupported Remote Feature"; /* 0x1A */
|
||||
case HCI_ERR_SCO_OFFSET_REJECTED: return "SCO Offset Rejected"; /* 0x1B */
|
||||
case HCI_ERR_SCO_INTERVAL_REJECTED: return "SCO Interval Rejected"; /* 0x1C */
|
||||
case HCI_ERR_SCO_AIR_MODE: return "SCO Air Mode Rejected"; /* 0x1D */
|
||||
case HCI_ERR_INVALID_LMP_PARAM: return "Invalid LMP/LL Param"; /* 0x1E */
|
||||
case HCI_ERR_UNSPECIFIED: return "Unspecified Error"; /* 0x1F */
|
||||
case HCI_ERR_UNSUPPORTED_LMP_PARAMETERS: return "Unsupported LMP/LL"; /* 0x20 */
|
||||
case HCI_ERR_ROLE_CHANGE_NOT_ALLOWED: return "Role Change Not Allowed"; /* 0x21 */
|
||||
case HCI_ERR_LMP_RESPONSE_TIMEOUT: return "LMP/LL Response Timeout"; /* 0x22 */
|
||||
case HCI_ERR_LMP_ERR_TRANS_COLLISION: return "Transaction Collision"; /* 0x23 */
|
||||
case HCI_ERR_LMP_PDU_NOT_ALLOWED: return "LMP PDU Not Allowed"; /* 0x24 */
|
||||
case HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE: return "Encryption Not Acceptable"; /* 0x25 */
|
||||
case HCI_ERR_UNIT_KEY_USED: return "Link Key Used"; /* 0x26 */
|
||||
case HCI_ERR_QOS_NOT_SUPPORTED: return "QoS Not Supported"; /* 0x27 */
|
||||
case HCI_ERR_INSTANT_PASSED: return "Instant Passed"; /* 0x28 */
|
||||
case HCI_ERR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED: return "Pairing w/ Unit Key Not Supported"; /* 0x29 */
|
||||
case HCI_ERR_DIFF_TRANSACTION_COLLISION: return "Transaction Collision"; /* 0x2A */
|
||||
case HCI_ERR_UNDEFINED_0x2B: return "Reserved"; /* 0x2B */
|
||||
case HCI_ERR_QOS_UNACCEPTABLE_PARAM: return "QoS Unacceptable"; /* 0x2C */
|
||||
case HCI_ERR_QOS_REJECTED: return "QoS Rejected"; /* 0x2D */
|
||||
case HCI_ERR_CHAN_CLASSIF_NOT_SUPPORTED: return "Chan Classif Not Supported"; /* 0x2E */
|
||||
case HCI_ERR_INSUFFCIENT_SECURITY: return "Insufficient Security"; /* 0x2F */
|
||||
case HCI_ERR_PARAM_OUT_OF_RANGE: return "Param Out of Range"; /* 0x30 */
|
||||
case HCI_ERR_UNDEFINED_0x31: return "Reserved"; /* 0x31 */
|
||||
case HCI_ERR_ROLE_SWITCH_PENDING: return "Role Switch Pending"; /* 0x32 */
|
||||
case HCI_ERR_UNDEFINED_0x33: return "Reserved"; /* 0x33 */
|
||||
case HCI_ERR_RESERVED_SLOT_VIOLATION: return "Slot Violation"; /* 0x34 */
|
||||
case HCI_ERR_ROLE_SWITCH_FAILED: return "Role Switch Failed"; /* 0x35 */
|
||||
case HCI_ERR_INQ_RSP_DATA_TOO_LARGE: return "Inquiry Response Too Large"; /* 0x36 */
|
||||
case HCI_ERR_SIMPLE_PAIRING_NOT_SUPPORTED: return "Simple Pairing Not Supported"; /* 0x37 */
|
||||
case HCI_ERR_HOST_BUSY_PAIRING: return "Host Busy"; /* 0x38 */
|
||||
case HCI_ERR_REJ_NO_SUITABLE_CHANNEL: return "No Suitable Channel"; /* 0x39 */
|
||||
case HCI_ERR_CONTROLLER_BUSY: return "Controller Busy"; /* 0x3A */
|
||||
case HCI_ERR_UNACCEPT_CONN_INTERVAL: return "Unacceptable Conn Interval"; /* 0x3B */
|
||||
case HCI_ERR_DIRECTED_ADVERTISING_TIMEOUT: return "Adv Timeout"; /* 0x3C */
|
||||
case HCI_ERR_CONN_TOUT_DUE_TO_MIC_FAILURE: return "MIC Failure"; /* 0x3D */
|
||||
case HCI_ERR_CONN_FAILED_ESTABLISHMENT: return "Conn Failed"; /* 0x3E */
|
||||
case HCI_ERR_MAC_CONNECTION_FAILED: return "Previously Used"; /* 0x3F */
|
||||
default: {
|
||||
static char buf[24];
|
||||
snprintf(buf, sizeof(buf), "Unknown Status (0x%02X)", status);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@@ -112,3 +112,5 @@ int hci_adv_credits_force_release(uint16_t num);
|
||||
#endif
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#endif /* _HCI_LAYER_H_ */
|
||||
|
||||
const char *hci_status_code_to_string(uint8_t status);
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "osi/hash_map.h"
|
||||
#include "osi/hash_functions.h"
|
||||
#include "common/bt_trace.h"
|
||||
|
||||
#include "esp_log.h"
|
||||
|
||||
#define APPLY_CONTINUATION_FLAG(handle) (((handle) & 0xCFFF) | 0x1000)
|
||||
#define APPLY_START_FLAG(handle) (((handle) & 0xCFFF) | 0x2000)
|
||||
@@ -173,7 +173,8 @@ static void reassemble_and_dispatch(BT_HDR *packet)
|
||||
partial_packet = (BT_HDR *)osi_calloc(full_length + sizeof(BT_HDR));
|
||||
|
||||
if (partial_packet == NULL) {
|
||||
HCI_TRACE_WARNING("%s full_length %d no memory.\n", __func__, full_length);
|
||||
HCI_TRACE_WARNING("%s full_length %d no memory, free=%d, largest_block=%d", __func__, full_length,
|
||||
heap_caps_get_free_size(MALLOC_CAP_DEFAULT), heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT));
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
@@ -2956,6 +2956,15 @@ uint8_t btm_ble_sec_dev_record_count(void)
|
||||
for (p_node = list_begin(btm_cb.p_sec_dev_rec_list); p_node; p_node = list_next(p_node)) {
|
||||
p_dev_rec = list_node(p_node);
|
||||
if (p_dev_rec && (p_dev_rec->sec_flags & BTM_SEC_IN_USE) && (p_dev_rec->ble.key_type != BTM_LE_KEY_NONE)) {
|
||||
BTM_TRACE_DEBUG("%s BLE security device #%d: bd_addr=%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
__func__,
|
||||
count,
|
||||
p_dev_rec->bd_addr[0],
|
||||
p_dev_rec->bd_addr[1],
|
||||
p_dev_rec->bd_addr[2],
|
||||
p_dev_rec->bd_addr[3],
|
||||
p_dev_rec->bd_addr[4],
|
||||
p_dev_rec->bd_addr[5]);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@@ -1390,6 +1390,12 @@ uint8_t btm_ble_ext_adv_active_count(void)
|
||||
|
||||
for (uint8_t i = 0; i < MAX_BLE_ADV_INSTANCE; i++) {
|
||||
if (adv_record[i].enabled == true) {
|
||||
BTM_TRACE_DEBUG("%s EXT ADV active #%d: instance=%d, duration=%d, max_events=%d",
|
||||
__func__,
|
||||
count,
|
||||
adv_record[i].instance,
|
||||
adv_record[i].duration,
|
||||
adv_record[i].max_events);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@@ -984,6 +984,10 @@ BOOLEAN btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC *p_dev_rec)
|
||||
*******************************************************************************/
|
||||
void btm_ble_resolving_list_remove_dev(tBTM_SEC_DEV_REC *p_dev_rec)
|
||||
{
|
||||
BTM_TRACE_EVENT ("%s - bd_addr=%02x:%02x:%02x:%02x:%02x:%02x", __func__,
|
||||
p_dev_rec->bd_addr[0], p_dev_rec->bd_addr[1], p_dev_rec->bd_addr[2],
|
||||
p_dev_rec->bd_addr[3], p_dev_rec->bd_addr[4], p_dev_rec->bd_addr[5]);
|
||||
|
||||
UINT8 rl_mask = btm_cb.ble_ctr_cb.rl_state;
|
||||
|
||||
BTM_TRACE_EVENT ("%s\n", __func__);
|
||||
|
@@ -335,7 +335,8 @@ tBTM_SEC_DEV_REC *btm_sec_alloc_dev (BD_ADDR bd_addr)
|
||||
BOOLEAN new_entry_found = FALSE;
|
||||
BOOLEAN old_entry_found = FALSE;
|
||||
BOOLEAN malloc_new_entry = FALSE;
|
||||
BTM_TRACE_EVENT ("btm_sec_alloc_dev\n");
|
||||
BTM_TRACE_EVENT ("btm_sec_alloc_dev - start alloc for device %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
bd_addr[0], bd_addr[1], bd_addr[2], bd_addr[3], bd_addr[4], bd_addr[5]);
|
||||
for (p_node = list_begin(btm_cb.p_sec_dev_rec_list); p_node; p_node = list_next(p_node)) {
|
||||
p_dev_old_rec = list_node(p_node);
|
||||
/* look for old entry which match the bd_addr and the BTM_SEC_IN_USE is cleared */
|
||||
@@ -691,6 +692,14 @@ tBTM_SEC_DEV_REC *btm_find_oldest_dev (void)
|
||||
old_ts = p_dev_rec->timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_oldest) {
|
||||
BTM_TRACE_EVENT("oldest paired device found: bd_addr=%02x:%02x:%02x:%02x:%02x:%02x, timestamp=%u",
|
||||
p_oldest->bd_addr[0], p_oldest->bd_addr[1], p_oldest->bd_addr[2],
|
||||
p_oldest->bd_addr[3], p_oldest->bd_addr[4], p_oldest->bd_addr[5],
|
||||
p_oldest->timestamp);
|
||||
}
|
||||
|
||||
return (p_oldest);
|
||||
}
|
||||
/*******************************************************************************
|
||||
|
@@ -136,6 +136,15 @@ uint8_t btm_ble_acl_active_count(void)
|
||||
for (p_node = list_begin(btm_cb.p_acl_db_list); p_node; p_node = list_next(p_node)) {
|
||||
p_acl_conn = list_node(p_node);
|
||||
if (p_acl_conn && p_acl_conn->in_use && p_acl_conn->transport == BT_TRANSPORT_LE) {
|
||||
BTM_TRACE_DEBUG("%s LE ACL active #%d: remote_addr=%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
__func__,
|
||||
count,
|
||||
p_acl_conn->remote_addr[0],
|
||||
p_acl_conn->remote_addr[1],
|
||||
p_acl_conn->remote_addr[2],
|
||||
p_acl_conn->remote_addr[3],
|
||||
p_acl_conn->remote_addr[4],
|
||||
p_acl_conn->remote_addr[5]);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@@ -1128,7 +1128,9 @@ static void btu_hcif_esco_connection_chg_evt (UINT8 *p)
|
||||
static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_len,
|
||||
void *p_cplt_cback)
|
||||
{
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
uint8_t status;
|
||||
#endif // (BLE_INCLUDED == TRUE)
|
||||
switch (opcode) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_INQUIRY_CANCEL:
|
||||
@@ -1395,10 +1397,6 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
if ((opcode & HCI_GRP_VENDOR_SPECIFIC) == HCI_GRP_VENDOR_SPECIFIC) {
|
||||
btm_vsc_complete (p, opcode, evt_len, (tBTM_CMPL_CB *)p_cplt_cback);
|
||||
}
|
||||
STREAM_TO_UINT8 (status, p);
|
||||
if(status != HCI_SUCCESS) {
|
||||
HCI_TRACE_ERROR("CC evt: op=0x%x, status=0x%x", opcode, status);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1421,6 +1419,10 @@ static void btu_hcif_command_complete_evt_on_task(BT_HDR *event)
|
||||
uint8_t *stream = hack->response->data + hack->response->offset + 3; // 2 to skip the event headers, 1 to skip the command credits
|
||||
STREAM_TO_UINT16(opcode, stream);
|
||||
|
||||
if (*stream != HCI_SUCCESS) {
|
||||
HCI_TRACE_WARNING("opcode=0x%04x, status= %02x: %s", opcode, *stream, hci_status_code_to_string(*stream));
|
||||
}
|
||||
|
||||
btu_hcif_hdl_command_complete(
|
||||
opcode,
|
||||
stream,
|
||||
@@ -1506,7 +1508,7 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
void *p_vsc_status_cback)
|
||||
{
|
||||
if (status != HCI_SUCCESS){
|
||||
HCI_TRACE_WARNING("%s,opcode:0x%04x,status:0x%02x", __func__, opcode,status);
|
||||
HCI_TRACE_WARNING("opcode=0x%04x, status= %02x: %s", opcode, status, hci_status_code_to_string(status));
|
||||
}
|
||||
BD_ADDR bd_addr;
|
||||
UINT16 handle;
|
||||
|
@@ -345,6 +345,15 @@ uint8_t l2cu_ble_plcb_active_count(void)
|
||||
for (p_node = list_begin(l2cb.p_lcb_pool); p_node; p_node = list_next(p_node)) {
|
||||
p_lcb = list_node(p_node);
|
||||
if (p_lcb && p_lcb->in_use && p_lcb->transport == BT_TRANSPORT_LE) {
|
||||
L2CAP_TRACE_DEBUG("%s LE PLCB active #%d: remote_addr=%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
__func__,
|
||||
active_count,
|
||||
p_lcb->remote_bd_addr[0],
|
||||
p_lcb->remote_bd_addr[1],
|
||||
p_lcb->remote_bd_addr[2],
|
||||
p_lcb->remote_bd_addr[3],
|
||||
p_lcb->remote_bd_addr[4],
|
||||
p_lcb->remote_bd_addr[5]);
|
||||
active_count ++;
|
||||
}
|
||||
}
|
||||
|
@@ -388,7 +388,7 @@ static const UINT8 smp_master_wait_dhk_check_table[][SMP_SM_NUM_COLS] = {
|
||||
|
||||
static const UINT8 smp_master_dhk_check_table[][SMP_SM_NUM_COLS] = {
|
||||
/* Event Action Next State */
|
||||
/* locally calculated peer dhkey check is ready -> compare it withs DHKey Check actually received from peer */
|
||||
/* locally calculated peer dhkey check is ready -> compare it with DHKey Check actually received from peer */
|
||||
/* SC_KEY_READY */{SMP_MATCH_DHKEY_CHECKS, SMP_SM_NO_ACTION, SMP_STATE_DHK_CHECK},
|
||||
/* locally calculated peer dhkey check is ready -> calculate STK, go to sending */
|
||||
/* HCI LE Start Encryption command */
|
||||
@@ -580,7 +580,7 @@ static const UINT8 smp_slave_wait_dhk_check_table[][SMP_SM_NUM_COLS] = {
|
||||
static const UINT8 smp_slave_dhk_check_table[][SMP_SM_NUM_COLS] = {
|
||||
/* Event Action Next State */
|
||||
|
||||
/* locally calculated peer dhkey check is ready -> compare it withs DHKey Check */
|
||||
/* locally calculated peer dhkey check is ready -> compare it with DHKey Check */
|
||||
/* actually received from peer */
|
||||
/* SC_KEY_READY */{SMP_MATCH_DHKEY_CHECKS, SMP_SM_NO_ACTION, SMP_STATE_DHK_CHECK},
|
||||
|
||||
@@ -771,6 +771,8 @@ void smp_sm_event(tSMP_CB *p_cb, tSMP_EVENT event, void *p_data)
|
||||
/* execute action functions */
|
||||
for (i = 0; i < SMP_NUM_ACTIONS; i++) {
|
||||
if ((action = state_table[entry - 1][i]) != SMP_SM_NO_ACTION && smp_sm_action[action] != NULL) {
|
||||
SMP_TRACE_DEBUG("smp action %d for state %s, event %s",
|
||||
action, smp_get_state_name(curr_state), smp_get_event_name(event));
|
||||
(*smp_sm_action[action])(p_cb, (tSMP_INT_DATA *)p_data);
|
||||
} else {
|
||||
break;
|
||||
|
Reference in New Issue
Block a user