⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sco.c

📁 蓝牙HANDFREE软件源代码
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -