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

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

?? main.c

?? BLUETOOTH Stereo Headset Source Code,含CVC(噪音消除,回聲抵消),可用于開發藍牙立體聲耳機,藍牙車載,經過測試.
?? C
?? 第 1 頁 / 共 4 頁
字號:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004-2006
Part of BlueLab 3.6.2-release

FILE NAME
    main.c        

DESCRIPTION
    This file contains the main stereo_headset application.

NOTES

***** Project property options *****

Selected board (Development board 1307/1442/1508/1645) : Decide if the application is
to run on a CSR 1307, 1442, 1508 or 1645 development board (default - Development board 1645).

Include CVC (Yes/No) : Determines if the application is to use CVC processing for noice  
reduction and echo cancellation on the SCO audio (default - Yes).

Enable debug (Yes/No) : Determines if the application should be run in debug mode which 
displays debug output (default - No). Note: the debug for individual files can be enabled 
and disabled by modifying the defines in headset_debug.h.

***** User information *****

When the application starts up, the headset is powered off. The headset must be  
powered on by a long press (> 2s) of# the MFB button (labelled F1 on the 1307 boards).  
If the MFB is continued to be held down for 5s, the headset will enter pairing mode  
for 1 minute. With the headset on, a long press of the MFB button will power the  
headset off. Please refer to the user interface guide for more details of how the  
headset operates.

This headset takes readings of the battery and charger. Once the battery has reached a  
low level the headset will power off. The battery is read through AIO0 and the charger  
is read through AIO1 and AIO0 which are multiplexed with PIO13 and PIO15.

***** PS Keys *****

The headset is configurable using the following PS Keys:

USR3 - Auto reconnect (0/1) : Set to 1 for the headset to reconnect back to the last  
used AG and last used AV source on power on.

USR4 - Headset security (0/1) : Set to 1 to only allow pairing when the headset is in  
pairing mode, or if the headset is initiating a connection.

USR5 - Ringtone select (0/1) : Chooses one of two different headset ringtones.

USR6 - Auto switch off enabled (0/1) : Set to 1 to automatically switch off the  
headset if it has been idle for for a time of 'auto switch off timeout' (see USR7).

USR7 - If USR6 is set to 1 then this is the time that the headset is active before  
turning off.

USR9 - MP3 Enabled (0/1) - Set to 1 to enable MP3 support. Note: make sure the mp3  
component of Bluelab is installed otherwise the application will fail on startup.

Note: The pin for this application is stored in the PS Key FIXED_PIN.
      

****************************************************************************
    Header files
*/

#include "headset_private.h"
#include "a2dp_handler.h"
#include "av_stream_control.h"
#include "avrcp_handler.h"
#include "headset_battery.h"
#include "headset_common.h"
#include "headset_init.h"
#include "leds.h"
#include "headset_power.h"
#include "headset_security.h"
#include "headset_tones.h"
#include "headset_volume.h"
#include "hfp_audio.h"
#include "hfp_handler.h"
#include "hfp_ring.h"
#include "hfp_slc.h"
#include "stereo_headset_buttons.h"
#include "headset_button_handler.h"


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

#include <a2dp.h>
#include <audio.h>
#include <avrcp.h>
#include <bdaddr.h>
#include <codec.h>
#include <connection.h>
#include <hfp.h>
#include <panic.h>
#include <pio.h>
#include <ps.h>
#include <stdlib.h>
#include <stream.h>
#include <charger.h>

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

#ifdef DEBUG_BUTTONS
#define BUTTON_DEBUG(x) DEBUG(x)
#else
#define BUTTON_DEBUG(x) 
#endif

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

/* Single instance of AV Headset state */
static headsetTaskData app;

/*************************************************************************
NAME    
    getAppTask
    
DESCRIPTION
    Returns the AV application main task.

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

/*************************************************************************
NAME    
    getApp
    
DESCRIPTION
    Returns the AV application main task.

RETURNS
    Task
*/
headsetTaskData *getApp(void)
{
    return &app;
}

        
/**************************************************************************/
static void unhandledA2dpState(headsetA2dpState state, MessageId id)
{
	state = state;
	id = id;

    MAIN_DEBUG(("A2DP current state %d message id 0x%x\n", state, id));  
}

static void unhandledAvrcpState(headsetAvrcpState state, MessageId id)
{
	state = state;
	id = id;

    MAIN_DEBUG(("AVRCP current state %d message id 0x%x\n", state, id));
}

static void unhandledHfpState(headsetHfpState state, MessageId id)
{
	state = state;
	id = id;

    MAIN_DEBUG(("HFP current state %d message id 0x%x\n", state, id));
}


/**************************************************************************/
        
/**************************************************************************/
static void avrcp_msg_handler(MessageId id, Message message)
{
    headsetAvrcpState current_avrcp_state = app.avrcp_state;
	
    switch(id)
    {
    case AVRCP_INIT_CFM:
        MAIN_DEBUG(("AVRCP_INIT_CFM\n"));

        switch(current_avrcp_state)
        {
        case avHeadsetAvrcpInitialising:
            avHeadsetHandleAvrcpInitCfm(&app, (AVRCP_INIT_CFM_T *) message);
            break;
            
        case avHeadsetAvrcpReady:
        case avHeadsetAvrcpConnecting:
        case avHeadsetAvrcpConnected:
        default:
            unhandledAvrcpState(current_avrcp_state, id);
            break;      
        }
        break;
        
        case AVRCP_CONNECT_CFM:
            MAIN_DEBUG(("AVRCP_CONNECT_CFM status = %d\n",((AVRCP_CONNECT_CFM_T*)message)->status));

            switch(current_avrcp_state)
            {
            case avHeadsetAvrcpReady:
            case avHeadsetAvrcpConnecting:
                avHeadsetHandleAvrcpConnectCfm(&app, (AVRCP_CONNECT_CFM_T*) message);
                break;

            case avHeadsetAvrcpInitialising:
            case avHeadsetAvrcpConnected:
            default:
                unhandledAvrcpState(current_avrcp_state, id);
                break;      
            }
            break;
            
        case AVRCP_CONNECT_IND:
            MAIN_DEBUG(("AVRCP_CONNECT_IND\n"));
            switch(current_avrcp_state)
            {
            case avHeadsetAvrcpReady:
                /* Only accept the RCP connection if we are in the ready state */
                avHeadsetHandleAvrcpConnectInd(&app, (AVRCP_CONNECT_IND_T *) message);
                break;

            case avHeadsetAvrcpConnecting:
            case avHeadsetAvrcpConnected:
                avHeadsetHandleAvrcpConnectIndReject(app.avrcp, (AVRCP_CONNECT_IND_T *) message);
                break;
                
            case avHeadsetAvrcpInitialising:
            default:
                unhandledAvrcpState(current_avrcp_state, id);
                break;      
            }
            break;
            
            
        case AVRCP_PASSTHROUGH_CFM:
            MAIN_DEBUG(("AVRCP_PASSTHROUGH_CFM status = %d\n",((AVRCP_PASSTHROUGH_CFM_T*)message)->status));

            /* 
                Clearing the pending flag should allow another
                pending event to be delivered to controls_handler 
            */
            app.avrcp_pending = FALSE;
            break;
            
        case AVRCP_PASSTHROUGH_IND:
            MAIN_DEBUG(("AVRCP_PASSTHROUGH_IND\n"));

			/* Always respond whatever the state */
            avHeadsetHandleAvrcpPassthroughInd((AVRCP_PASSTHROUGH_IND_T *) message);
            break;
            
        case AVRCP_UNITINFO_IND:
            MAIN_DEBUG(("AVRCP_UNITINFO_IND\n"));

			/* Always respond whatever the state */
            avHeadetHandleAvrcpUnitInfo((AVRCP_UNITINFO_IND_T*) message);
            break;

        case AVRCP_SUBUNITINFO_IND:
            MAIN_DEBUG(("AVRCP_SUBUNITINFO_IND\n"));
			
            /* Always respond whatever the state */
            avHeadetHandleAvrcpSubUnitInfo((AVRCP_SUBUNITINFO_IND_T*) message);
            break;

        case AVRCP_VENDORDEPENDENT_IND:
            MAIN_DEBUG(("AVRCP_VENDORDEPENDENT_IND\n"));
			
            /* Always respond whatever the state */
			avHeadetHandleAvrcpVendorDependent((AVRCP_VENDORDEPENDENT_IND_T*) message);
            break;

        case AVRCP_DISCONNECT_IND:
            MAIN_DEBUG(("AVRCP_DISCONNECT_IND\n"));
            
            switch(current_avrcp_state)
            {
                case avHeadsetAvrcpConnected:
                    avHeadsetHandleAvrcpDisconnectInd(&app);
                    break;

                case avHeadsetAvrcpConnecting:
                case avHeadsetAvrcpInitialising:
                case avHeadsetAvrcpReady:
                default:
                    unhandledAvrcpState(current_avrcp_state, id);
                    break;      
            }   
            break;

        default:
            MAIN_DEBUG(("AV Headset - Unhandled avrcp msg 0x%x\n",id));
            break;
    }
}



/**************************************************************************/
static void a2dp_msg_handler(MessageId id, Message message)
{
    headsetA2dpState current_a2dp_state = app.a2dp_state;

    switch (id)
    {
        case A2DP_INIT_CFM:
            MAIN_DEBUG(("A2DP_INIT_CFM\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpInitialising:
                    avHeadsetHandleA2dpInitCfm(&app, (A2DP_INIT_CFM_T*) message);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpConnected:
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpInitiating:
                case avHeadsetA2dpSignallingActive:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_ADD_SEP_CFM:
            MAIN_DEBUG(("A2DP_ADD_SEP_CFM\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpInitialising:
                    avHeadsetHandleA2dpAddSepCfm(&app, (A2DP_ADD_SEP_CFM_T*) message);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpConnected:
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpInitiating:
                case avHeadsetA2dpSignallingActive:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_OPEN_IND:
            MAIN_DEBUG(("A2DP_OPEN_IND\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpReady:
                case avHeadsetA2dpSignallingActive:
                    avHeadsetHandleA2dpOpenInd(&app, (A2DP_OPEN_IND_T*) message);
                    break;
                    
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpConnected:
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpInitiating:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_OPEN_CFM:
            MAIN_DEBUG(("A2DP_OPEN_CFM %d\n",((A2DP_OPEN_CFM_T*) message)->result));
            
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpReady:
                case avHeadsetA2dpInitiating:
                case avHeadsetA2dpSignallingActive:
                    avHeadsetHandleA2dpOpenCfm(&app, (A2DP_OPEN_CFM_T*) message);
                    break;
                    
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpConnected:
                case avHeadsetA2dpInitialising:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
                        
        case A2DP_START_IND:
            MAIN_DEBUG(("A2DP_START_IND\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpConnected:
                    avHeadsetHandleA2dpStartInd(&app, (A2DP_START_IND_T*) message);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpInitiating:
                case avHeadsetA2dpSignallingActive:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_START_CFM:
            MAIN_DEBUG(("A2DP_START_CFM\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpInitiating:
                case avHeadsetA2dpConnected:
                    avHeadsetHandleA2dpStartCfm(&app, (A2DP_START_CFM_T*) message);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpStreaming:  
                case avHeadsetA2dpInitialising:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频第一区| 美日韩一区二区三区| 另类调教123区| 色综合天天综合给合国产| 精品国产乱码久久久久久图片| 亚洲九九爱视频| 国产91精品入口| 日韩欧美自拍偷拍| 亚洲成人免费在线| 在线观看一区二区视频| 国产精品私人影院| 国产精选一区二区三区| 日韩欧美电影一二三| 亚洲午夜电影在线观看| 色悠悠久久综合| 亚洲欧美在线aaa| 99久久综合色| 国产精品嫩草久久久久| 国产成人午夜视频| 久久综合国产精品| 久久99日本精品| 欧美一级日韩不卡播放免费| 天堂一区二区在线| 欧美日韩一区二区在线视频| 亚洲欧美色图小说| 色婷婷久久久亚洲一区二区三区 | 国产精品私人自拍| 国产精品一区二区三区99| 亚洲精品在线观| 久久国产精品无码网站| 欧美r级电影在线观看| 黄页视频在线91| 国产午夜久久久久| 成人激情av网| 一区二区三区高清在线| 欧美视频一区二区三区| 视频一区视频二区在线观看| 777奇米成人网| 精品亚洲欧美一区| 久久久欧美精品sm网站| av在线不卡网| 亚洲成a人v欧美综合天堂下载| 欧美日本韩国一区二区三区视频 | 亚洲男帅同性gay1069| 欧美大片在线观看| 久久精品国产成人一区二区三区| 欧美va日韩va| 成人精品gif动图一区| 亚洲欧美一区二区三区国产精品| 欧美在线看片a免费观看| 视频一区二区不卡| 国产亚洲欧美一级| 91精彩视频在线| 蜜桃免费网站一区二区三区| 国产欧美中文在线| 在线观看日韩电影| 久久国产三级精品| 日韩伦理免费电影| 日韩欧美在线1卡| 不卡电影免费在线播放一区| 亚洲午夜免费电影| 精品91自产拍在线观看一区| www.视频一区| 精品制服美女久久| 亚洲日本va在线观看| 欧美一级欧美三级在线观看| 国产不卡在线一区| 午夜精品在线视频一区| 国产日韩欧美一区二区三区综合 | 日韩一区二区电影| 91色在线porny| 蜜桃av一区二区在线观看| 欧美激情中文字幕| 日韩一级视频免费观看在线| 91在线视频播放| 精品一区二区三区的国产在线播放| 亚洲欧洲日韩一区二区三区| 日韩亚洲欧美成人一区| 91精品福利视频| 成人综合在线观看| 久久精品99国产精品日本| 亚洲日本一区二区| 中文字幕乱码久久午夜不卡 | 国产精品美女久久久久aⅴ| 欧美在线观看你懂的| 成人99免费视频| 国产真实精品久久二三区| 亚洲乱码国产乱码精品精小说 | 国产成人精品免费一区二区| 天堂va蜜桃一区二区三区| 亚洲精品成人精品456| 欧美激情在线一区二区三区| 欧美哺乳videos| 欧美一区二区三区婷婷月色| 在线亚洲+欧美+日本专区| 粉嫩绯色av一区二区在线观看| 日韩黄色在线观看| 亚洲一级二级三级在线免费观看| 中日韩免费视频中文字幕| 精品日韩在线观看| 日韩免费成人网| 91精品国产一区二区三区蜜臀| 色88888久久久久久影院按摩| a在线播放不卡| 成人不卡免费av| 福利一区在线观看| 国产精品一二三在| 国产99久久久国产精品免费看| 精油按摩中文字幕久久| 国产一区二区三区久久悠悠色av| 久久精品国产77777蜜臀| 奇米888四色在线精品| 日韩精品成人一区二区三区| 视频一区欧美精品| 久久精品国产精品亚洲精品| 九色|91porny| 国产麻豆欧美日韩一区| 精品综合免费视频观看| 国产成人精品免费一区二区| 成人免费视频视频在线观看免费| 成人激情免费网站| 91视视频在线观看入口直接观看www| 91啪在线观看| 欧美午夜精品一区| 91精品国产一区二区人妖| 欧美不卡一二三| 国产精品欧美一区喷水| 成人免费视频在线观看| 一区二区三区四区在线免费观看| 亚洲一区二区三区四区不卡| 日本不卡一区二区三区高清视频| 蜜臀91精品一区二区三区| 国产成人一区二区精品非洲| 成人aaaa免费全部观看| 欧美日韩亚洲综合| 精品不卡在线视频| 亚洲免费在线视频一区 二区| 亚洲国产视频a| 精品一区二区在线视频| 99久久久久久99| 3d动漫精品啪啪一区二区竹菊| 精品久久久久一区| 亚洲人妖av一区二区| 偷拍自拍另类欧美| 成人免费毛片aaaaa**| 欧美视频在线观看一区二区| 久久网站热最新地址| 亚洲三级电影网站| 日韩av中文在线观看| 国产99久久久精品| 3atv在线一区二区三区| 中文字幕av免费专区久久| 亚洲成人激情社区| 不卡一区二区中文字幕| 91精品国产色综合久久| 中文字幕日韩一区二区| 日本vs亚洲vs韩国一区三区 | 亚洲欧美日本在线| 久久精品国产一区二区三区免费看 | 欧美mv日韩mv| 玉足女爽爽91| 国产精品99久久久久久有的能看| 91精品办公室少妇高潮对白| 久久婷婷国产综合国色天香| 亚洲在线视频免费观看| 成人一区二区在线观看| 日韩欧美在线综合网| 一区二区不卡在线播放 | 1区2区3区精品视频| 免费观看日韩av| 色哟哟国产精品免费观看| 久久精品在这里| 日本亚洲最大的色成网站www| 不卡视频一二三四| 精品国产乱码久久| 亚洲一区二区av电影| 一本到三区不卡视频| 久久久国产精品午夜一区ai换脸| 亚洲国产精品久久人人爱| 99精品国产热久久91蜜凸| 久久蜜桃av一区二区天堂| 美女精品一区二区| 91精品国产欧美一区二区| 亚洲电影激情视频网站| 在线区一区二视频| 亚洲精品视频免费看| av激情成人网| 亚洲欧美怡红院| 不卡一区在线观看| 成人欧美一区二区三区白人 | 国产福利视频一区二区三区| 日韩精品综合一本久道在线视频| 三级在线观看一区二区| 欧美高清你懂得| 性做久久久久久免费观看 | 一本久道中文字幕精品亚洲嫩| 中文字幕在线播放不卡一区| 不卡在线观看av| 综合色中文字幕| 色婷婷综合久色|