mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(bt/example): Add log in the failure path for avrcp_ct_metadata example
This commit is contained in:
@@ -154,8 +154,10 @@ static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t
|
|||||||
{
|
{
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_AVRC_CT_METADATA_RSP_EVT: {
|
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),
|
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);
|
bt_avrc_common_copy_metadata, bt_avrc_common_free_metadata)) {
|
||||||
|
ESP_LOGE(BT_RC_CT_TAG, "CT event %d dispatch failed", event);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_CT_CONNECTION_STATE_EVT:
|
case ESP_AVRC_CT_CONNECTION_STATE_EVT:
|
||||||
@@ -164,7 +166,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_REMOTE_FEATURES_EVT:
|
||||||
case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT:
|
case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT:
|
||||||
case ESP_AVRC_CT_PROF_STATE_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;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(BT_RC_CT_TAG, "Invalid AVRC event: %d", event);
|
ESP_LOGE(BT_RC_CT_TAG, "Invalid AVRC event: %d", event);
|
||||||
@@ -182,7 +186,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_REGISTER_NOTIFICATION_EVT:
|
||||||
case ESP_AVRC_TG_SET_PLAYER_APP_VALUE_EVT:
|
case ESP_AVRC_TG_SET_PLAYER_APP_VALUE_EVT:
|
||||||
case ESP_AVRC_TG_PROF_STATE_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;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(BT_RC_TG_TAG, "Invalid AVRC event: %d", event);
|
ESP_LOGE(BT_RC_TG_TAG, "Invalid AVRC event: %d", event);
|
||||||
|
|||||||
@@ -7,8 +7,11 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
#include "esp_system.h"
|
||||||
|
|
||||||
#include "freertos/FreeRTOSConfig.h"
|
#include "freertos/FreeRTOSConfig.h"
|
||||||
#include "freertos/FreeRTOS.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)
|
static bool bt_app_send_msg(bt_app_msg_t *msg)
|
||||||
{
|
{
|
||||||
if (msg == NULL || s_bt_app_task_queue == NULL) {
|
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;
|
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;
|
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;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user