?? ag_private.h
字號:
#ifndef _AG_PRIVATE_H
#define _AG_PRIVATE_H
#include "ag_types.h"
#include <ccltypes.h>
#include <bluetooth.h>
#include <cm_rfcomm.h>
#include <sink.h>
#include <source.h>
#include <timer.h>
/* possible EAG states */
typedef enum
{
AgIdle,
AgInquiring,
AgPairing,
AgConnecting,
AgConnected,
AgScoConnected
} ag_state_t;
/*
Store some EAG state. Members prefixed with HF are specific to hands free
device connections while those prefixed with HS to the headset. Some are
used for both and hence have no prefix
*/
struct agStruct
{
uint16 agHsServerChan:8;
uint16 agHfServerChan:8; /* 16 */
uint16 speakerGain:4;
ag_state_t currentState:3;
ag_profile_role_t currentProfile:2;
ag_profile_role_t supportedProfiles:2;
uint16 hfSupportedFeatures:5; /* 16 */
uint16 hfIndicatorUpdateEnabled:1;
uint16 hfServiceIndicator:1;
uint16 hfCallIndicator:1;
uint16 rings_outstanding:4;
uint16 ringContinuous:1;
ag_profile_role_t roles_tried:2;
uint16 hfVoiceRecogEnable:1; /* 11 */
uint16 hfAgSupportedFeatures;
Delay RingDuration;
Source rfcDataIncoming;
Sink rfcDataOutgoing;
BD_ADDR_T remote_addr;
};
extern struct agStruct AGState;
/*
For now do not include a minor dev class as this ag can be embedded into
different types of phone e.g. cellular, smart. cordless etc.
*/
#define EAG_COD ( ( (uint32) 1<<21) | (1<<9) )
/*
These are the persistent store keys used by the Embedded Audio Gateway
NOTE the AG_INTERFACE_PS_BASE (in ag_types.h) needs to be updated if
new PS keys are added to this list. This base is used by the interface
files as the base from which to define their PS keys so needs to be
kept up to date or keys will be overwritten
*/
#define AG_PS_BASE 0
#define AG_PS_LINK_KEY (AG_PS_BASE+0)
/* TODO rearrange these */
/* Start-up and initialization related */
/* ag_main.c - send a message to the connection manager */
void agPutCmMsg(void * msg);
/* ag_open.c - open the connection manager */
void agInitCfm(void);
/* ag_open.c - register other service record if necessary */
void agServiceRegisterCfm(const CM_SERVICE_REGISTER_CFM_T *cfm);
/* ag_serviceRecord.c - return a service record for the ag */
uint8 *agCreateServiceRecord(uint16 *len, ag_profile_role_t dev_type);
/* Inquiry related */
/* ag_inquire.c - Inquiry completed */
void agInquiryCompleteCfm(const CM_INQUIRY_COMPLETE_CFM_T *cfm);
/* Pairing related */
/* ag_pair.c - pairing completed indication */
void agPairCfm(const CM_PAIR_CFM_T *cfm);
/* ag_pair.c - pin code request */
void agPinCodeReq(const CM_PIN_CODE_REQ_T *req);
/* ag_pair.c - link key request */
void agLinkKeyReq(const CM_LINK_KEY_REQ_T *req);
/* Connection (RFCOMM and SCO) related */
/* ag_connect.c - outcome of the connection attempt */
void agConnectCfm(const CM_CONNECT_CFM_T *cfm);
/* ag_connect.c - indication that the RFCOMM connection has been disconnected */
void agRfcommStatusInd(const CM_CONNECT_STATUS_IND_T *ind);
/* ag_connect.c - indication of a change in the status of a SCO connection */
void agScoStatusInd(const CM_SCO_STATUS_IND_T *ind);
/* ag_connect.c - attempt to create a SCO connection */
void agCreateSco(BD_ADDR_T addr, pkt_type_t pkt);
/* ag_connect.c - send the client the reported status of the RFCOMM conn */
void agSendStatusIndToClient(BD_ADDR_T dev_addr, connect_status_t status);
/* ag_connect.c - create the array holding the address to connection handle mapping */
void createAddressHandleMap(void);
/* ag_connect.c - given a device address return the handle corresponding to the connection to that device */
ag_handle_t agGetConnectionHandle(const BD_ADDR_T *addr);
/* ag_connect.c - service we were looking for is not supported by remote device */
void agUnsupportedServiceInd(CM_UNSUPPORTED_SERVICE_IND_T *ind);
/* ag_sdpExtra.c - request for an additional SDP search */
void agGetExtraSdpInfo(void);
/* ag_sdpExtra.c - results of additional SDP search */
void agSdpFeaturesCfm(const CM_SDP_SUPPORTED_FEATURES_CFM_T *cfm);
/* ag_ring.c - request to stop sending ring commands */
void agStopRings(void);
/* ag_volume.c - indication that the volume settings have changed */
void agVolumeChangeInd(BD_ADDR_T addr, uint16 gain);
/* ag_volume.c - send the current volume settings */
void agSendVolume(void);
/* ag_microphone.c - handle a request to set the microphone gain */
void agMicChangeInd(BD_ADDR_T addr, uint16 gain);
/* ag_data.c - sends an AT cmd to cm for transmission */
uint16 agSendATmessage(const char *at_cmd, uint16 length);
/* ag_data.c - button press indication received */
void agButtonPressInd(BD_ADDR_T addr);
/* ag_atreply.c - generate OK response */
void agSendOk(void);
/* ag_atreply.c - generate error response */
void agSendError(void);
/* ag_atreply.c - send status of service indicator */
void agSendServiceInd(uint16 value);
/* ag_atreply.c - send status of call indicator */
void agSendCallInd(uint16 value);
/* ag_atreply.c - send status of call setup indicator */
void agSendCallSetupInd(ag_call_setup_vals_t value);
/* ag_atConnect.c - generate response to CIND test cmd*/
void agSendCindTestResponse(void);
/* ag_atConnect.c - generate response to CIND read cmd */
void agSendCindReadResponse(void);
/* ag_atConnect - send current call hold settings */
void agSendCallHoldSettings(void);
/* ag_dial.c - the remote end has accpeted the call */
void agCallAnswered(BD_ADDR_T addr);
/* ag_dial.c - the remote end has accpeted the call or wants to terminate it */
void agCallRejected(BD_ADDR_T addr);
/* ag_dial.c - request to dial the given number */
void agReceivedDialNumber(BD_ADDR_T addr, const uint8 *num_data, uint16 length);
/* ag_dial.c - request to dial the number in the given memory location */
void agReceivedMemoryDial(BD_ADDR_T addr, const uint8 *mem_data, uint16 length);
/* ag_dial.c - request to redial the last number dialled */
void agReceivedLastNumberRedial(BD_ADDR_T addr);
/* ag_error.c - error received from the connection manager */
void agErrorInd(const CM_ERROR_IND_T *msg);
/* ag_error.c - tell the client about the error */
void agSendErrorToClient(ag_error_code_t error_reason, const BD_ADDR_T *rem_device);
/* ag_alloc.c - memory allocation, panic on failure */
void *agAlloc(uint16 sz);
/* ag_state.c - set the current connect state of the AG */
void agSetCurrentState(ag_state_t new_state);
/* ag_state.c - set the current profile role of the AG */
void agSetCurrentProfile(ag_profile_role_t new_role);
/* ag_state.c - is the AG currently in headset mode */
uint16 agIsCurrentlyHeadset(void);
/* ag_state.c - is the AG currently in hands free mode */
uint16 agIsCurrentlyHandsFree(void);
/* ag_state.c - set the supported profiles */
void agSetSupportedProfiles(ag_profile_role_t profs);
/* ag_state.c - is the headset profile supported */
uint16 agIsHeadsetSupported(void);
/* ag_state.c - is the hands free profile supported */
uint16 agIsHandsFreeSupported(void);
/* ag_voice.c - voice recognition enabled/ disabled */
void agVoiceRecognitionEnable(uint16 en);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -