亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
人人超碰91尤物精品国产| 久久久精品免费网站| 大胆欧美人体老妇| 日韩高清在线一区| 日韩电影在线免费| 欧美一级片在线看| 欧美日免费三级在线| 久久久99精品免费观看不卡| 日本欧美在线观看| 欧美乱熟臀69xxxxxx| 884aa四虎影成人精品一区| 26uuu国产电影一区二区| 国产在线国偷精品产拍免费yy| 欧美一级二级三级蜜桃| 秋霞午夜av一区二区三区| 欧美丰满嫩嫩电影| 久久爱www久久做| 久久精品一区二区三区不卡| 国产一区二区在线电影| 久久只精品国产| 色综合久久久久| 日一区二区三区| 国产欧美一二三区| 欧美主播一区二区三区| 久久99国产精品免费网站| 国产三级精品三级| 欧洲av在线精品| 国产一区二区在线视频| 一区二区激情视频| 成人福利视频在线看| 国产91清纯白嫩初高中在线观看 | 久久99蜜桃精品| 中文字幕在线一区免费| 欧美美女直播网站| 成人黄色综合网站| 日本va欧美va精品| 久久精品人人做| 91美女精品福利| 婷婷亚洲久悠悠色悠在线播放| 日韩精品最新网址| 国产女人18水真多18精品一级做| 日韩av电影免费观看高清完整版| 日韩一级片网站| 成人av午夜电影| 久久国产尿小便嘘嘘| 国产欧美精品一区| 欧美日韩一区二区不卡| 青草国产精品久久久久久| 国产人成一区二区三区影院| www.成人网.com| 日本午夜精品一区二区三区电影| www日韩大片| 日韩欧美专区在线| 国产日产欧美一区二区视频| 成人网在线播放| 国产成人免费在线观看| 三级在线观看一区二区| 亚洲bdsm女犯bdsm网站| 国产精品你懂的| 亚洲欧洲三级电影| 久久久99精品免费观看| 久久综合久久综合亚洲| 欧美在线观看视频一区二区| 国产成人一区在线| 国产乱子轮精品视频| 毛片一区二区三区| 国产自产高清不卡| 国模一区二区三区白浆| 韩日av一区二区| 精品一区二区国语对白| 国产精品91xxx| 国产麻豆成人传媒免费观看| 国产精品99久久久久久似苏梦涵 | 国产精品乱码一区二区三区软件 | 欧美一级欧美一级在线播放| 欧美一三区三区四区免费在线看| 精品日本一线二线三线不卡| 久久久三级国产网站| 18涩涩午夜精品.www| 久久精品国产精品亚洲精品| av亚洲精华国产精华精华| 91精品国产麻豆国产自产在线 | 日韩视频一区在线观看| 精品久久久久久久久久久久久久久 | 亚洲香肠在线观看| 欧美韩日一区二区三区| 亚洲日本电影在线| 波多野结衣在线一区| 国产网站一区二区| 99精品在线免费| 国产精品成人在线观看| www.日韩av| 亚洲一区二区三区国产| 在线综合亚洲欧美在线视频 | 欧美亚洲国产一区在线观看网站| 综合久久综合久久| 国产一区二区三区久久久| 国产欧美一区二区三区在线老狼| 91精品国产综合久久香蕉的特点| 久久精品噜噜噜成人av农村| 国产精品中文字幕日韩精品| 不卡的av在线播放| 亚洲美女在线国产| 国产日产欧产精品推荐色| 日本不卡中文字幕| 欧美日韩午夜影院| 亚瑟在线精品视频| 亚洲精品在线观看网站| www.欧美亚洲| 久久电影网站中文字幕| 亚洲美女偷拍久久| 精品福利一二区| 在线观看一区二区视频| 国产自产v一区二区三区c| 亚洲黄色片在线观看| 亚洲精品一区二区三区蜜桃下载 | 美女爽到高潮91| 中文字幕一区二区三区在线不卡| 欧美视频在线观看一区二区| 国产精品911| 热久久一区二区| 一片黄亚洲嫩模| 国产精品久久99| 26uuu亚洲| 日韩欧美久久久| 欧美三级蜜桃2在线观看| 国产成人亚洲精品青草天美| 日本在线播放一区二区三区| 依依成人精品视频| 中文字幕精品三区| 久久色成人在线| 欧美大白屁股肥臀xxxxxx| 92国产精品观看| 国产成人精品免费网站| 美国av一区二区| 日本欧洲一区二区| 日韩不卡一区二区三区| 亚洲国产一区在线观看| 一区二区在线观看免费 | 欧美一区二区三区不卡| 91视频xxxx| 91在线免费视频观看| 成人免费高清在线| 丰满岳乱妇一区二区三区| 国产乱国产乱300精品| 免费高清成人在线| 日韩高清不卡一区二区| 婷婷六月综合网| 日本伊人色综合网| 最近中文字幕一区二区三区| 中文文精品字幕一区二区| 久久综合精品国产一区二区三区 | 国产精品自拍av| 国产福利91精品| 成人激情免费视频| 色综合天天综合在线视频| 91丨porny丨国产入口| 91麻豆.com| 欧美这里有精品| 欧美一区二区啪啪| 久久美女艺术照精彩视频福利播放| 精品福利一区二区三区| 国产欧美日韩在线视频| ●精品国产综合乱码久久久久| 亚洲色图.com| 五月天亚洲精品| 国产在线不卡视频| 成人app软件下载大全免费| 91免费版在线看| 制服丝袜成人动漫| 久久影院午夜片一区| 国产精品国产精品国产专区不蜜| 一区二区三区四区中文字幕| 亚洲成人精品在线观看| 久久99久久99小草精品免视看| 国产精品99久久久久久有的能看| 99re这里都是精品| 91.com在线观看| 久久久.com| 亚洲福利电影网| 国产成人亚洲精品青草天美| 色av成人天堂桃色av| 欧美一级免费大片| ...av二区三区久久精品| 婷婷六月综合亚洲| 成人精品国产福利| 56国语精品自产拍在线观看| 久久久不卡网国产精品二区| 亚洲激情自拍视频| 国产超碰在线一区| 制服丝袜亚洲网站| 亚洲视频一二区| 国产久卡久卡久卡久卡视频精品| 色欧美88888久久久久久影院| 日韩三级高清在线| 亚洲高清免费视频| 99久久国产综合精品色伊 | 日韩美女精品在线| 老司机精品视频线观看86| 在线观看成人小视频|