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

📄 open.c

📁 蓝牙耳机软件源代码
💻 C
字号:
#include "demohs.h"

#include <message.h>
#include <timer.h>


/*
    This function is called at the beginning of the application and
    sets the ring duration, which defines how long the headset will
    ring for an incoming call.
*/
void openReq(void)
{
    /* 
        Create a headset message primitive and put the message 
        in the sceduler queue 
    */
    MAKE_MSG(HS_OPEN_REQ);
	msg->hfSupportedFeatures = 0;
    msg->supportedProfiles = frameworkHeadset;
    putMsg(msg);
}


/*
    openCfm

    Called to indicate that the headset framework has completed
    initialisation.  If we are not already paired, go straight into a
    pairing attempt.  Otherwise, just go idle.
*/
void openCfm(const HS_OPEN_CFM_T* cfm)
{
    hsState.pairingPending = 0;

    if (!cfm->isPaired)
    {
        /*
            If the headset is not paired, immediately jump into the
            pairing procedure using a reset request in case the default 
            PIN has not been set.
        */
        resetReq();
    }
    else
    {
        updateHsConnectState(idle);

#ifdef DEV_BOARD_HS
        talkButton();   /* Enable to be always connectable */
#endif
    }
}

⌨️ 快捷键说明

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