bta_jv_api.h revision 58d57a46cbe38e0ab70d4f2333dd381ff89342b0
15738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************
25738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
35738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Copyright (C) 2006-2012 Broadcom Corporation
45738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
55738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Licensed under the Apache License, Version 2.0 (the "License");
65738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  you may not use this file except in compliance with the License.
75738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  You may obtain a copy of the License at:
85738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
95738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  http://www.apache.org/licenses/LICENSE-2.0
105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Unless required by applicable law or agreed to in writing, software
125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  distributed under the License is distributed on an "AS IS" BASIS,
135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  See the License for the specific language governing permissions and
155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  limitations under the License.
165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/
185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************
205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  This is the public interface file the BTA Java I/F
225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/
245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTA_JV_API_H
255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define BTA_JV_API_H
265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "bt_target.h"
285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "bt_types.h"
295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "bta_api.h"
305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "btm_api.h"
318372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz#include "l2c_api.h"
328372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
33713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski#ifdef __cplusplus
34713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowskiextern "C" {
35713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski#endif
36713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski
375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*****************************************************************************
388af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *  Constants and data types
398af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ****************************************************************************/
405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* status values */
41cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SUCCESS 0     /* Successful operation. */
42cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_FAILURE 1     /* Generic failure. */
43cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_BUSY 2        /* Temporarily can not handle this request. */
44cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_NO_DATA 3     /* no data. */
45cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_NO_RESOURCE 4 /* No more set pm control block */
465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
47e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint8_t tBTA_JV_STATUS;
48cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_INTERNAL_ERR (-1) /* internal error. */
49cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson
50cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_UUIDS SDP_MAX_UUID_FILTERS
51cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_ATTRS SDP_MAX_ATTR_FILTERS
52cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_SDP_REC SDP_MAX_RECORDS
53cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_L2C_CONN                                                    \
54cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  GAP_MAX_CONNECTIONS /* GAP handle is used as index, hence do not change this \
55cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                         value */
56cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_SCN \
57cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  PORT_MAX_RFC_PORTS /* same as BTM_MAX_SCN (in btm_int.h) */
58cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_RFC_CONN MAX_RFC_PORTS
595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTA_JV_DEF_RFC_MTU
61cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_DEF_RFC_MTU (3 * 330)
625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTA_JV_MAX_RFC_SR_SESSION
65cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_RFC_SR_SESSION MAX_BD_CONNECTIONS
665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BTA_JV_MAX_RFC_SR_SESSION can not be bigger than MAX_BD_CONNECTIONS */
695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#if (BTA_JV_MAX_RFC_SR_SESSION > MAX_BD_CONNECTIONS)
705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#undef BTA_JV_MAX_RFC_SR_SESSION
71cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_RFC_SR_SESSION MAX_BD_CONNECTIONS
725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define BTA_JV_FIRST_SERVICE_ID BTA_FIRST_JV_SERVICE_ID
75cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_LAST_SERVICE_ID BTA_LAST_JV_SERVICE_ID
76cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_NUM_SERVICE_ID \
77cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  (BTA_LAST_JV_SERVICE_ID - BTA_FIRST_JV_SERVICE_ID + 1)
785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Discoverable modes */
80cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsonenum { BTA_JV_DISC_NONE, BTA_JV_DISC_LIMITED, BTA_JV_DISC_GENERAL };
81e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint16_t tBTA_JV_DISC;
825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
83cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_ROLE_SLAVE BTM_ROLE_SLAVE
84cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_ROLE_MASTER BTM_ROLE_MASTER
85e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint32_t tBTA_JV_ROLE;
865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
87cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_LMTD_DISCOVER                                       \
88cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTM_COD_SERVICE_LMTD_DISCOVER                                  /* 0x0020 \
89cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                                                    */
90cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_POSITIONING BTM_COD_SERVICE_POSITIONING   /* 0x0100 */
91cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_NETWORKING BTM_COD_SERVICE_NETWORKING     /* 0x0200 */
92cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_RENDERING BTM_COD_SERVICE_RENDERING       /* 0x0400 */
93cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_CAPTURING BTM_COD_SERVICE_CAPTURING       /* 0x0800 */
94cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_OBJ_TRANSFER BTM_COD_SERVICE_OBJ_TRANSFER /* 0x1000 */
95cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_AUDIO BTM_COD_SERVICE_AUDIO               /* 0x2000 */
96cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_TELEPHONY BTM_COD_SERVICE_TELEPHONY       /* 0x4000 */
97cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_INFORMATION BTM_COD_SERVICE_INFORMATION   /* 0x8000 */
985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
992f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* JV ID type */
100cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ID_1 1     /* PM example profile 1 */
101cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ID_2 2     /* PM example profile 2 */
102cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ID_CLEAR 0 /* Special JV ID used to clear PM profile */
103cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ALL 0xFF   /* Generic match all id, see bta_dm_cfg.c */
104e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint8_t tBTA_JV_PM_ID;
1055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
106cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_HANDLE_CLEAR \
107cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  0xFF /* Special JV ID used to clear PM profile  */
1082f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
109cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson/* define maximum number of registered PM entities. should be in sync with bta
110cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * pm! */
1112f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta#ifndef BTA_JV_PM_MAX_NUM
1122f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta#define BTA_JV_PM_MAX_NUM 5
1132f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta#endif
1142f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
1152f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* JV pm connection states */
116cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsonenum {
117cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_OPEN = 0, /* Connection opened state */
118cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_CLOSE,    /* Connection closed state */
119cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_APP_OPEN,      /* JV Application opened state */
120cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_APP_CLOSE,     /* JV Application closed state */
121cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_SCO_OPEN,      /* SCO connection opened state */
122cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_SCO_CLOSE,     /* SCO connection opened state */
123cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_IDLE,     /* Connection idle state */
124cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_BUSY,     /* Connection busy state */
125cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_MAX_CONN_STATE /* Max number of connection state */
1262f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta};
127e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint8_t tBTA_JV_CONN_STATE;
1285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1298372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* JV Connection types */
130cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CONN_TYPE_RFCOMM 0
131cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CONN_TYPE_L2CAP 1
132cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CONN_TYPE_L2CAP_LE 2
1338372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
1345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Java I/F callback events */
1355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* events received by tBTA_JV_DM_CBACK */
136cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_ENABLE_EVT 0         /* JV enabled */
137cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_GET_SCN_EVT 6        /* Reserved an SCN */
138cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_GET_PSM_EVT 7        /* Reserved a PSM */
139cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_DISCOVERY_COMP_EVT 8 /* SDP discovery complete */
140cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CREATE_RECORD_EVT 11 /* the result for BTA_JvCreateRecord */
1418372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* events received by tBTA_JV_L2CAP_CBACK */
142cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_OPEN_EVT 16     /* open status of L2CAP connection */
143cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_CLOSE_EVT 17    /* L2CAP connection closed */
144cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_START_EVT 18    /* L2CAP server started */
145cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_CL_INIT_EVT 19  /* L2CAP client initiated a connection */
146cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_DATA_IND_EVT 20 /* L2CAP connection received data */
147cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_CONG_EVT \
148cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  21 /* L2CAP connection congestion status changed */
149cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_READ_EVT 22  /* the result for BTA_JvL2capRead */
150cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_WRITE_EVT 24 /* the result for BTA_JvL2capWrite*/
151cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_WRITE_FIXED_EVT \
152cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  25 /* the result for BTA_JvL2capWriteFixed */
1535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* events received by tBTA_JV_RFCOMM_CBACK */
155cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_OPEN_EVT                                                \
156cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  26                               /* open status of RFCOMM Client connection \
157cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                      */
158cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_CLOSE_EVT 27 /* RFCOMM connection closed */
159cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_START_EVT 28 /* RFCOMM server started */
160cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_CL_INIT_EVT                                             \
161cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  29                                  /* RFCOMM client initiated a connection \
162cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                         */
163cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_DATA_IND_EVT 30 /* RFCOMM connection received data */
164cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_CONG_EVT \
165cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  31 /* RFCOMM connection congestion status changed */
166cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_WRITE_EVT 33 /* the result for BTA_JvRfcommWrite*/
167cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_SRV_OPEN_EVT \
168cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  34                      /* open status of Server RFCOMM connection */
169cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_EVT 35 /* max number of JV events */
1705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
171e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint16_t tBTA_JV_EVT;
1725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_SET_DISCOVER_EVT */
174cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
175cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status;  /* Whether the operation succeeded or failed. */
176cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_DISC disc_mode; /* The current discoverable mode */
1775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_SET_DISCOVER;
1785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_DISCOVERY_COMP_EVT_ */
180cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
181cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
182cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int scn;               /* channel # */
1835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_DISCOVERY_COMP;
1845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_CREATE_RECORD_EVT */
186cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
187cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
1885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_CREATE_RECORD;
1895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1908372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_OPEN_EVT */
191cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
192cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
193cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
194cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BD_ADDR rem_bda;       /* The peer address */
195cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int32_t tx_mtu;        /* The transmit MTU */
1968372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_OPEN;
1978372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
1988372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_OPEN_EVT for LE sockets */
199cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
200cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
201cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
202cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BD_ADDR rem_bda;       /* The peer address */
203cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int32_t tx_mtu;        /* The transmit MTU */
204cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  void** p_p_cback;      /* set them for new socket */
205cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  void** p_user_data;    /* set them for new socket */
2068372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2078372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_LE_OPEN;
2088372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2098372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_CLOSE_EVT */
210cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
211cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
212cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
213cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool async;            /* false, if local initiates disconnect */
2148372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_CLOSE;
2158372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2168372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_START_EVT */
217cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
218cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
219cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
220cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this server */
2218372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_START;
2228372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2238372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_CL_INIT_EVT */
224cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
225cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
226cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
227cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this client */
2288372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_CL_INIT;
2298372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2308372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_CONG_EVT */
231cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
232cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
233cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
234cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* true, congested. false, uncongested */
2358372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_CONG;
2368372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2378372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_READ_EVT */
238cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
239cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
240cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
241cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvL2capRead() */
242cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t* p_data;       /* This points the same location as the p_data
243cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                        * parameter in BTA_JvL2capRead () */
244cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t len;          /* The length of the data read. */
2458372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_READ;
2468372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2478372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_WRITE_EVT */
248cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
249cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
250cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
251cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvL2capWrite() */
252cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t len;          /* The length of the data written. */
253135db4f34477342b53242abfe9beec0262854389Ajay Panicker  uint8_t* p_data;       /* The buffer where data is held */
254cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* congestion status */
2558372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_WRITE;
2568372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2578372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_WRITE_FIXED_EVT */
258cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
259cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
260cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t channel;      /* The connection channel */
261cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BD_ADDR addr;          /* The peer address */
262cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvL2capWrite() */
263135db4f34477342b53242abfe9beec0262854389Ajay Panicker  uint8_t* p_data;       /* The buffer where data is held */
264cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t len;          /* The length of the data written. */
265cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* congestion status */
2668372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_WRITE_FIXED;
2678372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_OPEN_EVT */
269cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
270cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
271cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
272cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BD_ADDR rem_bda;       /* The peer address */
2735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_OPEN;
2745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_SRV_OPEN_EVT */
275cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
276cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status;      /* Whether the operation succeeded or failed. */
277cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;            /* The connection handle */
278cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t new_listen_handle; /* The new listen handle */
279cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BD_ADDR rem_bda;            /* The peer address */
2805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_SRV_OPEN;
2815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_CLOSE_EVT */
283cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
284cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
285cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t port_status;  /* PORT status */
286cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
287cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool async;            /* false, if local initiates disconnect */
2885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_CLOSE;
2895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_START_EVT */
291cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
292cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
293cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
294cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this server */
295cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool use_co;           /* true to use co_rfc_data */
2965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_START;
2975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_CL_INIT_EVT */
299cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
300cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
301cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
302cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this client */
303cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool use_co;           /* true to use co_rfc_data */
3045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_CL_INIT;
3055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*data associated with BTA_JV_L2CAP_DATA_IND_EVT & BTA_JV_RFCOMM_DATA_IND_EVT */
306cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
307cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle; /* The connection handle */
3085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_DATA_IND;
3095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3108372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*data associated with BTA_JV_L2CAP_DATA_IND_EVT if used for LE */
311cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
312cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle; /* The connection handle */
313cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BT_HDR* p_buf;   /* The incoming data */
3148372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_LE_DATA_IND;
3158372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
3165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_CONG_EVT */
317cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
318cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
319cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
320cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* true, congested. false, uncongested */
3215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_CONG;
3225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_WRITE_EVT */
324cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
325cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
326cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
327cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvRfcommWrite() */
328cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int len;               /* The length of the data written. */
329cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* congestion status */
3305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_WRITE;
3315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3322f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* data associated with BTA_JV_API_SET_PM_PROFILE_EVT */
333cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
334cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Status of the operation */
335cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* Connection handle */
336cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_PM_ID app_id;  /* JV app ID */
3372f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta} tBTA_JV_SET_PM_PROFILE;
3382f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
3392f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* data associated with BTA_JV_API_NOTIFY_PM_STATE_CHANGE_EVT */
340cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
341cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;          /* Connection handle */
342cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_CONN_STATE state; /* JV connection stata */
3432f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta} tBTA_JV_NOTIFY_PM_STATE_CHANGE;
3442f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
3455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* union of data associated with JV callback */
346cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef union {
347cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status;                     /* BTA_JV_ENABLE_EVT */
348cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_DISCOVERY_COMP disc_comp;          /* BTA_JV_DISCOVERY_COMP_EVT */
349cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_SET_DISCOVER set_discover;         /* BTA_JV_SET_DISCOVER_EVT */
350cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t scn;                               /* BTA_JV_GET_SCN_EVT */
351cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t psm;                              /* BTA_JV_GET_PSM_EVT */
352cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_CREATE_RECORD create_rec;          /* BTA_JV_CREATE_RECORD_EVT */
353cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_OPEN l2c_open;               /* BTA_JV_L2CAP_OPEN_EVT */
354cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_CLOSE l2c_close;             /* BTA_JV_L2CAP_CLOSE_EVT */
355cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_START l2c_start;             /* BTA_JV_L2CAP_START_EVT */
356cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_CL_INIT l2c_cl_init;         /* BTA_JV_L2CAP_CL_INIT_EVT */
357cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_CONG l2c_cong;               /* BTA_JV_L2CAP_CONG_EVT */
358cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_READ l2c_read;               /* BTA_JV_L2CAP_READ_EVT */
359cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_WRITE l2c_write;             /* BTA_JV_L2CAP_WRITE_EVT */
360cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_OPEN rfc_open;              /* BTA_JV_RFCOMM_OPEN_EVT */
361cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_SRV_OPEN rfc_srv_open;      /* BTA_JV_RFCOMM_SRV_OPEN_EVT */
362cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_CLOSE rfc_close;            /* BTA_JV_RFCOMM_CLOSE_EVT */
363cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_START rfc_start;            /* BTA_JV_RFCOMM_START_EVT */
364cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_CL_INIT rfc_cl_init;        /* BTA_JV_RFCOMM_CL_INIT_EVT */
365cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_CONG rfc_cong;              /* BTA_JV_RFCOMM_CONG_EVT */
366cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_WRITE rfc_write;            /* BTA_JV_RFCOMM_WRITE_EVT */
367cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_DATA_IND data_ind;                 /* BTA_JV_L2CAP_DATA_IND_EVT
368cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                                BTA_JV_RFCOMM_DATA_IND_EVT */
369cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_LE_DATA_IND le_data_ind;           /* BTA_JV_L2CAP_LE_DATA_IND_EVT */
370cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_LE_OPEN l2c_le_open;         /* BTA_JV_L2CAP_OPEN_EVT */
371cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_WRITE_FIXED l2c_write_fixed; /* BTA_JV_L2CAP_WRITE_FIXED_EVT */
3725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV;
3735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* JAVA DM Interface callback */
375cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef void(tBTA_JV_DM_CBACK)(tBTA_JV_EVT event, tBTA_JV* p_data,
37658d57a46cbe38e0ab70d4f2333dd381ff89342b0Ajay Panicker                               uint32_t id);
3775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* JAVA RFCOMM interface callback */
379cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef void*(tBTA_JV_RFCOMM_CBACK)(tBTA_JV_EVT event, tBTA_JV* p_data,
380cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    void* user_data);
3815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3828372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* JAVA L2CAP interface callback */
383cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef void(tBTA_JV_L2CAP_CBACK)(tBTA_JV_EVT event, tBTA_JV* p_data,
384cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  void* user_Data);
3858372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
3865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* JV configuration structure */
387cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
388cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t sdp_raw_size;       /* The size of p_sdp_raw_data */
389cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t sdp_db_size;        /* The size of p_sdp_db */
390cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t* p_sdp_raw_data;     /* The data buffer to keep raw data */
391cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tSDP_DISCOVERY_DB* p_sdp_db; /* The data buffer to keep SDP database */
3925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_CFG;
3935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
3958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
3968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvEnable
3978af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
3988af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Enable the Java I/F service. When the enable
3998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  operation is complete the callback function will be
4008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with a BTA_JV_ENABLE_EVT. This function must
4018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  be called before other functions in the JV API are
4028af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called.
4038af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4048af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS if successful.
4058af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAIL if internal failure.
4068af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4078af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
408cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK* p_cback);
4095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4118af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4128af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvDisable
4138af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Disable the Java I/F
4158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4168af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          void
4178af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4188af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
419547a2972e70021724f5638165a54da36d6a06198Sharvil Nanavativoid BTA_JvDisable(void);
4205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvIsEncrypted
4248af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function checks if the link to peer device is encrypted
4268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4278af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          true if encrypted.
4288af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  false if not.
4298af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4308af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
431e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssenbool BTA_JvIsEncrypted(BD_ADDR bd_addr);
4325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4348af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4358af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvGetChannelId
4368af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4378af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function reserves a SCN/PSM for applications running
4388af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  over RFCOMM or L2CAP. It is primarily called by
439cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  server profiles/applications to register their SCN/PSM into
4401baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  the SDP database. The SCN is reported by the
4411baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  tBTA_JV_DM_CBACK callback with a BTA_JV_GET_SCN_EVT.
442cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  If the SCN/PSM reported is 0, that means all SCN resources
4431baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  are exhausted.
4448af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  The channel parameter can be used to request a specific
4458af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  channel. If the request on the specific channel fails, the
446cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  SCN/PSM returned in the EVT will be 0 - no attempt to
4471baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  request a new channel will be made. set channel to <= 0 to
4481baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  automatically assign an channel ID.
4498af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4508af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4518af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4528af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4538af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
45458d57a46cbe38e0ab70d4f2333dd381ff89342b0Ajay PanickertBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, uint32_t id,
455cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  int32_t channel);
4568372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
4578372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
4588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvFreeChannel
4608af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4618af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function frees a SCN/PSM that was used
4628af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  by an application running over RFCOMM or L2CAP.
4638af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4648af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4658af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4668af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4678af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
468e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type);
4698372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
4708372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
4718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvStartDiscovery
4738af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4748af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function performs service discovery for the services
4758af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  provided by the given peer device. When the operation is
4768af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  complete the tBTA_JV_DM_CBACK callback function will be
4778af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with a BTA_JV_DISCOVERY_COMP_EVT.
4788af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4798af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4808af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4818af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4828af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
483e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, uint16_t num_uuid,
48458d57a46cbe38e0ab70d4f2333dd381ff89342b0Ajay Panicker                                    tSDP_UUID* p_uuid_list,
48558d57a46cbe38e0ab70d4f2333dd381ff89342b0Ajay Panicker                                    uint32_t rfcomm_slot_id);
4865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4888af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4898af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvCreateRecordByUser
4908af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4918af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Create a service record in the local SDP database by user in
4928af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_DM_CBACK callback with a BTA_JV_CREATE_RECORD_EVT.
4938af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4948af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4978af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
498547a2972e70021724f5638165a54da36d6a06198Sharvil NanavatitBTA_JV_STATUS BTA_JvCreateRecordByUser(void* user_data);
4995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
5005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
5018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5028af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvDeleteRecord
5038af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5048af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Delete a service record in the local SDP database.
5058af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5068af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5078af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5088af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5098af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
510e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle);
5115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
5125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
5138af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capConnectLE
5158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5168af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Initiate a connection as an LE L2CAP client to the given BD
5178af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  Address.
5188af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is initiated or failed to initiate,
5198af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_CL_INIT_EVT
5208af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established or failed,
5218af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
5228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5248af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
527547a2972e70021724f5638165a54da36d6a06198Sharvil NanavatitBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
528cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    const tL2CAP_ERTM_INFO* ertm_info,
529cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    uint16_t remote_chan, uint16_t rx_mtu,
530cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    tL2CAP_CFG_INFO* cfg, BD_ADDR peer_bd_addr,
531cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    tBTA_JV_L2CAP_CBACK* p_cback,
532cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    void* user_data);
5338372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5348372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5358af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5368af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capConnect
5378af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5388af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Initiate a connection as a L2CAP client to the given BD
5398af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  Address.
5408af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is initiated or failed to initiate,
5418af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_CL_INIT_EVT
5428af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established or failed,
5438af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
5448af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5458af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5468af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5478af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5488af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
549cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask,
550cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  tBTA_JV_ROLE role,
551cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  const tL2CAP_ERTM_INFO* ertm_info,
552cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  uint16_t remote_psm, uint16_t rx_mtu,
553cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  tL2CAP_CFG_INFO* cfg, BD_ADDR peer_bd_addr,
554cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  tBTA_JV_L2CAP_CBACK* p_cback,
555cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  void* user_data);
5568372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5578372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capClose
5608af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5618af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function closes an L2CAP client connection
5628af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5638af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5648af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5658af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5668af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
567e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);
5688372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5698372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5708af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capCloseLE
5728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
573cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function closes an L2CAP client connection for Fixed
5741baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  Channels Function is idempotent and no callbacks are called!
5758af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5768af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5778af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5788af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5798af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
580e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle);
5818372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5828372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5838af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5848af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStartServer
5858af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
586cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function starts an L2CAP server and listens for an
5871baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  L2CAP connection from a remote Bluetooth device.  When the
5881baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  server is started successfully, tBTA_JV_L2CAP_CBACK is
5891baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  called with BTA_JV_L2CAP_START_EVT.  When the connection is
5901baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  established, tBTA_JV_L2CAP_CBACK is called with
5911baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  BTA_JV_L2CAP_OPEN_EVT.
5928af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5938af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5948af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
597cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capStartServer(
598cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson    int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
599cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson    const tL2CAP_ERTM_INFO* ertm_info, uint16_t local_psm, uint16_t rx_mtu,
600cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson    tL2CAP_CFG_INFO* cfg, tBTA_JV_L2CAP_CBACK* p_cback, void* user_data);
6018372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6028372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6038af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6048af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStartServerLE
6058af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
606cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function starts an LE L2CAP server and listens for an
6071baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  L2CAP connection from a remote Bluetooth device on a fixed
6081baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  channel over an LE link.  When the server
6098af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  is started successfully, tBTA_JV_L2CAP_CBACK is called with
6108af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_L2CAP_START_EVT.  When the connection is established,
6118af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT.
6128af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6138af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6168af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
617547a2972e70021724f5638165a54da36d6a06198Sharvil NanavatitBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
618cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        const tL2CAP_ERTM_INFO* ertm_info,
619cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        uint16_t local_chan, uint16_t rx_mtu,
620cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        tL2CAP_CFG_INFO* cfg,
621cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        tBTA_JV_L2CAP_CBACK* p_cback,
622cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        void* user_data);
6238372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6248372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStopServerLE
6278af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
628cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function stops the LE L2CAP server. If the server has
6291baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  an active connection, it would be closed.
6308af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6318af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6328af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6338af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6348af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
635cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capStopServerLE(uint16_t local_chan, void* user_data);
6368372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6378372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6388af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6398af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStopServerLE
6408af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
641cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function stops the LE L2CAP server. If the server has
6421baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  an active connection, it would be closed.
6438af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6448af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6458af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6468af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6478af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
648cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capStopServer(uint16_t local_psm, void* user_data);
6498372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6508372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6518af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6528af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capRead
6538af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6548af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function reads data from an L2CAP connection
6558af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
6568af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_L2CAP_READ_EVT.
6578af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6608af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6618af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
662e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capRead(uint32_t handle, uint32_t req_id,
663cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                               uint8_t* p_data, uint16_t len);
6648372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6658372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6668af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6678af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capReady
6688af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6698af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function determined if there is data to read from
6708af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  an L2CAP connection
6718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if data queue size is in *p_data_size.
6738af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, if error.
6748af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6758af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
676cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t* p_data_size);
6778372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6788372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6798af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6808af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capWrite
6818af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6828af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function writes data to an L2CAP connection
6838af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
6848af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_L2CAP_WRITE_EVT. Works for
6858af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  PSM-based connections
6868af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6878af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6888af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6898af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6908af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
691e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id,
692cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                uint8_t* p_data, uint16_t len, void* user_data);
6938372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6948372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capWriteFixed
6978af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6988af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function writes data to an L2CAP connection
6998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
7008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_L2CAP_WRITE_FIXED_EVT. Works for
7018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  fixed-channel connections
7028af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7038af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7048af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7058af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7068af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
707cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capWriteFixed(uint16_t channel, BD_ADDR* addr,
708cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     uint32_t req_id,
709cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     tBTA_JV_L2CAP_CBACK* p_cback,
710cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     uint8_t* p_data, uint16_t len,
711cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     void* user_data);
7128372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
7138372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
7148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommConnect
7168af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7178af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function makes an RFCOMM conection to a remote BD
7188af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  Address.
7198af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is initiated or failed to initiate,
720cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  tBTA_JV_RFCOMM_CBACK is called with
7211baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  BTA_JV_RFCOMM_CL_INIT_EVT
7228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established or failed,
7238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_RFCOMM_CBACK is called with BTA_JV_RFCOMM_OPEN_EVT
7248af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7278af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7288af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
729cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
730cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                   uint8_t remote_scn, BD_ADDR peer_bd_addr,
731cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                   tBTA_JV_RFCOMM_CBACK* p_cback,
732cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                   void* user_data);
7335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
7345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
7358af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7368af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommClose
7378af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7388af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function closes an RFCOMM connection
7398af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7408af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7418af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7428af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7438af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
744e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvRfcommClose(uint32_t handle, void* user_data);
7455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
7465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
7478af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7488af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommStartServer
7498af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7508af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function starts listening for an RFCOMM connection
7518af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  request from a remote Bluetooth device.  When the server is
7528af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  started successfully, tBTA_JV_RFCOMM_CBACK is called
7538af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  with BTA_JV_RFCOMM_START_EVT.
7548af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established, tBTA_JV_RFCOMM_CBACK
7558af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  is called with BTA_JV_RFCOMM_OPEN_EVT.
7568af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7578af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7608af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
761cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
762cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                       uint8_t local_scn, uint8_t max_session,
763cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                       tBTA_JV_RFCOMM_CBACK* p_cback,
764cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                       void* user_data);
7655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
7665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
7678af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7688af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommStopServer
7698af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7708af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function stops the RFCOMM server. If the server has an
7718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  active connection, it would be closed.
7728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7738af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7748af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7758af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7768af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
777e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvRfcommStopServer(uint32_t handle, void* user_data);
7785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
7795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
7808af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7818af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommWrite
7828af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7838af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function writes data to an RFCOMM connection
7848af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_RFCOMM_CBACK is
7858af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_RFCOMM_WRITE_EVT.
7868af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7878af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7888af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7898af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7908af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
791e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvRfcommWrite(uint32_t handle, uint32_t req_id);
7925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
7932f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/*******************************************************************************
7948af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function    BTA_JVSetPmProfile
7968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
797cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description This function set or free power mode profile for different JV
7981baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *             application
7998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Parameters:  handle,  JV handle from RFCOMM or L2CAP
801cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *              app_id:  app specific pm ID, can be BTA_JV_PM_ALL, see
8021baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                       bta_dm_cfg.c for details
803cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *              BTA_JV_PM_ID_CLEAR: removes pm management on the handle. init_st
8041baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                                  is ignored and BTA_JV_CONN_CLOSE is called
8051baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                                  implicitly
8061baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *              init_st: state after calling this API. typically it should be
8071baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                       BTA_JV_CONN_OPEN
8088af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8098af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns      BTA_JV_SUCCESS, if the request is being processed.
8108af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *              BTA_JV_FAILURE, otherwise.
8118af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
812cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * NOTE:        BTA_JV_PM_ID_CLEAR: In general no need to be called as jv pm
8131baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                                  calls automatically
8148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *              BTA_JV_CONN_CLOSE to remove in case of connection close!
8158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8162f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta *******************************************************************************/
817e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvSetPmProfile(uint32_t handle, tBTA_JV_PM_ID app_id,
818cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                  tBTA_JV_CONN_STATE init_st);
8195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
8205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
8218af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommGetPortHdl
8238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8248af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description    This function fetches the rfcomm port handle
8258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
8278af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
8288af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
8298af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
830e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssenuint16_t BTA_JvRfcommGetPortHdl(uint32_t handle);
8315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
832713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski#ifdef __cplusplus
833713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski}
834713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski#endif
835713993d1784ab7c23aee1fa3cf1ab8676cc0aa69Jakub Pawlowski
8365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif /* BTA_JV_API_H */
837