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

📄 main.c

📁 CSR蓝牙MP3播放USB DONGLE源码
💻 C
📖 第 1 页 / 共 3 页
字号:
                case a2dp_state_streaming:
                case a2dp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_ADD_SEP_CFM:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_initialising:
                {
                    if (((A2DP_ADD_SEP_CFM_T *) message)->status == a2dp_success)
                    {
                        /* SEP add succeeded */
                        a2dpSdSepAddedCfm(&theApp);
                    }
                    else
                        /* Panic something is very wrong */
                        Panic();        
                }
                break;

                case a2dp_state_discovering:            
                case a2dp_state_accepting:
                case a2dp_state_initiating:
                case a2dp_state_connected:
                case a2dp_state_streaming:
                case a2dp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break; 

        case A2DP_OPEN_CFM:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_initiating:
                    a2dpSdHandleA2dpOpenCfm(&theApp, (A2DP_OPEN_CFM_T *) message);
                    break;

                case a2dp_state_initialising:
                case a2dp_state_discovering:            
                case a2dp_state_accepting:
                case a2dp_state_connected:
                case a2dp_state_streaming:
                case a2dp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_OPEN_IND:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_accepting:
                    a2dpSdHandleOpenInd(&theApp, (A2DP_OPEN_IND_T *) message);
                    break;

                case a2dp_state_connected:
                case a2dp_state_streaming:
                case a2dp_state_initiating:
                case a2dp_state_initialising:
                case a2dp_state_discovering:
                case a2dp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_START_CFM:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_connected:
                    /* Handle the start cfm message */
                    a2dpSdHandleStartCfm(&theApp, (A2DP_START_CFM_T *) message);
                    break;

                case a2dp_state_initiating:
                case a2dp_state_initialising:
                case a2dp_state_discovering:            
                case a2dp_state_accepting:
                case a2dp_state_streaming:
                case a2dp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_START_IND:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_connected:
                    a2dpSdHandleStartInd(&theApp);
                    break;

                case a2dp_state_accepting:  
                case a2dp_state_streaming:
                case a2dp_state_initiating:
                case a2dp_state_initialising:
                case a2dp_state_discovering:
                case a2dp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_CLOSE_CFM:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_connected:
                case a2dp_state_streaming:
                case a2dp_state_disconnecting:
                    /* Handle the close cfm message */
                    a2dpSdHandleCloseCfm(&theApp);
                    break;

                case a2dp_state_initiating:
                case a2dp_state_initialising:
                case a2dp_state_discovering:            
                case a2dp_state_accepting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_CLOSE_IND:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_connected:
                case a2dp_state_streaming:
                case a2dp_state_disconnecting:
                    /* Handle the close ind message */
                    a2dpSdHandleCloseInd(&theApp, (A2DP_CLOSE_IND_T *) message);
                    break;

                case a2dp_state_discovering:
                    break;

                case a2dp_state_accepting:
                case a2dp_state_initiating:
                case a2dp_state_initialising:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_SUSPEND_CFM:
            /* Check the local state */
            switch (state_a2dp)
            {
                case a2dp_state_streaming:
                    a2dpSdHandleSuspendCfm(&theApp, (A2DP_SUSPEND_CFM_T *) message);
                    break;

                case a2dp_state_connected:
                case a2dp_state_disconnecting:
                case a2dp_state_accepting:
                case a2dp_state_initiating:
                case a2dp_state_initialising:
                case a2dp_state_discovering:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_SUSPEND_IND:
            /* Check the local state */
            switch (state_a2dp)
            {
				case a2dp_state_connected:
                case a2dp_state_streaming:
                    a2dpSdHandleSuspendInd(&theApp);
                    break;

                case a2dp_state_disconnecting:
                    break;
                              
                case a2dp_state_accepting:
                case a2dp_state_initiating:
                case a2dp_state_initialising:
                case a2dp_state_discovering:
                default:
                    unhandledState(id);
                    break;
            }
            break;

			/* Ignored primitives */
		case A2DP_CODEC_SETTINGS_IND:
			switch (state_a2dp)
            {
				case a2dp_state_connected:
                case a2dp_state_streaming:
				case a2dp_state_initiating:
                case a2dp_state_accepting:
                    a2dpSdHandleCodecSettingsInd(&theApp, ((A2DP_CODEC_SETTINGS_IND_T *) message)->rate);												 
                    break;

                case a2dp_state_disconnecting:                
                case a2dp_state_initialising:
                case a2dp_state_discovering:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case A2DP_CONFIGURE_CFM:
            unhandledState(id);
            break;

        case AVRCP_INIT_CFM:
            /* Check the local state */
            switch (state_avrcp)
            {
                case avrcp_state_initialising:
                    if (((AVRCP_INIT_CFM_T *) message)->status == avrcp_success)
                    {
                        /* Library init OK. Update the local state */
                        avSourceDongleUpdateAvrcpState(avrcp_state_accepting);

                        /* Store the avrcp instance ptr */
                        theApp.avrcp = ((AVRCP_INIT_CFM_T *) message)->avrcp;
                    }
                    else
                        /* The AV RCP lib was not initialised properly - panic */
                        Panic();
                    break;

                case avrcp_state_accepting:
                case avrcp_state_connected:
                case avrcp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case AVRCP_CONNECT_IND:
            /* Check the local state */
            switch (state_avrcp)
            {
                case avrcp_state_accepting:
                    switch (state_a2dp)
                    {
                        case a2dp_state_initiating:
                        case a2dp_state_streaming:
                        case a2dp_state_connected:
                            /* Only accept the RCP connection if we are connected */
                            a2dpSdRcpHandleConnectInd(theApp.avrcp, &theApp.av_sink_addr, (AVRCP_CONNECT_IND_T *) message);
                            break;

                        case a2dp_state_disconnecting:
                        case a2dp_state_accepting:
                        case a2dp_state_discovering:
                            /* If we get anyone initiating an RCP connection while we're in this state just reject it. */
                            a2dpSdRcpHandleConnectIndReject(theApp.avrcp, (AVRCP_CONNECT_IND_T *) message);
                            break;

                        case a2dp_state_initialising:                       
                        default:
                            unhandledState(id);
                            break;
                    }
                    break;

                case avrcp_state_connected:
                case avrcp_state_disconnecting:
                    a2dpSdRcpHandleConnectIndReject(theApp.avrcp, (AVRCP_CONNECT_IND_T *) message);
                    break;

                case avrcp_state_initialising:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case AVRCP_CONNECT_CFM:
            /* Check the local state */
            switch (state_avrcp)
            {
                case avrcp_state_accepting:
                    a2dpSdRcpHandleConnectCfm(&theApp, (AVRCP_CONNECT_CFM_T *) message);
                    break;

                case avrcp_state_initialising:
                case avrcp_state_connected:
                case avrcp_state_disconnecting:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case AVRCP_DISCONNECT_IND:
            /* Check the local state */
            switch (state_avrcp)
            {
                case avrcp_state_connected:
                case avrcp_state_disconnecting:
                    a2dpSdRcpHandleDisconnect(&theApp);
                    break;

                case avrcp_state_accepting:
                case avrcp_state_initialising:
                default:
                    unhandledState(id);
                    break;
            }
            break;

        case AVRCP_PASSTHROUGH_IND:
			a2dpSdRcpHandlePassthroughInd(theApp.avrcp, (AVRCP_PASSTHROUGH_IND_T *) message);
			break;

        case AVRCP_UNITINFO_IND:
            a2dpSdRcpHandleUnitInfoInd(theApp.avrcp, (AVRCP_UNITINFO_IND_T *) message);
            break;

        case AVRCP_SUBUNITINFO_IND:
            a2dpSdRcpHandleSubUnitInfoInd(theApp.avrcp, (AVRCP_SUBUNITINFO_IND_T *) message);
            break;

		case AVRCP_VENDORDEPENDENT_IND:
			a2dpSdRcpHandleVendorDependentInd(theApp.avrcp, (AVRCP_VENDORDEPENDENT_IND_T *) message);
			break;

        case AVRCP_PASSTHROUGH_CFM:
        case AVRCP_UNITINFO_CFM:
        case AVRCP_SUBUNITINFO_CFM:
        case AVRCP_VENDORDEPENDENT_CFM:
            unhandledState(id);
            break;

        case MESSAGE_MORE_DATA:
            {
                /* If this is on the USB source handle it as such */                
                a2dpSdHandleInterfaceEvent(&theApp);
            }
            break;

        default:
            /* Unhandled message */
            unhandledState(id);
            break;
    }
}

⌨️ 快捷键说明

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