sco.c

来自「蓝牙HANDFREE软件源代码」· C语言 代码 · 共 57 行

C
57
字号
#include "handsfree_private.h"
#include "handsfree.h"


#include <message.h>
#include <audio.h>
#include <vm.h>


/*
    createSCO

    Request to open a SCO connection
*/
void createSCO(uint16 pkt_type)
{
    MAKE_MSG(HANDSFREE_SCO_CREATE_REQ);
    msg->packet_type = pkt_type;
    putMsg(msg);       
}


/*
    hfScoStatusInd

    Called by the headset framework to indicate that a SCO (voice)
    connection has been either created or destroyed by the Audio
    Gateway.
*/
void hfScoStatusInd(const HS_SCO_STATUS_IND_T * ind)
{
    if (AudioStop(HFstate.AudioRingHandle))
        HFstate.AudioRingHandle = 0;

    /* When establishing or tearing down SCO unmute the mic */
    if (HFstate.microphoneMute)
        hfToggleMuteMicAction();

    if (ind->status == CmConnectComplete)
    {
        /* SCO connect succeeded */
        setLocalState(scoConnected);

        /* Send initial volume once there's a call up */         
        hfSendInitialVolume();
    }
    else if (ind->status != CmConnectFailed)
    {

        /* SCO disconnected, if the connect attempt failed then 
           the current connect state has not changed
        */
        setLocalState(connected);

    }
}

⌨️ 快捷键说明

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