bta_jv_api.h revision a09c3482007047e852a40b67b86882e96ebede51
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
335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*****************************************************************************
348af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *  Constants and data types
358af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ****************************************************************************/
365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* status values */
37cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SUCCESS 0     /* Successful operation. */
38cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_FAILURE 1     /* Generic failure. */
39cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_BUSY 2        /* Temporarily can not handle this request. */
40cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_NO_DATA 3     /* no data. */
41cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_NO_RESOURCE 4 /* No more set pm control block */
425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
43e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint8_t tBTA_JV_STATUS;
44cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_INTERNAL_ERR (-1) /* internal error. */
45cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson
46cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_UUIDS SDP_MAX_UUID_FILTERS
47cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_ATTRS SDP_MAX_ATTR_FILTERS
48cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_SDP_REC SDP_MAX_RECORDS
49cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_L2C_CONN                                                    \
50cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  GAP_MAX_CONNECTIONS /* GAP handle is used as index, hence do not change this \
51cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                         value */
52cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_SCN \
53cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  PORT_MAX_RFC_PORTS /* same as BTM_MAX_SCN (in btm_int.h) */
54cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_RFC_CONN MAX_RFC_PORTS
555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTA_JV_DEF_RFC_MTU
57cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_DEF_RFC_MTU (3 * 330)
585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTA_JV_MAX_RFC_SR_SESSION
61cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_RFC_SR_SESSION MAX_BD_CONNECTIONS
625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BTA_JV_MAX_RFC_SR_SESSION can not be bigger than MAX_BD_CONNECTIONS */
655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#if (BTA_JV_MAX_RFC_SR_SESSION > MAX_BD_CONNECTIONS)
665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#undef BTA_JV_MAX_RFC_SR_SESSION
67cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_RFC_SR_SESSION MAX_BD_CONNECTIONS
685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define BTA_JV_FIRST_SERVICE_ID BTA_FIRST_JV_SERVICE_ID
71cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_LAST_SERVICE_ID BTA_LAST_JV_SERVICE_ID
72cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_NUM_SERVICE_ID \
73cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  (BTA_LAST_JV_SERVICE_ID - BTA_FIRST_JV_SERVICE_ID + 1)
745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Discoverable modes */
76cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsonenum { BTA_JV_DISC_NONE, BTA_JV_DISC_LIMITED, BTA_JV_DISC_GENERAL };
77e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint16_t tBTA_JV_DISC;
785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
79cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_ROLE_SLAVE BTM_ROLE_SLAVE
80cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_ROLE_MASTER BTM_ROLE_MASTER
81e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint32_t tBTA_JV_ROLE;
825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
83cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_LMTD_DISCOVER                                       \
84cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTM_COD_SERVICE_LMTD_DISCOVER                                  /* 0x0020 \
85cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                                                    */
86cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_POSITIONING BTM_COD_SERVICE_POSITIONING   /* 0x0100 */
87cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_NETWORKING BTM_COD_SERVICE_NETWORKING     /* 0x0200 */
88cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_RENDERING BTM_COD_SERVICE_RENDERING       /* 0x0400 */
89cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_CAPTURING BTM_COD_SERVICE_CAPTURING       /* 0x0800 */
90cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_OBJ_TRANSFER BTM_COD_SERVICE_OBJ_TRANSFER /* 0x1000 */
91cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_AUDIO BTM_COD_SERVICE_AUDIO               /* 0x2000 */
92cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_TELEPHONY BTM_COD_SERVICE_TELEPHONY       /* 0x4000 */
93cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_SERVICE_INFORMATION BTM_COD_SERVICE_INFORMATION   /* 0x8000 */
945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
952f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* JV ID type */
96cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ID_1 1     /* PM example profile 1 */
97cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ID_2 2     /* PM example profile 2 */
98cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ID_CLEAR 0 /* Special JV ID used to clear PM profile */
99cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_ALL 0xFF   /* Generic match all id, see bta_dm_cfg.c */
100e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint8_t tBTA_JV_PM_ID;
1015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
102cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_PM_HANDLE_CLEAR \
103cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  0xFF /* Special JV ID used to clear PM profile  */
1042f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
105cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson/* define maximum number of registered PM entities. should be in sync with bta
106cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * pm! */
1072f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta#ifndef BTA_JV_PM_MAX_NUM
1082f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta#define BTA_JV_PM_MAX_NUM 5
1092f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta#endif
1102f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
1112f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* JV pm connection states */
112cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsonenum {
113cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_OPEN = 0, /* Connection opened state */
114cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_CLOSE,    /* Connection closed state */
115cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_APP_OPEN,      /* JV Application opened state */
116cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_APP_CLOSE,     /* JV Application closed state */
117cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_SCO_OPEN,      /* SCO connection opened state */
118cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_SCO_CLOSE,     /* SCO connection opened state */
119cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_IDLE,     /* Connection idle state */
120cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_CONN_BUSY,     /* Connection busy state */
121cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BTA_JV_MAX_CONN_STATE /* Max number of connection state */
1222f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta};
123e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint8_t tBTA_JV_CONN_STATE;
1245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1258372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* JV Connection types */
126cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CONN_TYPE_RFCOMM 0
127cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CONN_TYPE_L2CAP 1
128cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CONN_TYPE_L2CAP_LE 2
1298372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
1305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Java I/F callback events */
1315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* events received by tBTA_JV_DM_CBACK */
132cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_ENABLE_EVT 0         /* JV enabled */
133cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_GET_SCN_EVT 6        /* Reserved an SCN */
134cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_GET_PSM_EVT 7        /* Reserved a PSM */
135cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_DISCOVERY_COMP_EVT 8 /* SDP discovery complete */
136cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_CREATE_RECORD_EVT 11 /* the result for BTA_JvCreateRecord */
1378372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* events received by tBTA_JV_L2CAP_CBACK */
138cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_OPEN_EVT 16     /* open status of L2CAP connection */
139cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_CLOSE_EVT 17    /* L2CAP connection closed */
140cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_START_EVT 18    /* L2CAP server started */
141cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_CL_INIT_EVT 19  /* L2CAP client initiated a connection */
142cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_DATA_IND_EVT 20 /* L2CAP connection received data */
143cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_CONG_EVT \
144cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  21 /* L2CAP connection congestion status changed */
145cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_READ_EVT 22  /* the result for BTA_JvL2capRead */
146cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_WRITE_EVT 24 /* the result for BTA_JvL2capWrite*/
147cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_L2CAP_WRITE_FIXED_EVT \
148cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  25 /* the result for BTA_JvL2capWriteFixed */
1495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* events received by tBTA_JV_RFCOMM_CBACK */
151cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_OPEN_EVT                                                \
152cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  26                               /* open status of RFCOMM Client connection \
153cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                      */
154cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_CLOSE_EVT 27 /* RFCOMM connection closed */
155cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_START_EVT 28 /* RFCOMM server started */
156cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_CL_INIT_EVT                                             \
157cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  29                                  /* RFCOMM client initiated a connection \
158cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                         */
159cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_DATA_IND_EVT 30 /* RFCOMM connection received data */
160cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_CONG_EVT \
161cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  31 /* RFCOMM connection congestion status changed */
162cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_WRITE_EVT 33 /* the result for BTA_JvRfcommWrite*/
163cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_RFCOMM_SRV_OPEN_EVT \
164cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  34                      /* open status of Server RFCOMM connection */
165cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson#define BTA_JV_MAX_EVT 35 /* max number of JV events */
1665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
167e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie Janssentypedef uint16_t tBTA_JV_EVT;
1685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_SET_DISCOVER_EVT */
170cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
171cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status;  /* Whether the operation succeeded or failed. */
172cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_DISC disc_mode; /* The current discoverable mode */
1735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_SET_DISCOVER;
1745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_DISCOVERY_COMP_EVT_ */
176cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
177cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
178cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int scn;               /* channel # */
1795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_DISCOVERY_COMP;
1805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_CREATE_RECORD_EVT */
182cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
183cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
1845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_CREATE_RECORD;
1855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1868372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_OPEN_EVT */
187cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
188cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
189cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
190a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski  bt_bdaddr_t rem_bda;   /* The peer address */
191cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int32_t tx_mtu;        /* The transmit MTU */
1928372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_OPEN;
1938372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
1948372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_OPEN_EVT for LE sockets */
195cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
196cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
197cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
198a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski  bt_bdaddr_t rem_bda;   /* The peer address */
199cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int32_t tx_mtu;        /* The transmit MTU */
200cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  void** p_p_cback;      /* set them for new socket */
201cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  void** p_user_data;    /* set them for new socket */
2028372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2038372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_LE_OPEN;
2048372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2058372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_CLOSE_EVT */
206cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
207cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
208cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
209cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool async;            /* false, if local initiates disconnect */
2108372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_CLOSE;
2118372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2128372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_START_EVT */
213cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
214cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
215cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
216cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this server */
2178372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_START;
2188372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2198372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_CL_INIT_EVT */
220cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
221cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
222cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
223cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this client */
2248372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_CL_INIT;
2258372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2268372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_CONG_EVT */
227cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
228cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
229cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
230cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* true, congested. false, uncongested */
2318372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_CONG;
2328372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2338372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_READ_EVT */
234cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
235cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
236cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
237cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvL2capRead() */
238cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t* p_data;       /* This points the same location as the p_data
239cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                        * parameter in BTA_JvL2capRead () */
240cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t len;          /* The length of the data read. */
2418372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_READ;
2428372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2438372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_WRITE_EVT */
244cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
245cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
246cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
247cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvL2capWrite() */
248cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t len;          /* The length of the data written. */
249135db4f34477342b53242abfe9beec0262854389Ajay Panicker  uint8_t* p_data;       /* The buffer where data is held */
250cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* congestion status */
2518372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_WRITE;
2528372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2538372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* data associated with BTA_JV_L2CAP_WRITE_FIXED_EVT */
254cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
255cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
256cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t channel;      /* The connection channel */
257a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski  bt_bdaddr_t addr;      /* The peer address */
258cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvL2capWrite() */
259135db4f34477342b53242abfe9beec0262854389Ajay Panicker  uint8_t* p_data;       /* The buffer where data is held */
260cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t len;          /* The length of the data written. */
261cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* congestion status */
2628372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_L2CAP_WRITE_FIXED;
2638372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
2645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_OPEN_EVT */
265cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
266cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
267cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
268a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski  bt_bdaddr_t rem_bda;   /* The peer address */
2695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_OPEN;
2705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_SRV_OPEN_EVT */
271cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
272cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status;      /* Whether the operation succeeded or failed. */
273cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;            /* The connection handle */
274cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t new_listen_handle; /* The new listen handle */
275a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski  bt_bdaddr_t rem_bda;        /* The peer address */
2765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_SRV_OPEN;
2775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_CLOSE_EVT */
279cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
280cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
281cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t port_status;  /* PORT status */
282cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
283cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool async;            /* false, if local initiates disconnect */
2845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_CLOSE;
2855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_START_EVT */
287cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
288cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
289cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
290cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this server */
291cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool use_co;           /* true to use co_rfc_data */
2925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_START;
2935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_CL_INIT_EVT */
295cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
296cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
297cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
298cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t sec_id;        /* security ID used by this client */
299cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool use_co;           /* true to use co_rfc_data */
3005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_CL_INIT;
3015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*data associated with BTA_JV_L2CAP_DATA_IND_EVT & BTA_JV_RFCOMM_DATA_IND_EVT */
302cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
303cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle; /* The connection handle */
3045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_DATA_IND;
3055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3068372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*data associated with BTA_JV_L2CAP_DATA_IND_EVT if used for LE */
307cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
308cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle; /* The connection handle */
309cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  BT_HDR* p_buf;   /* The incoming data */
3108372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz} tBTA_JV_LE_DATA_IND;
3118372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
3125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_CONG_EVT */
313cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
314cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
315cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
316cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* true, congested. false, uncongested */
3175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_CONG;
3185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* data associated with BTA_JV_RFCOMM_WRITE_EVT */
320cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
321cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
322cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* The connection handle */
323cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t req_id;       /* The req_id in the associated BTA_JvRfcommWrite() */
324cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  int len;               /* The length of the data written. */
325cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  bool cong;             /* congestion status */
3265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_RFCOMM_WRITE;
3275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3282f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* data associated with BTA_JV_API_SET_PM_PROFILE_EVT */
329cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
330cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status; /* Status of the operation */
331cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;       /* Connection handle */
332cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_PM_ID app_id;  /* JV app ID */
3332f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta} tBTA_JV_SET_PM_PROFILE;
3342f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
3352f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta/* data associated with BTA_JV_API_NOTIFY_PM_STATE_CHANGE_EVT */
336cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
337cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint32_t handle;          /* Connection handle */
338cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_CONN_STATE state; /* JV connection stata */
3392f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta} tBTA_JV_NOTIFY_PM_STATE_CHANGE;
3402f338f25530d2aaab7acf45701c271d10b81d96dGanesh Ganapathi Batta
3415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* union of data associated with JV callback */
342cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef union {
343cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_STATUS status;                     /* BTA_JV_ENABLE_EVT */
344cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_DISCOVERY_COMP disc_comp;          /* BTA_JV_DISCOVERY_COMP_EVT */
345cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_SET_DISCOVER set_discover;         /* BTA_JV_SET_DISCOVER_EVT */
346cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t scn;                               /* BTA_JV_GET_SCN_EVT */
347cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t psm;                              /* BTA_JV_GET_PSM_EVT */
348cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_CREATE_RECORD create_rec;          /* BTA_JV_CREATE_RECORD_EVT */
349cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_OPEN l2c_open;               /* BTA_JV_L2CAP_OPEN_EVT */
350cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_CLOSE l2c_close;             /* BTA_JV_L2CAP_CLOSE_EVT */
351cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_START l2c_start;             /* BTA_JV_L2CAP_START_EVT */
352cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_CL_INIT l2c_cl_init;         /* BTA_JV_L2CAP_CL_INIT_EVT */
353cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_CONG l2c_cong;               /* BTA_JV_L2CAP_CONG_EVT */
354cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_READ l2c_read;               /* BTA_JV_L2CAP_READ_EVT */
355cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_WRITE l2c_write;             /* BTA_JV_L2CAP_WRITE_EVT */
356cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_OPEN rfc_open;              /* BTA_JV_RFCOMM_OPEN_EVT */
357cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_SRV_OPEN rfc_srv_open;      /* BTA_JV_RFCOMM_SRV_OPEN_EVT */
358cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_CLOSE rfc_close;            /* BTA_JV_RFCOMM_CLOSE_EVT */
359cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_START rfc_start;            /* BTA_JV_RFCOMM_START_EVT */
360cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_CL_INIT rfc_cl_init;        /* BTA_JV_RFCOMM_CL_INIT_EVT */
361cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_CONG rfc_cong;              /* BTA_JV_RFCOMM_CONG_EVT */
362cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_RFCOMM_WRITE rfc_write;            /* BTA_JV_RFCOMM_WRITE_EVT */
363cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_DATA_IND data_ind;                 /* BTA_JV_L2CAP_DATA_IND_EVT
364cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                                BTA_JV_RFCOMM_DATA_IND_EVT */
365cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_LE_DATA_IND le_data_ind;           /* BTA_JV_L2CAP_LE_DATA_IND_EVT */
366cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_LE_OPEN l2c_le_open;         /* BTA_JV_L2CAP_OPEN_EVT */
367cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tBTA_JV_L2CAP_WRITE_FIXED l2c_write_fixed; /* BTA_JV_L2CAP_WRITE_FIXED_EVT */
3685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV;
3695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* JAVA DM Interface callback */
371531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panickertypedef void(tBTA_JV_DM_CBACK)(tBTA_JV_EVT event, tBTA_JV* p_data, uint32_t id);
3725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* JAVA RFCOMM interface callback */
3748ab5e4dbb107be931381bca470c87db447e00881Ajay Panickertypedef uint32_t(tBTA_JV_RFCOMM_CBACK)(tBTA_JV_EVT event, tBTA_JV* p_data,
3758ab5e4dbb107be931381bca470c87db447e00881Ajay Panicker                                       uint32_t rfcomm_slot_id);
3765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3778372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/* JAVA L2CAP interface callback */
378cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef void(tBTA_JV_L2CAP_CBACK)(tBTA_JV_EVT event, tBTA_JV* p_data,
379531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                  uint32_t l2cap_socket_id);
3808372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
3815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* JV configuration structure */
382cd1fd07f1306e08fe048682dd5918987e579f937Myles Watsontypedef struct {
383cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t sdp_raw_size;       /* The size of p_sdp_raw_data */
384cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint16_t sdp_db_size;        /* The size of p_sdp_db */
385cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  uint8_t* p_sdp_raw_data;     /* The data buffer to keep raw data */
386cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson  tSDP_DISCOVERY_DB* p_sdp_db; /* The data buffer to keep SDP database */
3875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_JV_CFG;
3885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
3908af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
3918af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvEnable
3928af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
3938af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Enable the Java I/F service. When the enable
3948af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  operation is complete the callback function will be
3958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with a BTA_JV_ENABLE_EVT. This function must
3968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  be called before other functions in the JV API are
3978af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called.
3988af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
3998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS if successful.
4008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAIL if internal failure.
4018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4028af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
403cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK* p_cback);
4045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4068af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4078af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvDisable
4088af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4098af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Disable the Java I/F
4108af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4118af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          void
4128af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4138af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
414547a2972e70021724f5638165a54da36d6a06198Sharvil Nanavativoid BTA_JvDisable(void);
4155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4178af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4188af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvIsEncrypted
4198af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4208af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function checks if the link to peer device is encrypted
4218af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          true if encrypted.
4238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  false if not.
4248af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
426a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowskibool BTA_JvIsEncrypted(const bt_bdaddr_t& bd_addr);
4275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4298af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4308af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvGetChannelId
4318af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4328af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function reserves a SCN/PSM for applications running
4338af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  over RFCOMM or L2CAP. It is primarily called by
434cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  server profiles/applications to register their SCN/PSM into
4351baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  the SDP database. The SCN is reported by the
4361baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  tBTA_JV_DM_CBACK callback with a BTA_JV_GET_SCN_EVT.
437cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  If the SCN/PSM reported is 0, that means all SCN resources
4381baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  are exhausted.
4398af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  The channel parameter can be used to request a specific
4408af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  channel. If the request on the specific channel fails, the
441cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  SCN/PSM returned in the EVT will be 0 - no attempt to
4421baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  request a new channel will be made. set channel to <= 0 to
4431baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  automatically assign an channel ID.
4448af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4458af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4468af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4478af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4488af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
449531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay PanickertBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, uint32_t id, int32_t channel);
4508372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
4518372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
4528af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4538af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvFreeChannel
4548af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4558af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function frees a SCN/PSM that was used
4568af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  by an application running over RFCOMM or L2CAP.
4578af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4608af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4618af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
462e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type);
4638372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
4648372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
4658af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4668af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvStartDiscovery
4678af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4688af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function performs service discovery for the services
4698af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  provided by the given peer device. When the operation is
4708af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  complete the tBTA_JV_DM_CBACK callback function will be
4718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with a BTA_JV_DISCOVERY_COMP_EVT.
4728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4738af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4748af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4758af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4768af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
477a09c3482007047e852a40b67b86882e96ebede51Jakub PawlowskitBTA_JV_STATUS BTA_JvStartDiscovery(const bt_bdaddr_t& bd_addr,
478a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski                                    uint16_t num_uuid, tSDP_UUID* p_uuid_list,
47958d57a46cbe38e0ab70d4f2333dd381ff89342b0Ajay Panicker                                    uint32_t rfcomm_slot_id);
4805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4828af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4838af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvCreateRecordByUser
4848af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4858af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Create a service record in the local SDP database by user in
4868af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_DM_CBACK callback with a BTA_JV_CREATE_RECORD_EVT.
4878af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4888af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
4898af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
4908af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4918af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
4928ab5e4dbb107be931381bca470c87db447e00881Ajay PanickertBTA_JV_STATUS BTA_JvCreateRecordByUser(uint32_t rfcomm_slot_id);
4935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
4945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
4958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvDeleteRecord
4978af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
4988af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Delete a service record in the local SDP database.
4998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5028af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5038af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
504e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle);
5055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
5065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
5078af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5088af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capConnectLE
5098af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5108af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Initiate a connection as an LE L2CAP client to the given BD
5118af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  Address.
5128af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is initiated or failed to initiate,
5138af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_CL_INIT_EVT
5148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established or failed,
5158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
5168af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5178af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5188af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5198af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5208af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
521547a2972e70021724f5638165a54da36d6a06198Sharvil NanavatitBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
522cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    const tL2CAP_ERTM_INFO* ertm_info,
523cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    uint16_t remote_chan, uint16_t rx_mtu,
524a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski                                    tL2CAP_CFG_INFO* cfg,
525a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski                                    const bt_bdaddr_t& peer_bd_addr,
526cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                    tBTA_JV_L2CAP_CBACK* p_cback,
527531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                    uint32_t l2cap_socket_id);
5288372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5298372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5308af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5318af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capConnect
5328af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5338af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      Initiate a connection as a L2CAP client to the given BD
5348af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  Address.
5358af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is initiated or failed to initiate,
5368af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_CL_INIT_EVT
5378af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established or failed,
5388af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
5398af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5408af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5418af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5428af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5438af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
544a09c3482007047e852a40b67b86882e96ebede51Jakub PawlowskitBTA_JV_STATUS BTA_JvL2capConnect(
545a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski    int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
546a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski    const tL2CAP_ERTM_INFO* ertm_info, uint16_t remote_psm, uint16_t rx_mtu,
547a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski    tL2CAP_CFG_INFO* cfg, const bt_bdaddr_t& peer_bd_addr,
548a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski    tBTA_JV_L2CAP_CBACK* p_cback, uint32_t l2cap_socket_id);
5498372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5508372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5518af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5528af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capClose
5538af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5548af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function closes an L2CAP client connection
5558af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5568af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5578af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
560e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);
5618372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5628372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5638af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5648af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capCloseLE
5658af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
566cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function closes an L2CAP client connection for Fixed
5671baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  Channels Function is idempotent and no callbacks are called!
5688af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5698af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5708af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
573e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle);
5748372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5758372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5768af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5778af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStartServer
5788af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
579cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function starts an L2CAP server and listens for an
5801baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  L2CAP connection from a remote Bluetooth device.  When the
5811baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  server is started successfully, tBTA_JV_L2CAP_CBACK is
5821baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  called with BTA_JV_L2CAP_START_EVT.  When the connection is
5831baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  established, tBTA_JV_L2CAP_CBACK is called with
5841baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  BTA_JV_L2CAP_OPEN_EVT.
5858af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5868af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
5878af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
5888af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
5898af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
590531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay PanickertBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask,
591531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                      tBTA_JV_ROLE role,
592531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                      const tL2CAP_ERTM_INFO* ertm_info,
593531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                      uint16_t local_psm, uint16_t rx_mtu,
594531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                      tL2CAP_CFG_INFO* cfg,
595531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                      tBTA_JV_L2CAP_CBACK* p_cback,
596531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                      uint32_t l2cap_socket_id);
5978372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
5988372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
5998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStartServerLE
6018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
602cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function starts an LE L2CAP server and listens for an
6031baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  L2CAP connection from a remote Bluetooth device on a fixed
6041baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  channel over an LE link.  When the server
6058af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  is started successfully, tBTA_JV_L2CAP_CBACK is called with
6068af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_L2CAP_START_EVT.  When the connection is established,
6078af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT.
6088af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6098af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6108af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6118af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6128af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
613547a2972e70021724f5638165a54da36d6a06198Sharvil NanavatitBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
614cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        const tL2CAP_ERTM_INFO* ertm_info,
615cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        uint16_t local_chan, uint16_t rx_mtu,
616cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        tL2CAP_CFG_INFO* cfg,
617cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                        tBTA_JV_L2CAP_CBACK* p_cback,
618531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                        uint32_t l2cap_socket_id);
6198372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6208372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6218af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capStopServerLE
6238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
624cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson * Description      This function stops the LE L2CAP server. If the server has
6251baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  an active connection, it would be closed.
6268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6278af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6288af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6298af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6308af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
631531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay PanickertBTA_JV_STATUS BTA_JvL2capStopServerLE(uint16_t local_chan,
632531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                       uint32_t l2cap_socket_id);
6338372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6348372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6358af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
636531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker * Function         BTA_JvL2capStopServer
6378af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
638531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker * Description      This function stops the L2CAP server. If the server has
6391baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  an active connection, it would be closed.
6408af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6418af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6428af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6438af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6448af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
645531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay PanickertBTA_JV_STATUS BTA_JvL2capStopServer(uint16_t local_psm,
646531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                     uint32_t l2cap_socket_id);
6478372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6488372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6498af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6508af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capRead
6518af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6528af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function reads data from an L2CAP connection
6538af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
6548af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_L2CAP_READ_EVT.
6558af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6568af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6578af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6588af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6598af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
660e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capRead(uint32_t handle, uint32_t req_id,
661cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                               uint8_t* p_data, uint16_t len);
6628372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6638372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6648af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6658af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capReady
6668af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6678af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function determined if there is data to read from
6688af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  an L2CAP connection
6698af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6708af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if data queue size is in *p_data_size.
6718af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, if error.
6728af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6738af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
674cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t* p_data_size);
6758372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6768372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6778af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6788af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capWrite
6798af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6808af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function writes data to an L2CAP connection
6818af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
6828af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_L2CAP_WRITE_EVT. Works for
6838af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  PSM-based connections
6848af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6858af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
6868af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
6878af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6888af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
689e9e58ced195ec2c983c7723c9cbdabd45eb0f2fdMarie JanssentBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id,
690531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                uint8_t* p_data, uint16_t len,
691531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                uint32_t user_id);
6928372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
6938372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
6948af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6958af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvL2capWriteFixed
6968af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
6978af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function writes data to an L2CAP connection
6988af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the operation is complete, tBTA_JV_L2CAP_CBACK is
6998af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  called with BTA_JV_L2CAP_WRITE_FIXED_EVT. Works for
7008af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  fixed-channel connections
7018af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7028af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7038af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7048af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7058af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
706a09c3482007047e852a40b67b86882e96ebede51Jakub PawlowskitBTA_JV_STATUS BTA_JvL2capWriteFixed(uint16_t channel, const bt_bdaddr_t& addr,
707cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     uint32_t req_id,
708cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     tBTA_JV_L2CAP_CBACK* p_cback,
709cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                     uint8_t* p_data, uint16_t len,
710531fe1a8c1ca7edfdaf11bbbf3bd63d51bde9b33Ajay Panicker                                     uint32_t user_id);
7118372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz
7128372aa5fa535ee4f09c09981b6125b54ace31fe2Kim Schulz/*******************************************************************************
7138af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7148af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Function         BTA_JvRfcommConnect
7158af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7168af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Description      This function makes an RFCOMM conection to a remote BD
7178af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  Address.
7188af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is initiated or failed to initiate,
719cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson *                  tBTA_JV_RFCOMM_CBACK is called with
7201baaae3f34a667058e7f0c5f778357d98320cf38Myles Watson *                  BTA_JV_RFCOMM_CL_INIT_EVT
7218af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  When the connection is established or failed,
7228af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  tBTA_JV_RFCOMM_CBACK is called with BTA_JV_RFCOMM_OPEN_EVT
7238af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7248af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson * Returns          BTA_JV_SUCCESS, if the request is being processed.
7258af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *                  BTA_JV_FAILURE, otherwise.
7268af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson *
7278af480e24549ba51a3f6858d9d9af504715e0beaMyles Watson ******************************************************************************/
728cd1fd07f1306e08fe048682dd5918987e579f937Myles WatsontBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
729a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski                                   uint8_t remote_scn,
730a09c3482007047e852a40b67b86882e96ebede51Jakub Pawlowski                                   const bt_bdaddr_t& peer_bd_addr,
731cd1fd07f1306e08fe048682dd5918987e579f937Myles Watson                                   tBTA_JV_RFCOMM_CBACK* p_cback,
7328ab5e4dbb107be931381bca470c87db447e00881Ajay Panicker                                   uint32_t rfcomm_slot_id);
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 ******************************************************************************/
7448ab5e4dbb107be931381bca470c87db447e00881Ajay PanickertBTA_JV_STATUS BTA_JvRfcommClose(uint32_t handle, uint32_t rfcomm_slot_id);
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,
7648ab5e4dbb107be931381bca470c87db447e00881Ajay Panicker                                       uint32_t rfcomm_slot_id);
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 ******************************************************************************/
7778ab5e4dbb107be931381bca470c87db447e00881Ajay PanickertBTA_JV_STATUS BTA_JvRfcommStopServer(uint32_t handle, uint32_t rfcomm_slot_id);
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 *
816ee96a3c60fca590d38025925c072d264e06493c4Myles Watson ******************************************************************************/
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
8325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif /* BTA_JV_API_H */
833