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

📄 ag.h

📁 bluetooth audio gateway
💻 H
字号:
#ifndef _AG_H
#define _AG_H

#include "ag_types.h"

#include <cm_rfcomm.h>

/* TODO remove use of cm_rfcomm.h from this file */




/* Functions provided by the AG and called from the interface */

/* ag_open.c - start up the AG and initialize the connection manager */
void startReqAction(uint16 hfSuppFeatures, ag_profile_role_t profiles);

/* ag_inquire.c - request to start an inquiry */
void inquiryReqAction(uint8 num_responses, uint16 timeout, uint32 CoD_filter, uint16 rnr_en);

/* ag_pair.c - request to initiate pairing */
void pairReqAction(bd_addr_t addr, bool_t auth, uint16 timeout);

/* ag_pair.c - response containing a PIN code when pairing */
void pinResAction(bd_addr_t addr, uint8 pin_len, const uint8 *pin);

/* ag_pair.c - response containing the link key when authenticating */
void linkKeyResAction(bool_t accept, uint16 handle, const uint8 *key);

/* ag_pair.c - request to register a device with the security manager */
void agSmAddDeviceReqAction(bd_addr_t addr, bool_t trust, const uint8 *key);

/* ag_connect.c - request to initiate a connection to a specific remote device */
void agConnectAsMasterReqAction(bd_addr_t addr, const ag_auth_config_t *use, const ag_park_config_t *park, const ag_sniff_config_t *sniff, uint16 target, timeout_t timeout);

/* ag_connect.c - request to become connactable so remote device can connect to us */
void agConnectAsSlaveReqAction(bd_addr_t addr, const ag_auth_config_t *use, const ag_park_config_t *park, const ag_sniff_config_t *sniff, timeout_t timeout, uint16 ps_ival, uint16 ps_win);

/* ag_connect.c - request to open a SCO connection */
void agScoConnectReqAction(ag_handle_t handle, pkt_type_t type);

/* ag_connect.c - request to disconnect an RFCOMM connection */
void agRfcommDisconnectReqAction(ag_handle_t handle);

/* ag_connect.c - request to disconnect a SCO connection */
void agScoDisconnectReqAction(ag_handle_t handle);

/* ag_ring.c - request to send one or more ring commands */
void agRingReqAction(timeout_t repetition_rate, uint8 number_rings);

/* ag_volume.c - request to send a volume command */
void agVolumeChangeReqAction(int8 increment, uint8 gain);

/* ag_microphone.c - send a request to set the microphone gain */
void agMicChangeReqAction(uint8 gain);

/* ag_data.c - request to send custom defined data over rfcomm */
void agDataReqAction(uint16 length, const uint8 *data);

/* ag_atreply.c - send a call ind to indicate the call is active */
void agCallStatusReqAction(uint16 status);

/* ag_atreply.c - send a call_setup ind to indicate the call is being established */
void agCallSetupReqAction(ag_call_setup_vals_t call_setup);

/* ag_atreply.c - send a service registration indication to the hands free */
void agServiceStatusReqAction(uint16 status);

/* ag_error.c - cancel the current state */
void agCancelReqAction(void);

/* ag_state.c - check if there is an RFCOMM connection up */
uint16 agRfcommConnectedQuery(void);

/* ag_state.c - check if there is an SCO connection up */
uint16 agScoConnectedQuery(void);

/* ag_state.c - check if the AG is curently idle */
uint16 agIdleQuery(void);



/* Functions to be implemented by the interface to the AG */

/* Notification of a start cfm i.e. everything ready to go */
void handleStartCfm(void);

/* Inquiry result */
void handleInquiryResultInd(const CM_INQUIRY_RESULT_IND_T *ind);

/* Inquiry has completed */
void handleInquiryCompleteCfm(ag_inquiry_status_t status);

/* Pin code request */
void handlePinReq(BD_ADDR_T addr);

/* Link key request */
void handleLinkKeyReq(uint16 handle);

/* Pair confirm */
void handlePairCfm(BD_ADDR_T addr, ag_pair_status_t status, const uint8 *link_key);

/* Informs which conn handle has been assigned to the conn to this device*/
void handleConnectionHandleMap(uint16 hdl, bd_addr_t addr);

/* Informs of a change in the status of a SCO connection */
void handleScoStatusInd(ag_handle_t hdl, ag_connection_status_t status, hci_connection_handle_t sco_handle);

/* Informs of a change in the status of an RFCOMM connection */
void handleRfcommStatusInd(ag_handle_t hdl, ag_connection_status_t status, ag_profile_role_t role);

/* Informs of a change in the volume settings */
void handleVolumeChangeInd(ag_handle_t hdl, uint8 gain);

/* Inform of a change in the microphone settings */
void handleMicrophoneChangeInd(ag_handle_t hdl, uint8 gain);

/* Button press received from the remote device */
void handleButtonPressInd(ag_handle_t hdl);

/* A response to the call alert has been received */
void handleCallAnsweredInd(ag_handle_t hdl, uint16 accept_flag);

/* Dial request received from remote device */
void handleRemoteDialReq(ag_handle_t hdl, dial_mode_t dial_what, uint16 length, const uint8 *data);

/* An error (or a warning) has occurred */
void handleErrorInd(ag_handle_t hdl, ag_error_code_t error_reason);

/* Received RFCOMM data that could not be parsed by parser so pass to client to handle */
void handleUnparsedData(ag_handle_t hdl, uint16 length, const uint8 *data);

/* Received voice recognition enable/ disable command */
void handleVoiceRecognitionInd(ag_handle_t hdl, uint16 status);


#endif

⌨️ 快捷键说明

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