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

📄 main.c

📁 CSR蓝牙芯片 无线蓝牙耳机的语音网关程序 蓝牙耳机程序已经上传
💻 C
📖 第 1 页 / 共 5 页
字号:
                case avHeadsetA2dpStreaming:
                    avHeadsetHandleA2dpSuspendInd(&app);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpConnected:
                case avHeadsetA2dpDisconnecting:
                case avHeadsetA2dpInitiating:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_SUSPEND_CFM:
            DEBUG(("A2DP_SUSPEND_CFM\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpStreaming:
				case avHeadsetA2dpConnected:
                    avHeadsetHandleA2dpSuspendCfm(&app, (A2DP_SUSPEND_CFM_T*) message);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpDisconnecting:
                case avHeadsetA2dpInitiating:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_CLOSE_IND:
            DEBUG(("A2DP_CLOSE_IND\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpConnected:
                    avHeadsetHandleA2dpCloseInd(&app);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpDisconnecting:
                case avHeadsetA2dpInitiating:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
        case A2DP_CLOSE_CFM:
            DEBUG(("A2DP_CLOSE_CFM\n"));
                    
            switch(current_a2dp_state)
            {
                case avHeadsetA2dpStreaming:
                case avHeadsetA2dpConnected:
                    avHeadsetHandleA2dpCloseCfm(&app);
                    avHeadsetCheckPowerDownStatus(&app);
                    break;
                    
                case avHeadsetA2dpReady:
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpDisconnecting:
                case avHeadsetA2dpInitiating:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
            break;
            
		case A2DP_CODEC_SETTINGS_IND:
			DEBUG(("A2DP_CODEC_SETTINGS_IND\n"));
			switch(current_a2dp_state)
            {
                case avHeadsetA2dpReady:
                case avHeadsetA2dpConnected:
				case avHeadsetA2dpInitiating:
                    avHeadsetHandleA2dpCodecSettingsInd(&app, (A2DP_CODEC_SETTINGS_IND_T *) message);
                    break;
                    
				case avHeadsetA2dpStreaming:
                case avHeadsetA2dpInitialising:
                case avHeadsetA2dpDisconnecting:
                default:
                    unhandledA2dpState(current_a2dp_state, id);
                    break;      
            }
			break;
            
        case AVRCP_INIT_CFM:
            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:
                case avHeadsetAvrcpDisconnecting:
                default:
                    unhandledAvrcpState(current_avrcp_state, id);
                    break;      
            }
            break;
            
        case AVRCP_CONNECT_CFM:
            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:
                case avHeadsetAvrcpDisconnecting:
                default:
                    unhandledAvrcpState(current_avrcp_state, id);
                    break;      
            }
            break;
            
        case AVRCP_CONNECT_IND:
            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:
                case avHeadsetAvrcpDisconnecting:
                    avHeadsetHandleAvrcpConnectIndReject(app.avrcp, (AVRCP_CONNECT_IND_T *) message);
                    break;
                
                case avHeadsetAvrcpInitialising:
                default:
                    unhandledAvrcpState(current_avrcp_state, id);
                    break;      
            }
            break;
            
            
        case AVRCP_PASSTHROUGH_CFM:
            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:
            DEBUG(("AVRCP_PASSTHROUGH_IND\n"));
			/* always respond whatever the state */
            avHeadsetHandleAvrcpPassthroughInd((AVRCP_PASSTHROUGH_IND_T *) message);
            break;
            
        case AVRCP_UNITINFO_IND:
            DEBUG(("AVRCP_UNITINFO_IND\n"));
			/* always respond whatever the state */
            avHeadetHandleAvrcpUnitInfo((AVRCP_UNITINFO_IND_T*) message);
            break;

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

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

        case AVRCP_DISCONNECT_IND:
            DEBUG(("AVRCP_DISCONNECT_IND\n"));
            switch(current_avrcp_state)
            {
                case avHeadsetAvrcpConnected:
                case avHeadsetAvrcpDisconnecting:
                    avHeadsetHandleAvrcpDisconnectInd();
                    avHeadsetCheckPowerDownStatus(&app);
                    break;
                case avHeadsetAvrcpConnecting:
                case avHeadsetAvrcpInitialising:
                case avHeadsetAvrcpReady:
                default:
                    unhandledAvrcpState(current_avrcp_state, id);
                    break;      
            }   
            break;
                        
        case APP_HEADSET_INIT_CFM:
            DEBUG(("APP_HEADSET_INIT_CFM\n"));
            switch(current_hfp_state)
            {
            case headsetInitialising:
                /* Set the state to indicate the init has finished */
                app.hfp_state = headsetReady;

				/* Turn on connectability. Set discoverability depending on pairing mode. */
                headsetEnableConnectable(&app);
                
				if (app.pairing_enabled)
                    headsetEnableDiscoverable(&app);
                break;

            case headsetReady:
            case headsetConnecting:
            case headsetConnected:
            case headsetOutgoingCallEstablish:
            case headsetIncomingCallEstablish:
            case headsetActiveCall:
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_INIT_CFM:
            switch(current_hfp_state)
            {
            case headsetInitialising:
                {
                    HFP_INIT_CFM_T *msg = (HFP_INIT_CFM_T *) message;
                    if (msg->status == hfp_init_success)
                        hfpHeadsetInitComplete(&app, msg);
                    else
                        Panic();
                }
                break;

            case headsetReady:
            case headsetConnecting:
            case headsetConnected:
            case headsetOutgoingCallEstablish:
            case headsetIncomingCallEstablish:
            case headsetActiveCall:
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_SLC_CONNECT_IND:
            DEBUG(("HFP_SLC_CONNECT_IND\n"));
            switch(current_hfp_state)
            {
            case headsetReady:
            case headsetConnecting:
            case headsetConnected:
            case headsetOutgoingCallEstablish:
            case headsetIncomingCallEstablish:
            case headsetActiveCall:
                hfpHeadsetHandleSlcConnectInd(&app, (HFP_SLC_CONNECT_IND_T *) message);
                break;

            case headsetInitialising:           
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_SLC_CONNECT_CFM:
            DEBUG(("HFP_SLC_CONNECT_CFM\n"));
            switch(current_hfp_state)
            {
            case headsetConnecting:
            case headsetConnected:
            case headsetOutgoingCallEstablish:
            case headsetIncomingCallEstablish:
            case headsetActiveCall:
                hfpHeadsetHandleSlcConnectCfm(&app, (HFP_SLC_CONNECT_CFM_T *) message);
                break;

            case headsetReady:
            case headsetInitialising:           
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_SLC_DISCONNECT_IND:
            DEBUG(("HFP_SLC_DISCONNECT_IND\n"));
            switch(current_hfp_state)
            {
            case headsetConnecting:         
            case headsetConnected:
            case headsetOutgoingCallEstablish:
            case headsetIncomingCallEstablish:
            case headsetActiveCall:
                hfpHeadsetHandleSlcDisconnectInd(&app, (HFP_SLC_DISCONNECT_IND_T *) message);
                avHeadsetCheckPowerDownStatus(&app);
                break;

            case headsetReady:
            case headsetInitialising:           
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_IN_BAND_RING_IND:
			DEBUG(("HFP_IN_BAND_RING_IND\n"));
            switch(current_hfp_state)
            {
            case headsetConnecting:
            case headsetConnected:
            case headsetOutgoingCallEstablish:
            case headsetIncomingCallEstablish:
            case headsetActiveCall:
                hfpHeadsetHandleInBandRingInd(&app, (HFP_IN_BAND_RING_IND_T *) message);
                break;

            case headsetInitialising:
            case headsetReady:
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_SERVICE_IND:
            switch(current_hfp_state)
            {
            case headsetConnecting:
            case headsetConnected:
            case headsetIncomingCallEstablish:
            case headsetOutgoingCallEstablish:
            case headsetActiveCall:
                hfpHeadsetHandleServiceIndicator(&app, (HFP_SERVICE_IND_T *) message);
                break; 

            case headsetInitialising:
            case headsetReady:
            default:
                unhandledHfpState(current_hfp_state, id);
            }
            break;

        case HFP_CALL_IND:
            DEBUG(("HFP_CALL_IND\n"));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -