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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

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

FILE NAME
    main.c        

DESCRIPTION
    This is main file for the headset application software for BC4-Headset

NOTES

*/


/****************************************************************************
    Header files
*/
#include "headset_private.h"
#include "headset_init.h"
#include "headset_auth.h"
#include "headset_scan.h"
#include "headset_slc.h" 
#include "headset_dut.h" 
 
#include "headset_LEDmanager.h"
#include "headset_buttonmanager.h"
#include "headset_configmanager.h"
#include "headset_events.h"
#include "headset_statemanager.h"
#include "headset_soundmanager.h"
#include "headset_powermanager.h"
#include "headset_callmanager.h"

#include "headset_threewaycall.h"


#ifdef TEST_HARNESS
#include "test_headset.h"
#endif

#include <bdaddr.h>
#include <connection.h>
#include <panic.h>
#include <ps.h>
#include <pio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stream.h>



#ifdef DEBUG_MAIN
#define MAIN_DEBUG(x) DEBUG(x)

#define TRUE_OR_FALSE(x)  ((x) ? 'T':'F')

#else
#define MAIN_DEBUG(x) 
#endif

/* Single instance of AV Headset state */
static hsTaskData theHeadset;

#define POWER_OFF_DISABLE_TIME_SECS (20)

typedef enum MessageTypeTag
{
    
    MSGTYPE_UNKNOWN = 0,    
    MSGTYPE_HFP, /*message From the HFP*/
    MSGTYPE_CL , /*message from the CL*/   
    MSGTYPE_UE , /*massge from a User event*/       
    MSGTYPE_HS   /*message from the Headset (Internal)*/
    
}messageType_t ;

static messageType_t headsetGetMessageType (MessageId pMsg ) ;

static void headsetInitUserFeatures ( void ) ; 

static void handleHFPStatusCFM ( hsTaskData * theHeadset , hfp_lib_status pStatus ) ;
/*************************************************************************
NAME    
    getAppTask
    
DESCRIPTION
    Returns the application main task.

RETURNS
    Task
*/
Task getAppTask(void)
{
    return &theHeadset.task;
}

/*************************************************************************
NAME    
    unhandledHeadsetState
    
DESCRIPTION
    This function is called when a message arrives and the Headset is
    in an unexpected state.  The error condition is reported and then the
    application will Panic
    
RETURNS
    
*/
static void unhandledHeadsetState(headsetState state, MessageId id)
{
    MAIN_DEBUG(("HS: st%d id 0x%x\n", state, id));
}


/*************************************************************************
NAME    
    handleCLMessage
    
DESCRIPTION
    Function to handle the CL Lib messages - these are independent of state

RETURNS

*/
static void handleCLMessage ( Task task, MessageId id, Message message )
{
 
    /*paranoia check we have a CL message*/
    if ( headsetGetMessageType ( id )  != MSGTYPE_CL)
    {
        MAIN_DEBUG(( "hCLm Error[%x] \n",id )) ;
    }
        /* Handle incoming message identified by its message ID */
    switch(id)
    {
  /* -- Connection Library Messages -- */
        case CL_INIT_CFM:
            MAIN_DEBUG(("CL_INIT_CFM [%d]\n" , ((CL_INIT_CFM_T*)message)->status ));
            if(((CL_INIT_CFM_T*)message)->status == success)
            {
    			/* The Connection Library has been successfully initialised, 
       			   initialise the HFP library to instantiate an instance of both
       			   the HFP and the HSP */
    				headsetHfpInit(&theHeadset);
            }
            else
            {
                Panic();
            }
            break;
   
  		case CL_SM_PIN_CODE_IND:
            MAIN_DEBUG(("CL_SM_PIN_IND\n"));
            headsetHandlePinCodeInd((CL_SM_PIN_CODE_IND_T*) message);
            break;
            
        case CL_SM_AUTHORISE_IND:
            MAIN_DEBUG(("CL_SM_AUTHORISE_IND\n"));
            headsetHandleAuthoriseInd((CL_SM_AUTHORISE_IND_T*) message);
            break;
            
        case CL_SM_AUTHENTICATE_CFM:
            MAIN_DEBUG(("CL_SM_AUTHENTICATE_CFM\n"));
            headsetHandleAuthenticateCfm(&theHeadset, (CL_SM_AUTHENTICATE_CFM_T*) message);
            break;
            
        case CL_DM_REMOTE_FEATURES_CFM:
            MAIN_DEBUG(("HS : Supported Features\n")) ;
            headsetHandleRemoteSuppFeatures(&theHeadset, (CL_DM_REMOTE_FEATURES_CFM_T *)(message));
            break ;
   
  case CL_SM_GET_ATTRIBUTE_CFM:
   MAIN_DEBUG(("HS : CL_SM_GET_ATTRIBUTE_CFM\n"));
   soundManagerHandleVolumeLevel(&theHeadset, (CL_SM_GET_ATTRIBUTE_CFM_T *)(message));
   break;
   

        case CL_DM_SYNC_CONNECT_CFM:        
        case CL_DM_SYNC_CONNECT_IND:
        case CL_DM_SYNC_DISCONNECT_IND:   
    	case CL_DM_ACL_OPENED_IND:
        case CL_DM_ACL_CLOSED_IND:
        case CL_DM_ROLE_CFM:
        case CL_DM_INQUIRE_RESULT:
        case CL_DM_REMOTE_NAME_COMPLETE:
        case CL_DM_CLASS_OF_DEVICE_CFM:
        case CL_DM_LOCAL_BD_ADDR_CFM:
        case CL_DM_LINK_QUALITY_CFM:
        case CL_DM_RSSI_CFM:
        case CL_DM_CLOCK_OFFSET_CFM:
        case CL_SM_SECURITY_LEVEL_CFM:
        case CL_SDP_UNREGISTER_CFM:
        case CL_SDP_OPEN_SEARCH_CFM:
        case CL_SDP_CLOSE_SEARCH_CFM:
        case CL_SDP_SERVICE_SEARCH_CFM:
        case CL_SDP_ATTRIBUTE_SEARCH_CFM:
        case CL_SDP_SERVICE_SEARCH_ATTRIBUTE_CFM:
        case CL_L2CAP_REGISTER_CFM:
        case CL_L2CAP_UNREGISTER_CFM:
        case CL_L2CAP_CONNECT_CFM:
        case CL_L2CAP_CONNECT_IND:
        case CL_L2CAP_DISCONNECT_IND:
        case CL_RFCOMM_REGISTER_CFM:
        case CL_RFCOMM_CONNECT_CFM:
        case CL_RFCOMM_CONNECT_IND:
        case CL_RFCOMM_DISCONNECT_IND:
        case CL_RFCOMM_CONTROL_IND:
        case CL_DM_LINK_POLICY_IND:
    
    
            MAIN_DEBUG(("Headset - Unhandled CL msg[%x]\n", id));
            break;
            
        default :
                MAIN_DEBUG(("HS : CL ? [%x]\n", id)) ;
                break ;
    }
   
}

/*************************************************************************
NAME    
    handleUEMessage
    
DESCRIPTION
    handles messages from the User Events

RETURNS
    
*/
static void handleUEMessage  ( Task task, MessageId id, Message message )
{
    /* Event state control is done by the config - we will be in the right state for the message
    therefore messages need only be passed to the relative handlers unless configurable */
    headsetState lState = stateManagerGetState() ;
         
        /*if we do not want the event received to be indicated then set this to FALSE*/
    bool lIndicateEvent = TRUE ;

    /* Deal with user generated Event specific actions*/
    switch ( id )
    {   
            /*these are the events that are not user generated and can occur at any time*/
        case EventOkBattery:
        case EventChargerDisconnected:
        case EventLEDEventComplete:
        case EventTrickleCharge:
        case EventLowBattery:
        case EventPowerOff:
        case EventLinkLoss:
        case EventSLCConnected:
        case EventError:
        case EventChargeError:
        case EventChargeErrorInIdleState:
        case EventCancelLedIndication:
        case EventAutoSwitchOff:
            /*do nothing for these events*/
        break ;
        default:
                    /* If we have had an event then reset the timer - if it was the event then we will switch off anyway*/
            if (theHeadset.AutoSwitchOffTimeSecs !=0)
            {
                /*MAIN_DEBUG(("HS: AUTOSent Ev[%x] Time[%d]\n",id , theHeadset.AutoSwitchOffTimeSecs )) ;*/
                MessageCancelAll( task , EventAutoSwitchOff ) ;
                MessageSendLater( task , EventAutoSwitchOff , 0 , D_SEC(theHeadset.AutoSwitchOffTimeSecs) ) ;                
            }
                /*handles the LED event timeouts - restarts state indications if we have had a user generated event only*/
            if (theHeadset.theLEDTask.gLEDSStateTimeout)
            {   
                MAIN_DEBUG(("HS: Restart St Inds[%d]\n", stateManagerGetState() )) ;                    
                LEDManagerIndicateState (&theHeadset.theLEDTask , stateManagerGetState() ) ;     
                theHeadset.theLEDTask.gLEDSStateTimeout = FALSE ;
            }
            else
            {
                    /*reset the current number of repeats complete - i.e restart the timer so that the leds will disable after
                    the correct time*/
                LEDManagerResetStateIndNumRepeatsComplete  ( &theHeadset.theLEDTask ) ;
            }
   
        break;
    }
     
    MAIN_DEBUG (( "HS : UE[%x]\n", id )); 
            
    /* The configurable Events*/
    switch ( id )
    {   
        case (EventPowerOn):
            MAIN_DEBUG(("HS: Power On\n" )) 
               
            /*we have received the power on event- we have fully powered on*/
            stateManagerPowerOn( &theHeadset ) ;
            
            LedManagerEnableLEDS ( &theHeadset.theLEDTask ) ;
    
            if ( theHeadset.features.DisablePowerOffAfterPowerOn )
            {
                theHeadset.PowerOffIsEnabled = FALSE ;
                MessageSendLater ( &theHeadset.task , EventEnablePowerOff , 0 , D_SEC ( theHeadset.DisablePowerOffAfterPowerOnTimeSecs ) ) ;
            }
            else
            {
                theHeadset.PowerOffIsEnabled = TRUE ;
            }

            break ;
            
        case (EventPowerOff):    
            MAIN_DEBUG(("HS: PowerOff - En[%c]\n" , ((theHeadset.PowerOffIsEnabled) ? 'T':'F') )) ;
            
            if ( theHeadset.PowerOffIsEnabled )
            {
                stateManagerEnterPoweringOffState ( &theHeadset ) ;
                    

                if (theHeadset.theSoundTask.gMuted == VOL_MUTED)
                {
                    soundManagerMuteOff ( &theHeadset ) ;
                }
                
                headsetClearQueueudEvent ( &theHeadset ) ;
            }
            else
            {
                lIndicateEvent = FALSE ;
            }
            MessageCancelAll ( &theHeadset.task , EventPairingFail) ;
            
            break ;

        case (EventInitateVoiceDial):
            MAIN_DEBUG(("HS: InitVoiceDial [%c] [%d]\n", (theHeadset.supp_features_local & HFP_VOICE_RECOGNITION ) ? 'T':'F' , theHeadset.VoiceRecognitionIsActive )) ;
            
                /*Toggle the voice dial behaviour depending on whether we are currently active*/
            if (theHeadset.VoiceRecognitionIsActive)
            {
                headsetCancelVoiceDial ( &theHeadset ) ;
                lIndicateEvent = FALSE ;
            }
            else
            {                
                headsetInitiateVoiceDial ( &theHeadset) ;
            }
            
            break ;
   
        case (EventLastNumberRedial):
            MAIN_DEBUG(("HS: LNR\n" )) ;
            
            headsetInitiateLNR ( &theHeadset ) ;
           
            break ;
   
        case (EventAnswer):
            MAIN_DEBUG(("HS: Answer\n" )) ;
            /* Call the HFP lib function, this will determine the AT cmd to send
               depending on whether the profile instance is HSP or HFP compliant. */ 
            headsetAnswerCall(&theHeadset);
            break ;
   
        case (EventReject):
            MAIN_DEBUG(("HS: Reject\n" )) ;
            /* Reject incoming call - only valid for instances of HFP */ 
            headsetRejectCall(&theHeadset);
            break ;
   
        case (EventCancelEnd):
            MAIN_DEBUG(("HS: CancelEnd\n" )) ;
            /* Terminate the current ongoing call process */
            headsetHangUpCall(&theHeadset);
            break ;
   
        case (EventTransferToggle):
            MAIN_DEBUG(("HS: Transfer\n" )) ;
            headsetTransferToggle(&theHeadset);
            break ;
   
        case (EventToggleMute):
            soundManagerToggleMute( &theHeadset ) ;
            break ;
        case (EventDoCompleteUnMuteMic):
                soundManagerCompleteUnmute ( &theHeadset ) ;
            break;
        case EventMuteOn :
                soundManagerMuteOn (&theHeadset) ;
            break ;
        case EventMuteOff:
                soundManagerMuteOff ( &theHeadset ) ;
            break ;
   
        case (EventVolumeUp):
            soundManagerVolumeUp( &theHeadset ) ;
            break ;
   
        case (EventVolumeDown):
            soundManagerVolumeDown( &theHeadset ) ;          
            break ;                        
   
        case (EventEnterPairing):
            MAIN_DEBUG(("HS: EnterPair [%d]\n" , stateManagerGetState() )) ;
            /*go into pairing mode*/ 
            if (stateManagerGetState () != headsetPoweringOn)
            {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人综合在线观看| 亚洲已满18点击进入久久| 国产精品自拍毛片| 26uuu久久综合| 国产99精品国产| 最新热久久免费视频| 色综合网色综合| 三级精品在线观看| 精品国产一区二区精华| 国产成人亚洲综合a∨婷婷图片| 国产清纯白嫩初高生在线观看91| 成人久久视频在线观看| 亚洲蜜桃精久久久久久久| 欧美日韩在线播放三区| 久久99精品久久久久婷婷| 国产嫩草影院久久久久| 色中色一区二区| 蜜桃视频第一区免费观看| 久久久久国产精品人| 色婷婷精品久久二区二区蜜臂av| 五月激情六月综合| 国产婷婷色一区二区三区在线| 91在线国产观看| 日本vs亚洲vs韩国一区三区| 国产偷国产偷亚洲高清人白洁| 在线亚洲+欧美+日本专区| 久久99久久久久| 日韩毛片精品高清免费| 日韩一区二区电影网| 成人午夜伦理影院| 蜜臀av一区二区在线免费观看| 国产精品久久久久永久免费观看| 欧美久久久久久久久中文字幕| 国产一区欧美一区| 亚洲国产精品欧美一二99| 久久久久久亚洲综合影院红桃| 色婷婷综合中文久久一本| 经典三级一区二区| 亚洲精品乱码久久久久久日本蜜臀| 日韩午夜电影在线观看| 91年精品国产| 国产毛片一区二区| 奇米精品一区二区三区在线观看一 | 亚洲激情自拍偷拍| 久久久精品影视| 欧美日韩日日摸| 色综合久久综合网| 国产成人综合网| 乱一区二区av| 午夜精品久久久久久久99樱桃| 国产精品久久看| 欧美精品一区二区三区在线| 欧美日本一区二区| 色婷婷综合久久久中文字幕| 成人美女视频在线看| 黑人巨大精品欧美一区| 婷婷中文字幕综合| 一区二区三区免费在线观看| 国产精品天美传媒| 国产欧美精品一区二区色综合| 欧美一区二区精品| 欧美一二三四区在线| 欧美三级中文字幕| 欧美亚洲综合一区| 欧美三级视频在线播放| 在线亚洲一区二区| 色呦呦一区二区三区| 成人在线综合网| 东方欧美亚洲色图在线| 狠狠色伊人亚洲综合成人| 九九视频精品免费| 麻豆91精品视频| 美女脱光内衣内裤视频久久影院| 亚洲3atv精品一区二区三区| 亚洲成年人网站在线观看| 亚洲综合色区另类av| 亚洲一级二级在线| 亚洲成av人片www| 视频一区视频二区中文字幕| 日韩影视精彩在线| 麻豆高清免费国产一区| 久久99精品视频| 国产精品1024久久| proumb性欧美在线观看| 97se亚洲国产综合自在线不卡| 99九九99九九九视频精品| 99久久婷婷国产综合精品| 91香蕉视频黄| 欧美色偷偷大香| 日韩一区二区三区精品视频| 精品国产免费久久| 国产精品系列在线| 亚洲欧美色图小说| 午夜精品久久久久久| 九色|91porny| 99久久精品免费看国产| 91蜜桃传媒精品久久久一区二区| 欧洲av一区二区嗯嗯嗯啊| 欧美精品粉嫩高潮一区二区| 欧美va亚洲va香蕉在线| 欧美激情综合五月色丁香小说| 亚洲欧美国产77777| 日韩精品一二三区| 国产成人精品一区二区三区四区 | 亚洲激情图片小说视频| 天堂在线亚洲视频| 国产精品亚洲一区二区三区在线| 不卡av电影在线播放| 欧美体内she精高潮| 精品播放一区二区| 亚洲精品国产一区二区三区四区在线| 午夜国产精品影院在线观看| 国产精品91一区二区| 91视频观看免费| 日韩亚洲欧美综合| 中文字幕一区二区三区乱码在线| 亚洲综合在线电影| 国产乱码字幕精品高清av| 在线观看av一区| 久久久一区二区三区| 亚洲丰满少妇videoshd| 国产成人亚洲综合a∨婷婷| 欧美日韩国产综合久久| 欧美极品少妇xxxxⅹ高跟鞋| 日韩精品一级二级| 99re在线视频这里只有精品| 日韩欧美国产综合在线一区二区三区 | 日韩专区中文字幕一区二区| 国产99久久久国产精品潘金| 欧美日韩mp4| 亚洲三级电影网站| 国产91色综合久久免费分享| 欧美日韩中文国产| 1000部国产精品成人观看| 国产在线精品一区二区不卡了| 在线视频一区二区免费| 国产精品少妇自拍| 激情深爱一区二区| 91麻豆精品国产91久久久更新时间 | 91浏览器打开| 欧美国产一区视频在线观看| 久久精品噜噜噜成人88aⅴ| 欧美日韩在线一区二区| 亚洲欧美激情在线| 丁香婷婷综合色啪| 精品国产91乱码一区二区三区| 亚洲国产日日夜夜| av激情综合网| 亚洲国产精品传媒在线观看| 乱一区二区av| 日韩欧美电影一区| 日日噜噜夜夜狠狠视频欧美人| 91传媒视频在线播放| 亚洲三级视频在线观看| 成人免费高清在线| 欧美激情在线一区二区| 国产一区福利在线| 久久蜜臀中文字幕| 久久66热re国产| 精品福利一区二区三区| 久久福利视频一区二区| 日韩女优av电影在线观看| 日本中文字幕一区二区视频| 欧美日韩国产a| 亚洲风情在线资源站| 在线不卡中文字幕播放| 日韩av电影免费观看高清完整版 | 欧美精品一区二区三区视频| 美女在线观看视频一区二区| 日韩一区二区免费高清| 久久精品99国产精品日本| 日韩一区二区免费在线电影| 美女网站色91| 国产视频一区在线播放| 成人开心网精品视频| 中文字幕一区二区三区视频| 一本到一区二区三区| 亚洲成人黄色小说| 91精品国产91热久久久做人人| 久久精品国产精品亚洲综合| 2024国产精品| 成人精品视频一区二区三区| ...xxx性欧美| 欧美美女一区二区在线观看| 天天影视色香欲综合网老头| 欧美一区二区三区爱爱| 国产在线播放一区二区三区| 亚洲国产高清在线观看视频| 色偷偷一区二区三区| 日韩制服丝袜av| 久久精品夜色噜噜亚洲aⅴ| 99这里都是精品| 亚洲大片精品永久免费| 精品国产乱码久久久久久久久| 国产成人鲁色资源国产91色综| 国产精品人妖ts系列视频| 欧美性猛交xxxx黑人交| 久久不见久久见免费视频1| 国产精品久久久久久久第一福利| 欧美性生交片4|