#include <string.h>
#include "hardware/bt_av.h"
-#define LOG_TAG "BTIF_AV"
+#define LOG_TAG "bt_btif_av"
#include "btif_av.h"
#include "btif_util.h"
#include "btif_media.h"
#include "bta_av_api.h"
#include "gki.h"
-#include "bd.h"
#include "btu.h"
#include "bt_utils.h"
case BTA_AV_VENDOR_CMD_EVT: \
case BTA_AV_META_MSG_EVT: \
case BTA_AV_RC_FEAT_EVT: \
+ case BTA_AV_REMOTE_RSP_EVT: \
{ \
btif_rc_handler(e, d);\
}break; \
case BTA_AV_VENDOR_CMD_EVT:
case BTA_AV_META_MSG_EVT:
case BTA_AV_RC_FEAT_EVT:
+ case BTA_AV_REMOTE_RSP_EVT:
btif_rc_handler(event, (tBTA_AV*)p_data);
break;
{
if (btif_av_cb.sm_handle == NULL)
{
- if (btif_a2dp_start_media_task() != GKI_SUCCESS)
+ if (!btif_a2dp_start_media_task())
return BT_STATUS_FAIL;
- btif_enable_service(BTA_A2DP_SERVICE_ID);
+ btif_enable_service(BTA_A2DP_SOURCE_SERVICE_ID);
+#if (BTA_AV_SINK_INCLUDED == TRUE)
+ btif_enable_service(BTA_A2DP_SINK_SERVICE_ID);
+#endif
/* Also initialize the AV state machine */
- btif_av_cb.sm_handle = btif_sm_init((const btif_sm_handler_t*)btif_av_state_handlers, BTIF_AV_STATE_IDLE);
+ btif_av_cb.sm_handle =
+ btif_sm_init((const btif_sm_handler_t*)btif_av_state_handlers, BTIF_AV_STATE_IDLE);
btif_a2dp_on_init();
if (status == BT_STATUS_SUCCESS) {
bt_av_sink_callbacks = callbacks;
- BTA_AvEnable_Sink(TRUE);
}
return status;
btif_a2dp_stop_media_task();
- btif_disable_service(BTA_A2DP_SERVICE_ID);
+ btif_disable_service(BTA_A2DP_SOURCE_SERVICE_ID);
+#if (BTA_AV_SINK_INCLUDED == TRUE)
+ btif_disable_service(BTA_A2DP_SINK_SERVICE_ID);
+#endif
/* Also shut down the AV state machine */
btif_sm_shutdown(btif_av_cb.sm_handle);
/*******************************************************************************
**
+** Function btif_av_sink_execute_service
+**
+** Description Initializes/Shuts down the service
+**
+** Returns BT_STATUS_SUCCESS on success, BT_STATUS_FAIL otherwise
+**
+*******************************************************************************/
+bt_status_t btif_av_sink_execute_service(BOOLEAN b_enable)
+{
+#if (BTA_AV_SINK_INCLUDED == TRUE)
+ BTA_AvEnable_Sink(b_enable);
+#endif
+ return BT_STATUS_SUCCESS;
+}
+
+/*******************************************************************************
+**
** Function btif_av_get_src_interface
**
** Description Get the AV callback interface for A2DP source profile