a2dp_sd_suspend.c

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

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

FILE NAME
    a2dp_sd_suspend.c

DESCRIPTION 

NOTES
    
*/


/****************************************************************************
    Header files
*/
#include "a2dp_sd_private.h"
#include "a2dp_sd_suspend.h"
#include "a2dp_sd_kalimba.h"


static void handleSuspend(const a2dpSourceDongleTaskData *theApp)
{
    /* Update the local state to show we're no longer streaming */
    avSourceDongleUpdateA2dpState(a2dp_state_connected);
        
    /* Stop the DSP */
    a2dpSdKalimbaStop(theApp);
}


/****************************************************************************
NAME    
    a2dpSdHandleSuspendCfm
    
DESCRIPTION
    Handle a suspend cfm message from the A2DP lib.

RETURNS
    void
*/
void a2dpSdHandleSuspendCfm(const a2dpSourceDongleTaskData *theApp, const A2DP_SUSPEND_CFM_T *cfm)
{
    /* Suspend is an optional signal so we only stop the DSP if the sink supports it. */
    if (cfm->result == a2dp_success)
        handleSuspend(theApp);
}


/****************************************************************************
NAME    
    a2dpSdHandleSuspendInd
    
DESCRIPTION
    The sink has suspended the connection.

RETURNS
    void
*/
void a2dpSdHandleSuspendInd(const a2dpSourceDongleTaskData *theApp)
{
	/* Cancel any stream request messages */
	(void) MessageCancelAll(getTheAppTask(), APP_START_STREAMING_REQ);

    /* Suspend the DSP */
    handleSuspend(theApp);
}

/****************************************************************************
NAME    
    a2dpSdSuspendRequest
    
DESCRIPTION
    Request to suspend streaming to the remote end.

RETURNS
    
*/
void a2dpSdSuspendRequest(const a2dpSourceDongleTaskData *theApp)
{
    a2dpSdHandleSuspendInd(theApp);
}

⌨️ 快捷键说明

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