a2dp_sd_start.c

来自「实现蓝牙 立体声传送」· C语言 代码 · 共 69 行

C
69
字号
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004-2006
Part of BlueLab 3.6.2-release

FILE NAME
    a2dp_sd_start.c

DESCRIPTION 

NOTES
    
*/


/****************************************************************************
    Header files
*/
#include "a2dp_sd_private.h"
#include "a2dp_sd_start.h"


/****************************************************************************
NAME    
    a2dpSdHandleStartCfm
    
DESCRIPTION
    Handle the start cfm received from the A2DP lib.

RETURNS
    void
*/
void a2dpSdHandleStartCfm(a2dpSourceDongleTaskData *theApp, const A2DP_START_CFM_T *cfm)
{
    if (theApp->discover_pending)
    {
        /* Button press pending, close the link so we can discover a new device */
        MessageSend(&theApp->task, APP_CLOSE_REQ, 0);
    }
    else if (cfm->result == a2dp_success)
    {
        /* Start streaming audio */
        MessageSend(&theApp->task, APP_START_STREAMING_REQ, 0);
    }
    else
    {
        /* Start failed, disconnect */
        MessageSend(&theApp->task, APP_CLOSE_REQ, 0);
    }
}


/****************************************************************************
NAME    
    a2dpSdHandleStartInd
    
DESCRIPTION
    The remote end has requested we start streaming.

RETURNS
    void
*/
void a2dpSdHandleStartInd(a2dpSourceDongleTaskData *theApp)
{
	/* Cancel any suspend request messages */
	(void) MessageCancelAll(getTheAppTask(), APP_SUSPEND_STREAMING_REQ);
    /* Start streaming audio */
    MessageSend(&theApp->task, APP_START_STREAMING_REQ, 0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?