blob: 3fc03d92a96ed0fe86699d701a50d0f5681b5305 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
3 * Copyright (C) 2006-2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 * This is the public interface file the BTA Java I/F
22 *
23 ******************************************************************************/
24#ifndef BTA_JV_API_H
25#define BTA_JV_API_H
26
The Android Open Source Project5738f832012-12-12 16:00:35 -080027#include "bt_target.h"
28#include "bt_types.h"
29#include "bta_api.h"
30#include "btm_api.h"
Kim Schulz8372aa52015-03-25 10:39:40 +010031#include "l2c_api.h"
32
Jakub Pawlowski713993d2016-04-21 13:16:45 -070033#ifdef __cplusplus
34extern "C" {
35#endif
36
The Android Open Source Project5738f832012-12-12 16:00:35 -080037/*****************************************************************************
38** Constants and data types
39*****************************************************************************/
40/* status values */
41#define BTA_JV_SUCCESS 0 /* Successful operation. */
42#define BTA_JV_FAILURE 1 /* Generic failure. */
43#define BTA_JV_BUSY 2 /* Temporarily can not handle this request. */
44#define BTA_JV_NO_DATA 3 /* no data. */
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +010045#define BTA_JV_NO_RESOURCE 4 /* No more set pm control block */
The Android Open Source Project5738f832012-12-12 16:00:35 -080046
Marie Janssene9e58ce2016-06-17 14:12:17 -070047typedef uint8_t tBTA_JV_STATUS;
The Android Open Source Project5738f832012-12-12 16:00:35 -080048#define BTA_JV_INTERNAL_ERR (-1) /* internal error. */
49
50#define BTA_JV_MAX_UUIDS SDP_MAX_UUID_FILTERS
51#define BTA_JV_MAX_ATTRS SDP_MAX_ATTR_FILTERS
52#define BTA_JV_MAX_SDP_REC SDP_MAX_RECORDS
Kim Schulz8372aa52015-03-25 10:39:40 +010053#define BTA_JV_MAX_L2C_CONN GAP_MAX_CONNECTIONS /* GAP handle is used as index, hence do not change this value */
The Android Open Source Project5738f832012-12-12 16:00:35 -080054#define BTA_JV_MAX_SCN PORT_MAX_RFC_PORTS /* same as BTM_MAX_SCN (in btm_int.h) */
55#define BTA_JV_MAX_RFC_CONN MAX_RFC_PORTS
56
57#ifndef BTA_JV_DEF_RFC_MTU
58#define BTA_JV_DEF_RFC_MTU (3*330)
59#endif
60
The Android Open Source Project5738f832012-12-12 16:00:35 -080061#ifndef BTA_JV_MAX_RFC_SR_SESSION
The Android Open Source Project689d66b2012-12-12 17:18:15 -080062#define BTA_JV_MAX_RFC_SR_SESSION MAX_BD_CONNECTIONS
The Android Open Source Project5738f832012-12-12 16:00:35 -080063#endif
64
65/* BTA_JV_MAX_RFC_SR_SESSION can not be bigger than MAX_BD_CONNECTIONS */
66#if (BTA_JV_MAX_RFC_SR_SESSION > MAX_BD_CONNECTIONS)
67#undef BTA_JV_MAX_RFC_SR_SESSION
68#define BTA_JV_MAX_RFC_SR_SESSION MAX_BD_CONNECTIONS
69#endif
70
71#define BTA_JV_FIRST_SERVICE_ID BTA_FIRST_JV_SERVICE_ID
72#define BTA_JV_LAST_SERVICE_ID BTA_LAST_JV_SERVICE_ID
73#define BTA_JV_NUM_SERVICE_ID (BTA_LAST_JV_SERVICE_ID - BTA_FIRST_JV_SERVICE_ID + 1)
74
75/* Discoverable modes */
76enum
77{
78 BTA_JV_DISC_NONE,
79 BTA_JV_DISC_LIMITED,
80 BTA_JV_DISC_GENERAL
81};
Marie Janssene9e58ce2016-06-17 14:12:17 -070082typedef uint16_t tBTA_JV_DISC;
The Android Open Source Project5738f832012-12-12 16:00:35 -080083
The Android Open Source Project5738f832012-12-12 16:00:35 -080084#define BTA_JV_ROLE_SLAVE BTM_ROLE_SLAVE
85#define BTA_JV_ROLE_MASTER BTM_ROLE_MASTER
Marie Janssene9e58ce2016-06-17 14:12:17 -070086typedef uint32_t tBTA_JV_ROLE;
The Android Open Source Project5738f832012-12-12 16:00:35 -080087
88#define BTA_JV_SERVICE_LMTD_DISCOVER BTM_COD_SERVICE_LMTD_DISCOVER /* 0x0020 */
89#define BTA_JV_SERVICE_POSITIONING BTM_COD_SERVICE_POSITIONING /* 0x0100 */
90#define BTA_JV_SERVICE_NETWORKING BTM_COD_SERVICE_NETWORKING /* 0x0200 */
91#define BTA_JV_SERVICE_RENDERING BTM_COD_SERVICE_RENDERING /* 0x0400 */
92#define BTA_JV_SERVICE_CAPTURING BTM_COD_SERVICE_CAPTURING /* 0x0800 */
93#define BTA_JV_SERVICE_OBJ_TRANSFER BTM_COD_SERVICE_OBJ_TRANSFER /* 0x1000 */
94#define BTA_JV_SERVICE_AUDIO BTM_COD_SERVICE_AUDIO /* 0x2000 */
95#define BTA_JV_SERVICE_TELEPHONY BTM_COD_SERVICE_TELEPHONY /* 0x4000 */
96#define BTA_JV_SERVICE_INFORMATION BTM_COD_SERVICE_INFORMATION /* 0x8000 */
97
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +010098/* JV ID type */
99#define BTA_JV_PM_ID_1 1 /* PM example profile 1 */
100#define BTA_JV_PM_ID_2 2 /* PM example profile 2 */
101#define BTA_JV_PM_ID_CLEAR 0 /* Special JV ID used to clear PM profile */
102#define BTA_JV_PM_ALL 0xFF /* Generic match all id, see bta_dm_cfg.c */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700103typedef uint8_t tBTA_JV_PM_ID;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800104
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +0100105#define BTA_JV_PM_HANDLE_CLEAR 0xFF /* Special JV ID used to clear PM profile */
106
107/* define maximum number of registered PM entities. should be in sync with bta pm! */
108#ifndef BTA_JV_PM_MAX_NUM
109#define BTA_JV_PM_MAX_NUM 5
110#endif
111
112/* JV pm connection states */
113enum
114{
115 BTA_JV_CONN_OPEN = 0, /* Connection opened state */
116 BTA_JV_CONN_CLOSE, /* Connection closed state */
117 BTA_JV_APP_OPEN, /* JV Application opened state */
118 BTA_JV_APP_CLOSE, /* JV Application closed state */
119 BTA_JV_SCO_OPEN, /* SCO connection opened state */
120 BTA_JV_SCO_CLOSE, /* SCO connection opened state */
121 BTA_JV_CONN_IDLE, /* Connection idle state */
122 BTA_JV_CONN_BUSY, /* Connection busy state */
123 BTA_JV_MAX_CONN_STATE /* Max number of connection state */
124};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700125typedef uint8_t tBTA_JV_CONN_STATE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800126
Kim Schulz8372aa52015-03-25 10:39:40 +0100127/* JV Connection types */
128#define BTA_JV_CONN_TYPE_RFCOMM 0
129#define BTA_JV_CONN_TYPE_L2CAP 1
130#define BTA_JV_CONN_TYPE_L2CAP_LE 2
131
The Android Open Source Project5738f832012-12-12 16:00:35 -0800132/* Java I/F callback events */
133/* events received by tBTA_JV_DM_CBACK */
134#define BTA_JV_ENABLE_EVT 0 /* JV enabled */
Kim Schulz8372aa52015-03-25 10:39:40 +0100135#define BTA_JV_GET_SCN_EVT 6 /* Reserved an SCN */
136#define BTA_JV_GET_PSM_EVT 7 /* Reserved a PSM */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800137#define BTA_JV_DISCOVERY_COMP_EVT 8 /* SDP discovery complete */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800138#define BTA_JV_CREATE_RECORD_EVT 11 /* the result for BTA_JvCreateRecord */
Kim Schulz8372aa52015-03-25 10:39:40 +0100139/* events received by tBTA_JV_L2CAP_CBACK */
140#define BTA_JV_L2CAP_OPEN_EVT 16 /* open status of L2CAP connection */
141#define BTA_JV_L2CAP_CLOSE_EVT 17 /* L2CAP connection closed */
142#define BTA_JV_L2CAP_START_EVT 18 /* L2CAP server started */
143#define BTA_JV_L2CAP_CL_INIT_EVT 19 /* L2CAP client initiated a connection */
144#define BTA_JV_L2CAP_DATA_IND_EVT 20 /* L2CAP connection received data */
145#define BTA_JV_L2CAP_CONG_EVT 21 /* L2CAP connection congestion status changed */
146#define BTA_JV_L2CAP_READ_EVT 22 /* the result for BTA_JvL2capRead */
Kim Schulz8372aa52015-03-25 10:39:40 +0100147#define BTA_JV_L2CAP_WRITE_EVT 24 /* the result for BTA_JvL2capWrite*/
148#define BTA_JV_L2CAP_WRITE_FIXED_EVT 25 /* the result for BTA_JvL2capWriteFixed */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800149
150/* events received by tBTA_JV_RFCOMM_CBACK */
Kim Schulz8372aa52015-03-25 10:39:40 +0100151#define BTA_JV_RFCOMM_OPEN_EVT 26 /* open status of RFCOMM Client connection */
152#define BTA_JV_RFCOMM_CLOSE_EVT 27 /* RFCOMM connection closed */
153#define BTA_JV_RFCOMM_START_EVT 28 /* RFCOMM server started */
154#define BTA_JV_RFCOMM_CL_INIT_EVT 29 /* RFCOMM client initiated a connection */
155#define BTA_JV_RFCOMM_DATA_IND_EVT 30 /* RFCOMM connection received data */
156#define BTA_JV_RFCOMM_CONG_EVT 31 /* RFCOMM connection congestion status changed */
Kim Schulz8372aa52015-03-25 10:39:40 +0100157#define BTA_JV_RFCOMM_WRITE_EVT 33 /* the result for BTA_JvRfcommWrite*/
158#define BTA_JV_RFCOMM_SRV_OPEN_EVT 34 /* open status of Server RFCOMM connection */
159#define BTA_JV_MAX_EVT 35 /* max number of JV events */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800160
Marie Janssene9e58ce2016-06-17 14:12:17 -0700161typedef uint16_t tBTA_JV_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800162
163/* data associated with BTA_JV_SET_DISCOVER_EVT */
164typedef struct
165{
166 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
167 tBTA_JV_DISC disc_mode; /* The current discoverable mode */
168} tBTA_JV_SET_DISCOVER;
169
170/* data associated with BTA_JV_DISCOVERY_COMP_EVT_ */
171typedef struct
172{
173 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
174 int scn; /* channel # */
175} tBTA_JV_DISCOVERY_COMP;
176
The Android Open Source Project5738f832012-12-12 16:00:35 -0800177/* data associated with BTA_JV_CREATE_RECORD_EVT */
178typedef struct
179{
180 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
181} tBTA_JV_CREATE_RECORD;
182
Kim Schulz8372aa52015-03-25 10:39:40 +0100183/* data associated with BTA_JV_L2CAP_OPEN_EVT */
184typedef struct
185{
186 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700187 uint32_t handle; /* The connection handle */
Kim Schulz8372aa52015-03-25 10:39:40 +0100188 BD_ADDR rem_bda; /* The peer address */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700189 int32_t tx_mtu; /* The transmit MTU */
Kim Schulz8372aa52015-03-25 10:39:40 +0100190} tBTA_JV_L2CAP_OPEN;
191
192/* data associated with BTA_JV_L2CAP_OPEN_EVT for LE sockets */
193typedef struct
194{
195 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700196 uint32_t handle; /* The connection handle */
Kim Schulz8372aa52015-03-25 10:39:40 +0100197 BD_ADDR rem_bda; /* The peer address */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700198 int32_t tx_mtu; /* The transmit MTU */
Kim Schulz8372aa52015-03-25 10:39:40 +0100199 void **p_p_cback; /* set them for new socket */
200 void **p_user_data;/* set them for new socket */
201
202} tBTA_JV_L2CAP_LE_OPEN;
203
204
205/* data associated with BTA_JV_L2CAP_CLOSE_EVT */
206typedef struct
207{
208 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700209 uint32_t handle; /* The connection handle */
210 bool async; /* false, if local initiates disconnect */
Kim Schulz8372aa52015-03-25 10:39:40 +0100211} tBTA_JV_L2CAP_CLOSE;
212
213/* data associated with BTA_JV_L2CAP_START_EVT */
214typedef struct
215{
216 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700217 uint32_t handle; /* The connection handle */
218 uint8_t sec_id; /* security ID used by this server */
Kim Schulz8372aa52015-03-25 10:39:40 +0100219} tBTA_JV_L2CAP_START;
220
221/* data associated with BTA_JV_L2CAP_CL_INIT_EVT */
222typedef struct
223{
224 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700225 uint32_t handle; /* The connection handle */
226 uint8_t sec_id; /* security ID used by this client */
Kim Schulz8372aa52015-03-25 10:39:40 +0100227} tBTA_JV_L2CAP_CL_INIT;
228
229/* data associated with BTA_JV_L2CAP_CONG_EVT */
230typedef struct
231{
232 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700233 uint32_t handle; /* The connection handle */
234 bool cong; /* true, congested. false, uncongested */
Kim Schulz8372aa52015-03-25 10:39:40 +0100235} tBTA_JV_L2CAP_CONG;
236
237/* data associated with BTA_JV_L2CAP_READ_EVT */
238typedef struct
239{
240 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700241 uint32_t handle; /* The connection handle */
242 uint32_t req_id; /* The req_id in the associated BTA_JvL2capRead() */
243 uint8_t *p_data; /* This points the same location as the p_data
Kim Schulz8372aa52015-03-25 10:39:40 +0100244 * parameter in BTA_JvL2capRead () */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700245 uint16_t len; /* The length of the data read. */
Kim Schulz8372aa52015-03-25 10:39:40 +0100246} tBTA_JV_L2CAP_READ;
247
Kim Schulz8372aa52015-03-25 10:39:40 +0100248/* data associated with BTA_JV_L2CAP_WRITE_EVT */
249typedef struct
250{
251 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700252 uint32_t handle; /* The connection handle */
253 uint32_t req_id; /* The req_id in the associated BTA_JvL2capWrite() */
254 uint16_t len; /* The length of the data written. */
255 bool cong; /* congestion status */
Kim Schulz8372aa52015-03-25 10:39:40 +0100256} tBTA_JV_L2CAP_WRITE;
257
258
259/* data associated with BTA_JV_L2CAP_WRITE_FIXED_EVT */
260typedef struct
261{
262 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700263 uint16_t channel; /* The connection channel */
Kim Schulz8372aa52015-03-25 10:39:40 +0100264 BD_ADDR addr; /* The peer address */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700265 uint32_t req_id; /* The req_id in the associated BTA_JvL2capWrite() */
266 uint16_t len; /* The length of the data written. */
267 bool cong; /* congestion status */
Kim Schulz8372aa52015-03-25 10:39:40 +0100268} tBTA_JV_L2CAP_WRITE_FIXED;
269
The Android Open Source Project5738f832012-12-12 16:00:35 -0800270/* data associated with BTA_JV_RFCOMM_OPEN_EVT */
271typedef struct
272{
273 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700274 uint32_t handle; /* The connection handle */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800275 BD_ADDR rem_bda; /* The peer address */
276} tBTA_JV_RFCOMM_OPEN;
277/* data associated with BTA_JV_RFCOMM_SRV_OPEN_EVT */
278typedef struct
279{
280 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700281 uint32_t handle; /* The connection handle */
282 uint32_t new_listen_handle; /* The new listen handle */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800283 BD_ADDR rem_bda; /* The peer address */
284} tBTA_JV_RFCOMM_SRV_OPEN;
285
286
287/* data associated with BTA_JV_RFCOMM_CLOSE_EVT */
288typedef struct
289{
290 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700291 uint32_t port_status; /* PORT status */
292 uint32_t handle; /* The connection handle */
293 bool async; /* false, if local initiates disconnect */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800294} tBTA_JV_RFCOMM_CLOSE;
295
296/* data associated with BTA_JV_RFCOMM_START_EVT */
297typedef struct
298{
299 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700300 uint32_t handle; /* The connection handle */
301 uint8_t sec_id; /* security ID used by this server */
302 bool use_co; /* true to use co_rfc_data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800303} tBTA_JV_RFCOMM_START;
304
305/* data associated with BTA_JV_RFCOMM_CL_INIT_EVT */
306typedef struct
307{
308 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700309 uint32_t handle; /* The connection handle */
310 uint8_t sec_id; /* security ID used by this client */
311 bool use_co; /* true to use co_rfc_data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800312} tBTA_JV_RFCOMM_CL_INIT;
313/*data associated with BTA_JV_L2CAP_DATA_IND_EVT & BTA_JV_RFCOMM_DATA_IND_EVT */
314typedef struct
315{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700316 uint32_t handle; /* The connection handle */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800317} tBTA_JV_DATA_IND;
318
Kim Schulz8372aa52015-03-25 10:39:40 +0100319/*data associated with BTA_JV_L2CAP_DATA_IND_EVT if used for LE */
320typedef struct
321{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700322 uint32_t handle; /* The connection handle */
Kim Schulz8372aa52015-03-25 10:39:40 +0100323 BT_HDR *p_buf; /* The incoming data */
324} tBTA_JV_LE_DATA_IND;
325
326
The Android Open Source Project5738f832012-12-12 16:00:35 -0800327/* data associated with BTA_JV_RFCOMM_CONG_EVT */
328typedef struct
329{
330 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700331 uint32_t handle; /* The connection handle */
332 bool cong; /* true, congested. false, uncongested */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800333} tBTA_JV_RFCOMM_CONG;
334
The Android Open Source Project5738f832012-12-12 16:00:35 -0800335/* data associated with BTA_JV_RFCOMM_WRITE_EVT */
336typedef struct
337{
338 tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700339 uint32_t handle; /* The connection handle */
340 uint32_t req_id; /* The req_id in the associated BTA_JvRfcommWrite() */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800341 int len; /* The length of the data written. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700342 bool cong; /* congestion status */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800343} tBTA_JV_RFCOMM_WRITE;
344
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +0100345/* data associated with BTA_JV_API_SET_PM_PROFILE_EVT */
346typedef struct
347{
348 tBTA_JV_STATUS status; /* Status of the operation */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700349 uint32_t handle; /* Connection handle */
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +0100350 tBTA_JV_PM_ID app_id; /* JV app ID */
351} tBTA_JV_SET_PM_PROFILE;
352
353/* data associated with BTA_JV_API_NOTIFY_PM_STATE_CHANGE_EVT */
354typedef struct
355{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700356 uint32_t handle; /* Connection handle */
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +0100357 tBTA_JV_CONN_STATE state; /* JV connection stata */
358} tBTA_JV_NOTIFY_PM_STATE_CHANGE;
359
The Android Open Source Project5738f832012-12-12 16:00:35 -0800360
361/* union of data associated with JV callback */
362typedef union
363{
364 tBTA_JV_STATUS status; /* BTA_JV_ENABLE_EVT */
365 tBTA_JV_DISCOVERY_COMP disc_comp; /* BTA_JV_DISCOVERY_COMP_EVT */
366 tBTA_JV_SET_DISCOVER set_discover; /* BTA_JV_SET_DISCOVER_EVT */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700367 uint8_t scn; /* BTA_JV_GET_SCN_EVT */
368 uint16_t psm; /* BTA_JV_GET_PSM_EVT */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800369 tBTA_JV_CREATE_RECORD create_rec; /* BTA_JV_CREATE_RECORD_EVT */
Kim Schulz8372aa52015-03-25 10:39:40 +0100370 tBTA_JV_L2CAP_OPEN l2c_open; /* BTA_JV_L2CAP_OPEN_EVT */
371 tBTA_JV_L2CAP_CLOSE l2c_close; /* BTA_JV_L2CAP_CLOSE_EVT */
372 tBTA_JV_L2CAP_START l2c_start; /* BTA_JV_L2CAP_START_EVT */
373 tBTA_JV_L2CAP_CL_INIT l2c_cl_init; /* BTA_JV_L2CAP_CL_INIT_EVT */
374 tBTA_JV_L2CAP_CONG l2c_cong; /* BTA_JV_L2CAP_CONG_EVT */
375 tBTA_JV_L2CAP_READ l2c_read; /* BTA_JV_L2CAP_READ_EVT */
376 tBTA_JV_L2CAP_WRITE l2c_write; /* BTA_JV_L2CAP_WRITE_EVT */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800377 tBTA_JV_RFCOMM_OPEN rfc_open; /* BTA_JV_RFCOMM_OPEN_EVT */
378 tBTA_JV_RFCOMM_SRV_OPEN rfc_srv_open; /* BTA_JV_RFCOMM_SRV_OPEN_EVT */
379 tBTA_JV_RFCOMM_CLOSE rfc_close; /* BTA_JV_RFCOMM_CLOSE_EVT */
380 tBTA_JV_RFCOMM_START rfc_start; /* BTA_JV_RFCOMM_START_EVT */
381 tBTA_JV_RFCOMM_CL_INIT rfc_cl_init; /* BTA_JV_RFCOMM_CL_INIT_EVT */
382 tBTA_JV_RFCOMM_CONG rfc_cong; /* BTA_JV_RFCOMM_CONG_EVT */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800383 tBTA_JV_RFCOMM_WRITE rfc_write; /* BTA_JV_RFCOMM_WRITE_EVT */
Kim Schulz8372aa52015-03-25 10:39:40 +0100384 tBTA_JV_DATA_IND data_ind; /* BTA_JV_L2CAP_DATA_IND_EVT
The Android Open Source Project5738f832012-12-12 16:00:35 -0800385 BTA_JV_RFCOMM_DATA_IND_EVT */
Kim Schulz8372aa52015-03-25 10:39:40 +0100386 tBTA_JV_LE_DATA_IND le_data_ind; /* BTA_JV_L2CAP_LE_DATA_IND_EVT */
387 tBTA_JV_L2CAP_LE_OPEN l2c_le_open; /* BTA_JV_L2CAP_OPEN_EVT */
388 tBTA_JV_L2CAP_WRITE_FIXED l2c_write_fixed; /* BTA_JV_L2CAP_WRITE_FIXED_EVT */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800389} tBTA_JV;
390
391/* JAVA DM Interface callback */
392typedef void (tBTA_JV_DM_CBACK)(tBTA_JV_EVT event, tBTA_JV *p_data, void * user_data);
393
394/* JAVA RFCOMM interface callback */
395typedef void* (tBTA_JV_RFCOMM_CBACK)(tBTA_JV_EVT event, tBTA_JV *p_data, void *user_data);
396
Kim Schulz8372aa52015-03-25 10:39:40 +0100397/* JAVA L2CAP interface callback */
398typedef void (tBTA_JV_L2CAP_CBACK)(tBTA_JV_EVT event, tBTA_JV *p_data, void *user_Data);
399
The Android Open Source Project5738f832012-12-12 16:00:35 -0800400/* JV configuration structure */
401typedef struct
402{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700403 uint16_t sdp_raw_size; /* The size of p_sdp_raw_data */
404 uint16_t sdp_db_size; /* The size of p_sdp_db */
405 uint8_t *p_sdp_raw_data; /* The data buffer to keep raw data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800406 tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
407} tBTA_JV_CFG;
408
The Android Open Source Project5738f832012-12-12 16:00:35 -0800409/*******************************************************************************
410**
411** Function BTA_JvEnable
412**
413** Description Enable the Java I/F service. When the enable
414** operation is complete the callback function will be
415** called with a BTA_JV_ENABLE_EVT. This function must
416** be called before other functions in the JV API are
417** called.
418**
419** Returns BTA_JV_SUCCESS if successful.
420** BTA_JV_FAIL if internal failure.
421**
422*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700423tBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800424
425/*******************************************************************************
426**
427** Function BTA_JvDisable
428**
429** Description Disable the Java I/F
430**
431** Returns void
432**
433*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700434void BTA_JvDisable(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800435
436/*******************************************************************************
437**
The Android Open Source Project5738f832012-12-12 16:00:35 -0800438** Function BTA_JvIsEncrypted
439**
440** Description This function checks if the link to peer device is encrypted
441**
Marie Janssene9e58ce2016-06-17 14:12:17 -0700442** Returns true if encrypted.
443** false if not.
The Android Open Source Project5738f832012-12-12 16:00:35 -0800444**
445*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700446bool BTA_JvIsEncrypted(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800447
448/*******************************************************************************
449**
Kim Schulz8372aa52015-03-25 10:39:40 +0100450** Function BTA_JvGetChannelId
451**
452** Description This function reserves a SCN/PSM for applications running
453** over RFCOMM or L2CAP. It is primarily called by
454** server profiles/applications to register their SCN/PSM into the
455** SDP database. The SCN is reported by the tBTA_JV_DM_CBACK
456** callback with a BTA_JV_GET_SCN_EVT.
457** If the SCN/PSM reported is 0, that means all SCN resources are
458** exhausted.
459** The channel parameter can be used to request a specific
460** channel. If the request on the specific channel fails, the
461** SCN/PSM returned in the EVT will be 0 - no attempt to request
462** a new channel will be made. set channel to <= 0 to automatically
463** assign an channel ID.
464**
465** Returns BTA_JV_SUCCESS, if the request is being processed.
466** BTA_JV_FAILURE, otherwise.
467**
468*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700469tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700470 int32_t channel);
Kim Schulz8372aa52015-03-25 10:39:40 +0100471
472/*******************************************************************************
473**
474** Function BTA_JvFreeChannel
475**
476** Description This function frees a SCN/PSM that was used
477** by an application running over RFCOMM or L2CAP.
478**
479** Returns BTA_JV_SUCCESS, if the request is being processed.
480** BTA_JV_FAILURE, otherwise.
481**
482*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700483tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type);
Kim Schulz8372aa52015-03-25 10:39:40 +0100484
485/*******************************************************************************
486**
The Android Open Source Project5738f832012-12-12 16:00:35 -0800487** Function BTA_JvStartDiscovery
488**
489** Description This function performs service discovery for the services
490** provided by the given peer device. When the operation is
491** complete the tBTA_JV_DM_CBACK callback function will be
492** called with a BTA_JV_DISCOVERY_COMP_EVT.
493**
494** Returns BTA_JV_SUCCESS, if the request is being processed.
495** BTA_JV_FAILURE, otherwise.
496**
497*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700498tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, uint16_t num_uuid,
June R. Tate-Gans24933b52014-09-24 15:25:02 -0700499 tSDP_UUID *p_uuid_list, void* user_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800500
501/*******************************************************************************
502**
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700503** Function BTA_JvCreateRecordByUser
The Android Open Source Project5738f832012-12-12 16:00:35 -0800504**
505** Description Create a service record in the local SDP database by user in
506** tBTA_JV_DM_CBACK callback with a BTA_JV_CREATE_RECORD_EVT.
507**
508** Returns BTA_JV_SUCCESS, if the request is being processed.
509** BTA_JV_FAILURE, otherwise.
510**
511*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700512tBTA_JV_STATUS BTA_JvCreateRecordByUser(void* user_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800513
514/*******************************************************************************
515**
The Android Open Source Project5738f832012-12-12 16:00:35 -0800516** Function BTA_JvDeleteRecord
517**
518** Description Delete a service record in the local SDP database.
519**
520** Returns BTA_JV_SUCCESS, if the request is being processed.
521** BTA_JV_FAILURE, otherwise.
522**
523*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700524tBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800525
526/*******************************************************************************
527**
Kim Schulz8372aa52015-03-25 10:39:40 +0100528** Function BTA_JvL2capConnectLE
529**
530** Description Initiate a connection as an LE L2CAP client to the given BD
531** Address.
532** When the connection is initiated or failed to initiate,
533** tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_CL_INIT_EVT
534** When the connection is established or failed,
535** tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
536**
537** Returns BTA_JV_SUCCESS, if the request is being processed.
538** BTA_JV_FAILURE, otherwise.
539**
540*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700541tBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700542 const tL2CAP_ERTM_INFO *ertm_info, uint16_t remote_chan,
543 uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
Kim Schulz8372aa52015-03-25 10:39:40 +0100544 BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
545
546/*******************************************************************************
547**
548** Function BTA_JvL2capConnect
549**
550** Description Initiate a connection as a L2CAP client to the given BD
551** Address.
552** When the connection is initiated or failed to initiate,
553** tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_CL_INIT_EVT
554** When the connection is established or failed,
555** tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT
556**
557** Returns BTA_JV_SUCCESS, if the request is being processed.
558** BTA_JV_FAILURE, otherwise.
559**
560*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700561tBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700562 const tL2CAP_ERTM_INFO *ertm_info, uint16_t remote_psm,
563 uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
Kim Schulz8372aa52015-03-25 10:39:40 +0100564 BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
565
566/*******************************************************************************
567**
568** Function BTA_JvL2capClose
569**
570** Description This function closes an L2CAP client connection
571**
572** Returns BTA_JV_SUCCESS, if the request is being processed.
573** BTA_JV_FAILURE, otherwise.
574**
575*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700576tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);
Kim Schulz8372aa52015-03-25 10:39:40 +0100577
578/*******************************************************************************
579**
580** Function BTA_JvL2capCloseLE
581**
582** Description This function closes an L2CAP client connection for Fixed Channels
583** Function is idempotent and no callbacks are called!
584**
585** Returns BTA_JV_SUCCESS, if the request is being processed.
586** BTA_JV_FAILURE, otherwise.
587**
588*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700589tBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle);
Kim Schulz8372aa52015-03-25 10:39:40 +0100590
591/*******************************************************************************
592**
593** Function BTA_JvL2capStartServer
594**
595** Description This function starts an L2CAP server and listens for an L2CAP
596** connection from a remote Bluetooth device. When the server
597** is started successfully, tBTA_JV_L2CAP_CBACK is called with
598** BTA_JV_L2CAP_START_EVT. When the connection is established,
599** tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT.
600**
601** Returns BTA_JV_SUCCESS, if the request is being processed.
602** BTA_JV_FAILURE, otherwise.
603**
604*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700605tBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
Kim Schulz8372aa52015-03-25 10:39:40 +0100606 const tL2CAP_ERTM_INFO *ertm_info,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700607 uint16_t local_psm, uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
Kim Schulz8372aa52015-03-25 10:39:40 +0100608 tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
609
610/*******************************************************************************
611**
612** Function BTA_JvL2capStartServerLE
613**
614** Description This function starts an LE L2CAP server and listens for an L2CAP
615** connection from a remote Bluetooth device on a fixed channel
616** over an LE link. When the server
617** is started successfully, tBTA_JV_L2CAP_CBACK is called with
618** BTA_JV_L2CAP_START_EVT. When the connection is established,
619** tBTA_JV_L2CAP_CBACK is called with BTA_JV_L2CAP_OPEN_EVT.
620**
621** Returns BTA_JV_SUCCESS, if the request is being processed.
622** BTA_JV_FAILURE, otherwise.
623**
624*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700625tBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
Kim Schulz8372aa52015-03-25 10:39:40 +0100626 const tL2CAP_ERTM_INFO *ertm_info,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700627 uint16_t local_chan, uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
Kim Schulz8372aa52015-03-25 10:39:40 +0100628 tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
629
630/*******************************************************************************
631**
632** Function BTA_JvL2capStopServerLE
633**
634** Description This function stops the LE L2CAP server. If the server has an
635** active connection, it would be closed.
636**
637** Returns BTA_JV_SUCCESS, if the request is being processed.
638** BTA_JV_FAILURE, otherwise.
639**
640*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700641tBTA_JV_STATUS BTA_JvL2capStopServerLE(uint16_t local_chan, void *user_data);
Kim Schulz8372aa52015-03-25 10:39:40 +0100642
643/*******************************************************************************
644**
645** Function BTA_JvL2capStopServerLE
646**
647** Description This function stops the LE L2CAP server. If the server has an
648** active connection, it would be closed.
649**
650** Returns BTA_JV_SUCCESS, if the request is being processed.
651** BTA_JV_FAILURE, otherwise.
652**
653*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700654tBTA_JV_STATUS BTA_JvL2capStopServer(uint16_t local_psm, void *user_data);
Kim Schulz8372aa52015-03-25 10:39:40 +0100655
656/*******************************************************************************
657**
658** Function BTA_JvL2capRead
659**
660** Description This function reads data from an L2CAP connection
661** When the operation is complete, tBTA_JV_L2CAP_CBACK is
662** called with BTA_JV_L2CAP_READ_EVT.
663**
664** Returns BTA_JV_SUCCESS, if the request is being processed.
665** BTA_JV_FAILURE, otherwise.
666**
667*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700668tBTA_JV_STATUS BTA_JvL2capRead(uint32_t handle, uint32_t req_id,
669 uint8_t *p_data, uint16_t len);
Kim Schulz8372aa52015-03-25 10:39:40 +0100670
671/*******************************************************************************
672**
673** Function BTA_JvL2capReady
674**
675** Description This function determined if there is data to read from
676** an L2CAP connection
677**
678** Returns BTA_JV_SUCCESS, if data queue size is in *p_data_size.
679** BTA_JV_FAILURE, if error.
680**
681*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700682tBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t *p_data_size);
Kim Schulz8372aa52015-03-25 10:39:40 +0100683
684/*******************************************************************************
685**
686** Function BTA_JvL2capWrite
687**
688** Description This function writes data to an L2CAP connection
689** When the operation is complete, tBTA_JV_L2CAP_CBACK is
690** called with BTA_JV_L2CAP_WRITE_EVT. Works for
691** PSM-based connections
692**
693** Returns BTA_JV_SUCCESS, if the request is being processed.
694** BTA_JV_FAILURE, otherwise.
695**
696*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700697tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id,
698 uint8_t *p_data, uint16_t len, void *user_data);
Kim Schulz8372aa52015-03-25 10:39:40 +0100699
700
701/*******************************************************************************
702**
703** Function BTA_JvL2capWriteFixed
704**
705** Description This function writes data to an L2CAP connection
706** When the operation is complete, tBTA_JV_L2CAP_CBACK is
707** called with BTA_JV_L2CAP_WRITE_FIXED_EVT. Works for
708** fixed-channel connections
709**
710** Returns BTA_JV_SUCCESS, if the request is being processed.
711** BTA_JV_FAILURE, otherwise.
712**
713*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700714tBTA_JV_STATUS BTA_JvL2capWriteFixed(uint16_t channel, BD_ADDR *addr, uint32_t req_id,
Kim Schulz8372aa52015-03-25 10:39:40 +0100715 tBTA_JV_L2CAP_CBACK *p_cback,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700716 uint8_t *p_data, uint16_t len, void *user_data);
Kim Schulz8372aa52015-03-25 10:39:40 +0100717
718/*******************************************************************************
719**
The Android Open Source Project5738f832012-12-12 16:00:35 -0800720** Function BTA_JvRfcommConnect
721**
722** Description This function makes an RFCOMM conection to a remote BD
723** Address.
724** When the connection is initiated or failed to initiate,
725** tBTA_JV_RFCOMM_CBACK is called with BTA_JV_RFCOMM_CL_INIT_EVT
726** When the connection is established or failed,
727** tBTA_JV_RFCOMM_CBACK is called with BTA_JV_RFCOMM_OPEN_EVT
728**
729** Returns BTA_JV_SUCCESS, if the request is being processed.
730** BTA_JV_FAILURE, otherwise.
731**
732*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700733tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700734 tBTA_JV_ROLE role, uint8_t remote_scn, BD_ADDR peer_bd_addr,
June R. Tate-Gans24933b52014-09-24 15:25:02 -0700735 tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800736
737/*******************************************************************************
738**
739** Function BTA_JvRfcommClose
740**
741** Description This function closes an RFCOMM connection
742**
743** Returns BTA_JV_SUCCESS, if the request is being processed.
744** BTA_JV_FAILURE, otherwise.
745**
746*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700747tBTA_JV_STATUS BTA_JvRfcommClose(uint32_t handle, void* user_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800748
749/*******************************************************************************
750**
751** Function BTA_JvRfcommStartServer
752**
753** Description This function starts listening for an RFCOMM connection
754** request from a remote Bluetooth device. When the server is
755** started successfully, tBTA_JV_RFCOMM_CBACK is called
756** with BTA_JV_RFCOMM_START_EVT.
757** When the connection is established, tBTA_JV_RFCOMM_CBACK
758** is called with BTA_JV_RFCOMM_OPEN_EVT.
759**
760** Returns BTA_JV_SUCCESS, if the request is being processed.
761** BTA_JV_FAILURE, otherwise.
762**
763*******************************************************************************/
Sharvil Nanavati547a2972016-04-06 14:46:49 -0700764tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700765 tBTA_JV_ROLE role, uint8_t local_scn, uint8_t max_session,
June R. Tate-Gans24933b52014-09-24 15:25:02 -0700766 tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800767
768/*******************************************************************************
769**
770** Function BTA_JvRfcommStopServer
771**
772** Description This function stops the RFCOMM server. If the server has an
773** active connection, it would be closed.
774**
775** Returns BTA_JV_SUCCESS, if the request is being processed.
776** BTA_JV_FAILURE, otherwise.
777**
778*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700779tBTA_JV_STATUS BTA_JvRfcommStopServer(uint32_t handle, void* user_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800780
781/*******************************************************************************
782**
783** Function BTA_JvRfcommWrite
784**
785** Description This function writes data to an RFCOMM connection
786** When the operation is complete, tBTA_JV_RFCOMM_CBACK is
787** called with BTA_JV_RFCOMM_WRITE_EVT.
788**
789** Returns BTA_JV_SUCCESS, if the request is being processed.
790** BTA_JV_FAILURE, otherwise.
791**
792*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700793tBTA_JV_STATUS BTA_JvRfcommWrite(uint32_t handle, uint32_t req_id);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800794
Ganesh Ganapathi Batta2f338f22013-03-24 03:11:59 +0100795/*******************************************************************************
796 **
797 ** Function BTA_JVSetPmProfile
798 **
799 ** Description This function set or free power mode profile for different JV application
800 **
801 ** Parameters: handle, JV handle from RFCOMM or L2CAP
802 ** app_id: app specific pm ID, can be BTA_JV_PM_ALL, see bta_dm_cfg.c for details
803 ** BTA_JV_PM_ID_CLEAR: removes pm management on the handle. init_st is ignored and
804 ** BTA_JV_CONN_CLOSE is called implicitely
805 ** init_st: state after calling this API. typically it should be BTA_JV_CONN_OPEN
806 **
807 ** Returns BTA_JV_SUCCESS, if the request is being processed.
808 ** BTA_JV_FAILURE, otherwise.
809 **
810 ** NOTE: BTA_JV_PM_ID_CLEAR: In general no need to be called as jv pm calls automatically
811 ** BTA_JV_CONN_CLOSE to remove in case of connection close!
812 **
813 *******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700814tBTA_JV_STATUS BTA_JvSetPmProfile(uint32_t handle, tBTA_JV_PM_ID app_id,
June R. Tate-Gans24933b52014-09-24 15:25:02 -0700815 tBTA_JV_CONN_STATE init_st);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800816
817/*******************************************************************************
818**
819** Function BTA_JvRfcommGetPortHdl
820**
821** Description This function fetches the rfcomm port handle
822**
823** Returns BTA_JV_SUCCESS, if the request is being processed.
824** BTA_JV_FAILURE, otherwise.
825**
826*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -0700827uint16_t BTA_JvRfcommGetPortHdl(uint32_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800828
Jakub Pawlowski713993d2016-04-21 13:16:45 -0700829#ifdef __cplusplus
830}
831#endif
832
The Android Open Source Project5738f832012-12-12 16:00:35 -0800833#endif /* BTA_JV_API_H */