?? call.c
字號:
#include "handsfree_private.h"
#include "handsfree.h"
#include <message.h>
#include <stdlib.h>
/*
callTransferReqAction
Transfer audio connection from AG to HF. The HF must create the
SCO and also connect if a connection doesn't already exist.
*/
void callTransferReqAction(uint16 pkt_type)
{
/* TODO might be handy if we check whether there is an active call */
/* Reset pending flag */
HFstate.audioTransferPending = 0;
/* check if we're connected and if not create RFCOMM before initiating SCO */
if (HFstate.connectState == connected)
{
createSCO(pkt_type);
}
else if (HFstate.connectState == scoConnected)
{
hfSendDisconnectMessage(ScoLink);
}
else if ((HFstate.connectState == idle) ||
(HFstate.connectState == connectingAsSlave))
{
HFstate.SCOpktType = pkt_type;
HFstate.audioTransferPending = 1;
/* Try to create an RFCOMM connection */
connectReqAction();
}
else if (HFstate.connectState == connectingAsMaster)
{
/* Its already trying to connect so just set the flags */
HFstate.SCOpktType = pkt_type;
HFstate.audioTransferPending = 1;
}
else
{
/* In any other mode send an error to the driver */
handleErrorInd(HfErrorUnknownOrUnhandledState);
}
}
/*
callAnswerAction
Accept an incoming call.
*/
void callAnswerAction(void)
{
MAKE_MSG(HANDSFREE_CALL_RESPONSE_REQ);
msg->accept_flag = 1;
putMsg(msg);
/* Reset the ringing flag */
HFstate.ringing = 0;
}
/*
callRejectAction
Reject an incoming call.
*/
void callRejectAction(void)
{
MAKE_MSG(HANDSFREE_CALL_RESPONSE_REQ);
msg->accept_flag = 0;
putMsg(msg);
/* Reset the ringing flag */
HFstate.ringing = 0;
}
/*
hfCallerIdInd
Caller id unsolicited result code received from the AG
*/
void hfCallerIdInd(const HANDSFREE_CALLER_ID_IND_T *ind)
{
/* Inform the interface */
handleCallerIdInd(ind->length, ind->caller_id);
/* Free the memory allocated */
if (ind->length)
free(ind->caller_id);
}
/*
hfCallerIdEnableAction
Enable or disable the AG sending us the caller id
*/
void hfCallerIdEnableAction(uint16 en)
{
MAKE_MSG(HANDSFREE_CALLER_ID_ENABLE_REQ);
msg->enable = en;
putMsg(msg);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -