www.pudn.com > headset.rar > open.c


#include "demohs.h" 
 
#include  
#include  
 
 
/* 
    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 
    } 
}