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

📄 open.c

📁 蓝牙HANDFREE软件源代码
💻 C
字号:
#include "handsfree_private.h"
#include "handsfree.h"

#include <message.h>


/*
    startReqAction

    This function is called at the beginning of the application and
    sets the ring duration, which defines the duration of a single
    ring.
*/
void startReqAction(uint16 features, uint16 profiles)
{    
    /* Initialise the libs used by this app */
    MAKE_MSG(HS_OPEN_REQ);
    msg->hfSupportedFeatures = features;
    msg->supportedProfiles = profiles;
    putMsg(msg);
}


/*
    hfOpenCfm

    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 hfOpenCfm(const HS_OPEN_CFM_T *cfm)
{
    /* reset state kept about the SLC */
    hfResetConnectionState();

    /* Init the current state */
    setLocalState(idle);
    
    /*  
        If we're paired so go into connectable mode, otherwise let the 
        interface app decide what to do 
    */

    if (cfm->isPaired)
    {        
        connectReqAction();
    }
    else
    {
        /* If not paired perform a hard reset in case the default PIN has not been set */
        resetReqAction();
    }

    /* Respond to a start_req */
    handleOpenCfm(cfm->isPaired);
}

⌨️ 快捷键说明

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