亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? headset_callmanager.c

?? bluelab的一個很好的例程
?? C
字號:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2005

FILE NAME
    headset_callmanager.h      

DESCRIPTION
    This is the call manager for BC4-Headset
    

NOTES

*/
#include "headset_callmanager.h"
#include "headset_statemanager.h"
#include "headset_soundmanager.h"

#define DEFAULT_HSP_SEND_ACTIVE_CALL_SECS (6) 

#include "headset_private.h"

#include <connection.h>
#include <hfp.h>


static void headsetQueueEvent ( hsTaskData * pApp , headsetEvents_t pEvent) ;

#ifdef DEBUG_CALL_MAN
    #define CM_DEBUG(x) DEBUG(x)
#else
    #define CM_DEBUG(x) 
#endif


void headsetHandleCallSetupInd ( hsTaskData *pApp,  const HFP_CALL_SETUP_IND_T * pInd )  
{
    
    switch (pInd->call_setup)
    {
    case (hfp_no_call_setup): /*!< No call currently being established.*/

        	/* Spec says that this is a clear indicationn  that an incominc call has been interrupted
        	   and we can assume that the call is not going to continue....*/          
            if (stateManagerIsConnected() )
            {
                stateManagerEnterConnectedState ( pApp ) ;
            }
            /* However, we have come across phones that send this before a callind [1]
               on accepting a call - -interop issue*/
        break;
    case (hfp_incoming_call_setup): /*!< HFP device currently ringing.*/
            stateManagerEnterIncomingCallEstablishState ( pApp ) ;
        break;
    case (hfp_outgoing_call_setup): /*!< Call currently being dialed.*/
    case (hfp_outgoing_call_alerting_setup):/*!< Remote end currently ringing.*/
            stateManagerEnterOutgoingCallEstablishState ( pApp ) ;
        break;
    default:
        CM_DEBUG(("CM : ?cs[%d]\n",pInd->call_setup)) ;
        break;
        
    }
}

void headsetHandleCallInd ( hsTaskData *pApp,  const HFP_CALL_IND_T * pInd ) 
{
    
    switch (pInd->call)
    {
    case 0:
            if (stateManagerIsConnected() )
            {
                stateManagerEnterConnectedState ( pApp ) ;
            }    
      break ;
    case 1:
            stateManagerEnterActiveCallState ( pApp ) ;
        break;
        default:
        CM_DEBUG(("CM : ?ci[%d]\n",pInd->call)) ;
    break;
    }
}


/****************************************************************************
NAME    
    hfpHeadsetHandleRingInd
    
DESCRIPTION
    Received a RING indication from the AG.

RETURNS
    void
*/
void headsetHandleRingInd(hsTaskData *pApp, const HFP_RING_IND_T * pInd)
{
    pInd = pInd;
    
    /* If in HSP mode use rings as indication of incoming call */
    if ((pApp->profile_connected == hfp_headset_profile) && (stateManagerIsConnected() ))
    {        
        stateManagerEnterIncomingCallEstablishState ( pApp ) ;
            /*sends a message indicating that we have now entered incoming call state*/        
        MessageSendLater ( &pApp->task , 
                           EventHSPEnterActiveCallState , 
                           0 , 
                           D_SEC(DEFAULT_HSP_SEND_ACTIVE_CALL_SECS) ) ;
    }
    
    if ( ! pApp->RingInfo.InBandRingEnabled )
    {
        soundManagerOutOfBandRing ( pApp ) ;
    }    
    
}

/****************************************************************************
NAME    
    headsetAnswerCall
    
DESCRIPTION
    Answer an incoming call from the headset

RETURNS
    void
*/
void headsetAnswerCall(const hsTaskData *pApp)
{
    /* 
        Call the HFP lib function, this will determine the AT cmd to send
        depending on whether the profile instance is HSP or HFP compliant.
    */ 
    
    if ( pApp->profile_connected == hfp_handsfree_profile )
    {
        HfpAnswerCall(pApp->hfp);
    }
    else
    {
        HfpSendHsButtonPress ( pApp->hsp ) ;
    }
    
    
}


/****************************************************************************
NAME    
    headsetHandleAnswerCallCfm
    
DESCRIPTION
    Cfm from the HFP lib telling us whether the answer call response was
    accepted by the AG or not.

RETURNS
    void
*/

void headsetHandleAnswerCallCfm(hsTaskData *pApp, HFP_ANSWER_CALL_CFM_T * pInd)
{
        /*if an answer call confirm arrivves - then we have established a call
    stateManagerEnterActiveCallState ( pApp ) ;*/
    
     CM_DEBUG(("CM: Answer call cfm\n")) ;  
    pApp = pApp ;
    pInd = pInd ;
}

/****************************************************************************
NAME    
    headsetRejectCall
    
DESCRIPTION
    Reject an incoming/ outgoing call from the headset

RETURNS
    void
*/
void headsetRejectCall(const hsTaskData *pApp)
{
    /* 
        Reject incoming call - only valid for instances of HFP in HSP mode
        send a button press.
    */
    if ( pApp->profile_connected == hfp_handsfree_profile )
    {
        HfpRejectCall(pApp->hfp);
    }
    else
    {
        HfpSendHsButtonPress ( pApp->hsp ) ;
    }
    
}


/****************************************************************************
NAME    
    headsetHandleRejectCallCfm
    
DESCRIPTION
    Cfm from the HFP lib telling us whether the reject call response was
    accepted by the AG or not.

RETURNS
    void
*/
void headsetHandleRejectCallCfm(hsTaskData *pApp, const HFP_REJECT_CALL_CFM_T *pCfm)
{
    pApp = pApp ;
    pCfm = pCfm ;
}


/****************************************************************************
NAME    
    hfpHeadsetHangUpCall
    
DESCRIPTION
    Hang up the call from the headset.

RETURNS
    void
*/
void headsetHangUpCall(const hsTaskData *pApp)
{
    /* Terminate the current ongoing call process */
    if ( pApp->profile_connected == hfp_handsfree_profile )
    {
        HfpTerminateCall(pApp->hfp);
    }
    else
    {
        HfpSendHsButtonPress ( pApp->hsp ) ;
    }    
}


/****************************************************************************
NAME    
    headsetHandleTerminateCallCfm
    
DESCRIPTION
    Cfm from the HFP lib telling us whether the hang up call response was 
    accepted  by the AG or not.

RETURNS
    void
*/
void headsetHandleTerminateCallCfm( hsTaskData *pApp, const HFP_TERMINATE_CALL_CFM_T *pCfm)
{
    pApp = pApp;
    pCfm = pCfm;
}


/****************************************************************************
NAME    
    headsetTransferAudio
    
DESCRIPTION
    If the audio is at the headset end transfer it back to the AG and
    vice versa.

RETURNS
    void
*/
void headsetTransferToggle(hsTaskData *pApp)
{
    hfp_audio_transfer_direction lTransferDirection = hfp_audio_to_ag ;

    
      /* Call the audio transfer function in the HFP lib */
      /* Transfer the audio to/ from the AG */ 
    if (!pApp->sco_sink)
    {
        lTransferDirection = hfp_audio_to_hfp ;
    }
    else
    {
        lTransferDirection = hfp_audio_to_ag ;
    }
    
    if ( pApp->profile_connected == hfp_handsfree_profile )
    {
        HfpAudioTransferConnection(pApp->hfp, lTransferDirection, audioGetSupportedPacketTypes( pApp ), 0 );
    }
    else
    { 
        /*this has been removed as a button press will cause the AG to hang up the call */
        /*HfpSendHsButtonPress ( pApp->hsp ) ;*/
    }

}


/****************************************************************************
NAME    
    headsetInitiateVoiceDial
    
DESCRIPTION
    If HFP and connected - issues command
    If HFP and not connected - connects and issues if not in call
    If HSP sends button press

RETURNS
    void
*/
void headsetInitiateLNR ( hsTaskData * pApp )
{

    CM_DEBUG(("CM: LNR\n")) ;

    if (!stateManagerIsConnected() )
    {
        MessageSend ( &pApp->task , EventEstablishSLC , 0 ) ;
        headsetQueueEvent(pApp , EventLastNumberRedial) ;
    }
    else
    {
        
        CM_DEBUG(("CM: LNR Connected\n")) ;
    
        if ( pApp->profile_connected == hfp_handsfree_profile )
        {
            HfpLastNumberRedial( pApp->hfp );    
        }
        else
        {
            HfpSendHsButtonPress ( pApp->hsp ) ;
        }
    }    
}


/****************************************************************************
NAME    
    headsetInitiateLNR
    
DESCRIPTION
    If HFP and connected - issues command
    If HFP and not connected - connects and issues if not in call
    If HSP sends button press

RETURNS
    void
*/
void headsetInitiateVoiceDial ( hsTaskData* pApp )
{
    CM_DEBUG(("CM: VD\n")) ;
    if (!stateManagerIsConnected() )
    {
        MessageSend ( &pApp->task , EventEstablishSLC , 0 ) ;
        headsetQueueEvent( pApp , EventInitateVoiceDial ) ;
        
        pApp->VoiceRecognitionIsActive = FALSE ;
    }
    else
    {
    
    CM_DEBUG(("CM: VD Connected\n")) ;
    
        if ( pApp->profile_connected == hfp_handsfree_profile )
        {
            if (pApp->supp_features_local & HFP_VOICE_RECOGNITION ) 
            {
                HfpVoiceRecognitionEnable(pApp->hfp, TRUE);    
                
                pApp->VoiceRecognitionIsActive = TRUE ;
            }
        }
        else
        {
            HfpSendHsButtonPress ( pApp->hsp ) ;
        }	    
    }    
    		    
}
/****************************************************************************
NAME    
    headsetInitiateLNR
    
DESCRIPTION
    cancels a voice dial request
   
RETURNS
    void
*/
void headsetCancelVoiceDial ( hsTaskData * pApp)
{
    if ( pApp->profile_connected == hfp_handsfree_profile )
    {
            /*if we support voice dialing*/
        if (pApp->supp_features_local & HFP_VOICE_RECOGNITION ) 
        {
                /*if we believe voice dial is currently active*/
            if ( pApp->VoiceRecognitionIsActive)
            {
                HfpVoiceRecognitionEnable(pApp->hfp, FALSE);    
                
                pApp->VoiceRecognitionIsActive = FALSE ;
            }
        }
    }
}

headsetEvents_t gMessageQueued = EventInvalid ;

/****************************************************************************
NAME    
    headsetQueueEvent
    
DESCRIPTION
    Queues an event to be sent once the headset is connected

RETURNS
    void
*/
static void headsetQueueEvent ( hsTaskData * pApp , headsetEvents_t pEvent)
{
    CM_DEBUG(("CM: QQ Ev[%x]\n", pEvent)) ;
    gMessageQueued = pEvent ;
}

/****************************************************************************
NAME    
    headsetRecallQueuedEvent
    
DESCRIPTION
    Checks to see if an event was Queued and issues it

RETURNS
    void
*/
void headsetRecallQueuedEvent ( hsTaskData * pApp )
{
        /*this is currently only applicable to  LNR and voice Dial but does not care */
    if (gMessageQueued != EventInvalid)
    {
        switch (stateManagerGetState() )
        {
            case headsetIncomingCallEstablish:
            case headsetOutgoingCallEstablish:
            case headsetActiveCall:       
            case headsetThreeWayCallWaiting:
            case headsetThreeWayCallOnHold:
            case headsetThreeWayMulticall:
                /* Do Nothing Message Gets ignored*/
            break ;
            default:
                if ( pApp->profile_connected == hfp_handsfree_profile )
                {
                    MessageSend ( &pApp->task , gMessageQueued , 0 ) ; 
                
                    CM_DEBUG(("CM: Queued Message ? [%x] Sent\n" , gMessageQueued))    
                }
                else
                {
                    HfpSendHsButtonPress ( pApp->hsp ) ;
                    CM_DEBUG(("CM: Queued Msg - HSP Butt Sent\n"))    
                } 
            break;
        }
    }    
    
        /*reset the queued event*/
    gMessageQueued = EventInvalid ;
}


void headsetClearQueueudEvent ( hsTaskData * pApp )
{
        /*this resets the queue - on a conenction fail / power off etc*/
    gMessageQueued = EventInvalid ;
}


/****************************************************************************
NAME    
    headsethandleResponseHoldInd
    
DESCRIPTION
    Handles a response and hold indication

RETURNS
    void
*/
void headsethandleResponseHoldInd ( hsTaskData * pApp, HFP_RESPONSE_HOLD_STATUS_IND_T * pInd ) 
{
    CM_DEBUG(("CM: Res/Hold.Ind[%d]\n", pInd->state)) ;
    switch ( pInd->state )
    {
    case hfp_incoming_call_held:
        stateManagerEnterIncomingCallOnHoldState ( pApp ) ;
    break ;
    case hfp_held_call_rejected:                
        stateManagerEnterConnectedState ( pApp ) ;
    break ;
    case hfp_held_call_accepted:
        stateManagerEnterActiveCallState ( pApp ) ;
    break ;
    
    default:
    break ;
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91官网在线免费观看| 亚洲一区二区三区影院| 欧美日韩一区国产| 色婷婷综合五月| 色诱视频网站一区| 91麻豆福利精品推荐| a级精品国产片在线观看| 北条麻妃一区二区三区| 一本大道久久精品懂色aⅴ| aa级大片欧美| 欧美日韩黄色影视| 日韩一卡二卡三卡国产欧美| 精品国产精品一区二区夜夜嗨| 日韩精品一区二区三区在线观看| 欧美精品一区二区三区在线| 国产日本一区二区| 亚洲欧美另类图片小说| 视频一区视频二区在线观看| 美女免费视频一区| 成人h动漫精品| 91国内精品野花午夜精品 | 激情小说欧美图片| 国产一区二区三区四区五区入口| 懂色av一区二区夜夜嗨| 色婷婷久久久久swag精品| 欧美丰满高潮xxxx喷水动漫| 欧美精品一区二区高清在线观看| 国产三级欧美三级日产三级99| 国产精品免费久久| 日韩精品乱码免费| 国产精品1024| 欧美久久高跟鞋激| 亚洲国产精品成人综合色在线婷婷| 亚洲免费观看视频| 老司机免费视频一区二区三区| 成人免费视频一区| 在线不卡a资源高清| 国产精品麻豆一区二区| 日韩精品乱码av一区二区| 成人三级在线视频| 欧美电影免费观看高清完整版在线 | 国产欧美日韩在线观看| 亚洲国产精品视频| 国产91丝袜在线播放九色| 欧美亚洲禁片免费| 国产精品美女视频| 老司机精品视频导航| 欧美视频在线一区二区三区| 国产欧美视频在线观看| 久久99精品久久久久久国产越南| 91久久国产最好的精华液| 久久综合久久综合九色| 丝袜亚洲精品中文字幕一区| av激情亚洲男人天堂| 精品福利一区二区三区| 日韩成人一级大片| 精品视频色一区| 亚洲青青青在线视频| 国产成人午夜视频| 欧美电视剧在线看免费| 五月综合激情婷婷六月色窝| 日本丰满少妇一区二区三区| 中文字幕 久热精品 视频在线| 国产主播一区二区| 日韩免费福利电影在线观看| 日韩一区精品字幕| 欧美群妇大交群中文字幕| 一区二区三区免费网站| 在线视频亚洲一区| 亚洲免费观看高清完整版在线| 高清不卡在线观看av| 国产清纯在线一区二区www| 久久99热狠狠色一区二区| 91精品黄色片免费大全| 日韩高清欧美激情| 日韩一级成人av| 麻豆传媒一区二区三区| 91精品国产综合久久精品性色 | 亚洲综合一区二区精品导航| www.日韩精品| 亚洲日本韩国一区| 色婷婷亚洲综合| 亚洲h动漫在线| 91精品久久久久久久久99蜜臂| 日韩电影一区二区三区四区| 日韩一级高清毛片| 国产精品综合一区二区三区| 国产欧美日韩在线看| 91丝袜美女网| 亚洲福利视频导航| 日韩欧美国产精品| 懂色中文一区二区在线播放| 国产精品久久久久久久久免费相片 | 91丨porny丨国产入口| 伊人一区二区三区| 欧美一区二区在线视频| 久久精品国产网站| 国产精品国产三级国产有无不卡| 色综合久久天天| 奇米综合一区二区三区精品视频| 久久夜色精品国产欧美乱极品| 成人激情免费视频| 亚洲成人资源网| 2020国产成人综合网| 91麻豆视频网站| 琪琪久久久久日韩精品| 综合久久久久久| 日韩一级二级三级精品视频| 91丨九色丨蝌蚪富婆spa| 奇米在线7777在线精品| 国产精品久久毛片av大全日韩| 欧美日韩精品一区二区三区蜜桃| 国产在线不卡视频| 亚洲最大的成人av| 国产视频一区二区在线| 欧美日韩精品免费观看视频| 成人在线视频一区二区| 蜜桃久久av一区| 亚洲小说欧美激情另类| 中文字幕制服丝袜成人av| 日韩欧美一级片| 91国模大尺度私拍在线视频| 国产成人精品午夜视频免费| 午夜电影一区二区三区| 亚洲日本va午夜在线影院| 欧美一区二区福利在线| 色婷婷av一区二区三区大白胸| 国产成人精品亚洲午夜麻豆| 久久国产精品99久久人人澡| 亚洲国产日日夜夜| 综合婷婷亚洲小说| 国产精品私房写真福利视频| 日韩精品一区在线| 欧美一区二区视频免费观看| 在线观看一区二区视频| 91在线观看一区二区| 国产成人亚洲综合色影视| 蜜桃精品视频在线| 日韩国产欧美三级| 五月天激情综合| 婷婷综合久久一区二区三区| 有坂深雪av一区二区精品| 综合自拍亚洲综合图不卡区| 中文一区在线播放| 国产农村妇女毛片精品久久麻豆 | 国产精品系列在线| 国产亚洲婷婷免费| 亚洲精品在线免费观看视频| 日韩欧美一级二级三级久久久| 欧美久久久影院| 欧美一区日韩一区| 日韩亚洲欧美成人一区| 日韩一区二区精品| 欧美成人性战久久| 26uuu精品一区二区| 久久久久久夜精品精品免费| 精品人伦一区二区色婷婷| 日韩欧美成人一区二区| 欧美大黄免费观看| 精品国产乱码久久久久久浪潮| 26uuu欧美日本| 国产精品嫩草久久久久| 亚洲三级小视频| 亚洲va欧美va国产va天堂影院| 一区二区高清免费观看影视大全| 午夜国产精品一区| 久久99精品网久久| 成人h动漫精品一区二区| 91成人免费网站| 欧美日韩国产免费一区二区| 日韩一区二区三区在线| 中文字幕一区二区三区在线不卡| 日本一区二区三级电影在线观看| 日韩美女视频一区二区| 亚洲国产精品久久一线不卡| 伦理电影国产精品| 99热国产精品| 欧美一区二区久久| 国产精品三级久久久久三级| 亚洲网友自拍偷拍| 久久精品久久99精品久久| 成人午夜在线播放| 欧美午夜一区二区三区| 精品久久久久久无| 亚洲精品视频一区二区| 男人的j进女人的j一区| 波多野结衣在线一区| 欧美精品久久一区二区三区| 久久精品人人爽人人爽| 亚洲小少妇裸体bbw| 国产一区二区不卡| 欧美午夜不卡视频| 日本一区二区视频在线| 天天色天天操综合| 99精品桃花视频在线观看| 51午夜精品国产| 国产精品美女一区二区在线观看| 美腿丝袜一区二区三区| 欧美性大战久久久久久久| 国产亚洲精品资源在线26u|