Exemplo n.º 1
0
/****************************************************************************
NAME    
    sinkDialStoredNumber
    
DESCRIPTION
	Dials a number stored in CONFIG_PHONE_NUMBER
    If HFP and connected - issues command
    If HFP and not connected - connects and issues if not in call
    If HSP sends button press


RETURNS
    void
*/
void sinkDialStoredNumber ( void )
{	
    uint16 ret_len;
	Sink   sink;
    uint16 phone_number_key[SIZE_CONFIG_PHONE_NUMBER];
    
	CM_DEBUG(("sinkDialStoredNumber\n")) ;
    
    if ((ret_len = ConfigRetrieve(CONFIG_PHONE_NUMBER, phone_number_key, SIZE_CONFIG_PHONE_NUMBER )))
	{        
        if((HfpLinkGetSlcSink(hfp_primary_link, &sink)) && SinkIsValid(sink))
        {
            /* Send the dial request now */
            CM_DEBUG(("CM:Dial Stored Number (Connected) len=%x\n",ret_len)) ;  
            HfpDialNumberRequest(hfp_primary_link, ret_len, (uint8 *)&phone_number_key[0]);  
        }
        else
        {
            /* Not connected, connect and queue the dial request */
#ifdef ENABLE_AVRCP
            sinkAvrcpCheckManualConnectReset(NULL);
#endif            
            MessageSend ( &theSink.task , EventUsrEstablishSLC , 0 ) ;
            sinkQueueEvent( EventUsrDialStoredNumber ) ;
        }
    }
    else
	{
        /*The PSKEY could not be read*/
        MessageSend(&theSink.task, EventUsrUpdateStoredNumber, 0);
    }
}
Exemplo n.º 2
0
static bool handlePbapDialDate(const char* pVcard, const uint8 vcardLen)
{
    uint8 telLen = 1;
    char* pTel = 0;               
    bool success = FALSE;
    
  	/* Process Data to find telephone number*/
    telLen = VcardGetFirstTel((char*)pVcard, vcardLen, &pTel);
    
    if(telLen)
    {
        PBAP_DEBUG(("handlePbapDial:dialling from PBAP Phonebook\n"));
    
        theHeadset.pbap_dial_state = pbapc_dialled;

        HfpDialNumberRequest(hfp_primary_link, telLen, (uint8 *)pTel);
               
        success = TRUE;
   }
    else
    {
         /* error, number not found */   
         PBAP_DEBUG(("handlePbapDial:no number found to dial in VCARD\n"));
    }
    
    return(success);
}