bta_ag_co.h revision 5738f83aeb59361a0a2eda2460113f6dc9194271
1/******************************************************************************
2 *
3 *  Copyright (C) 2003-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 *  This is the interface file for audio gateway call-out functions.
22 *
23 ******************************************************************************/
24#ifndef BTA_AG_CO_H
25#define BTA_AG_CO_H
26
27#include "bta_ag_api.h"
28
29/* Definitions for audio state callout function "state" parameter */
30#define BTA_AG_CO_AUD_STATE_OFF         0
31#define BTA_AG_CO_AUD_STATE_OFF_XFER    1   /* Closed pending transfer of audio */
32#define BTA_AG_CO_AUD_STATE_ON          2
33#define BTA_AG_CO_AUD_STATE_SETUP       3
34
35/*******************************************************************************
36**
37** Function         bta_ag_co_init
38**
39** Description      This callout function is executed by AG when it is
40**                  started by calling BTA_AgEnable().  This function can be
41**                  used by the phone to initialize audio paths or for other
42**                  initialization purposes.
43**
44**
45** Returns          Void.
46**
47*******************************************************************************/
48BTA_API extern void bta_ag_co_init(void);
49
50/*******************************************************************************
51**
52** Function         bta_ag_co_audio_state
53**
54** Description      This function is called by the AG before the audio connection
55**                  is brought up, after it comes up, and after it goes down.
56**
57** Parameters       handle - handle of the AG instance
58**                  state - Audio state
59**                      BTA_AG_CO_AUD_STATE_OFF      - Audio has been turned off
60**                      BTA_AG_CO_AUD_STATE_OFF_XFER - Audio is closed pending transfer
61**                      BTA_AG_CO_AUD_STATE_ON       - Audio has been turned on
62**                      BTA_AG_CO_AUD_STATE_SETUP    - Audio is about to be turned on
63**
64** Returns          void
65**
66*******************************************************************************/
67BTA_API extern void bta_ag_co_audio_state(UINT16 handle, UINT8 app_id, UINT8 state);
68
69/*******************************************************************************
70**
71** Function         bta_ag_co_data_open
72**
73** Description      This function is executed by AG when a service level connection
74**                  is opened.  The phone can use this function to set
75**                  up data paths or perform any required initialization or
76**                  set up particular to the connected service.
77**
78**
79** Returns          void
80**
81*******************************************************************************/
82BTA_API extern void bta_ag_co_data_open(UINT16 handle, tBTA_SERVICE_ID service);
83
84/*******************************************************************************
85**
86** Function         bta_ag_co_data_close
87**
88** Description      This function is called by AG when a service level
89**                  connection is closed
90**
91**
92** Returns          void
93**
94*******************************************************************************/
95BTA_API extern void bta_ag_co_data_close(UINT16 handle);
96
97/*******************************************************************************
98**
99** Function         bta_ag_co_tx_write
100**
101** Description      This function is called by the AG to send data to the
102**                  phone when the AG is configured for AT command pass-through.
103**                  The implementation of this function must copy the data to
104**                  the phone�s memory.
105**
106** Returns          void
107**
108*******************************************************************************/
109BTA_API extern void bta_ag_co_tx_write(UINT16 handle, UINT8 *p_data, UINT16 len);
110
111#endif /* BTA_AG_CO_H */
112
113