Merge branch 'bugfix/idf_ci_example_avrcp_v6.1' into 'release/v6.1'

fix(bt/example): Add log in the failure path for avrcp_ct_metadata example (v6.1)

See merge request espressif/esp-idf!51058
This commit is contained in:
Wang Meng Yang
2026-08-27 17:43:46 +08:00
2 changed files with 19 additions and 4 deletions

View File

@@ -183,8 +183,10 @@ static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t
{
switch (event) {
case ESP_AVRC_CT_METADATA_RSP_EVT: {
bt_app_work_dispatch(bt_app_avrc_ct_evt_hdl, event, param, sizeof(esp_avrc_ct_cb_param_t),
bt_avrc_common_copy_metadata, bt_avrc_common_free_metadata);
if (!bt_app_work_dispatch(bt_app_avrc_ct_evt_hdl, event, param, sizeof(esp_avrc_ct_cb_param_t),
bt_avrc_common_copy_metadata, bt_avrc_common_free_metadata)) {
ESP_LOGE(BT_RC_CT_TAG, "CT event %d dispatch failed", event);
}
break;
}
case ESP_AVRC_CT_CONNECTION_STATE_EVT:
@@ -193,7 +195,9 @@ static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t
case ESP_AVRC_CT_REMOTE_FEATURES_EVT:
case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT:
case ESP_AVRC_CT_PROF_STATE_EVT:
bt_app_work_dispatch(bt_app_avrc_ct_evt_hdl, event, param, sizeof(esp_avrc_ct_cb_param_t), NULL, NULL);
if (!bt_app_work_dispatch(bt_app_avrc_ct_evt_hdl, event, param, sizeof(esp_avrc_ct_cb_param_t), NULL, NULL)) {
ESP_LOGE(BT_RC_CT_TAG, "CT event %d dispatch failed", event);
}
break;
default:
ESP_LOGE(BT_RC_CT_TAG, "Invalid AVRC event: %d", event);
@@ -211,7 +215,9 @@ static void bt_app_rc_tg_cb(esp_avrc_tg_cb_event_t event, esp_avrc_tg_cb_param_t
case ESP_AVRC_TG_REGISTER_NOTIFICATION_EVT:
case ESP_AVRC_TG_SET_PLAYER_APP_VALUE_EVT:
case ESP_AVRC_TG_PROF_STATE_EVT:
bt_app_work_dispatch(bt_avrc_common_tg_evt_def_hdl, event, param, sizeof(esp_avrc_tg_cb_param_t), NULL, NULL);
if (!bt_app_work_dispatch(bt_avrc_common_tg_evt_def_hdl, event, param, sizeof(esp_avrc_tg_cb_param_t), NULL, NULL)) {
ESP_LOGE(BT_RC_TG_TAG, "TG event %d dispatch failed", event);
}
break;
default:
ESP_LOGE(BT_RC_TG_TAG, "Invalid AVRC event: %d", event);

View File

@@ -7,8 +7,11 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <inttypes.h>
#include <stdlib.h>
#include "esp_log.h"
#include "esp_system.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
@@ -45,6 +48,7 @@ static TaskHandle_t s_bt_app_task_handle = NULL; /* handle of application task
static bool bt_app_send_msg(bt_app_msg_t *msg)
{
if (msg == NULL || s_bt_app_task_queue == NULL) {
ESP_LOGE(BT_APP_CORE_TAG, "%s failed: msg=%p, queue=%p", __func__, msg, s_bt_app_task_queue);
return false;
}
@@ -126,6 +130,11 @@ bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, i
}
return true;
}
ESP_LOGE(BT_APP_CORE_TAG, "%s malloc failed, event: 0x%x, param_len: %d, free_heap: %" PRIu32,
__func__, event, param_len, esp_get_free_heap_size());
} else {
ESP_LOGE(BT_APP_CORE_TAG, "%s invalid args, event: 0x%x, p_params: %p, param_len: %d",
__func__, event, p_params, param_len);
}
return false;