1 /******************************************************************************
3 * Copyright (C) 2003-2013 Broadcom Corporation
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:
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ******************************************************************************/
19 /******************************************************************************
21 * This is the public interface file for BTA GATT.
23 ******************************************************************************/
25 #ifndef BTA_GATT_API_H
26 #define BTA_GATT_API_H
31 #ifndef BTA_GATT_INCLUDED
32 #warning BTA_GATT_INCLUDED not defined
33 #define BTA_GATT_INCLUDED FALSE
36 #if ((BLE_INCLUDED == FALSE) && (BTA_GATT_INCLUDED == TRUE))
37 #undef BTA_GATT_INCLUDED
38 #define BTA_GATT_INCLUDED FALSE
42 #ifndef BTA_GATT_DEBUG
43 #define BTA_GATT_DEBUG FALSE
46 /*****************************************************************************
47 ** Constants and data types
48 *****************************************************************************/
49 /**************************
51 ***************************/
55 tBT_UUID uuid; /* uuid of the attribute */
56 UINT8 inst_id; /* instance ID */
57 } __attribute__((packed)) tBTA_GATT_ID;
59 /* Success code and error codes */
60 #define BTA_GATT_OK GATT_SUCCESS
61 #define BTA_GATT_INVALID_HANDLE GATT_INVALID_HANDLE /* 0x0001 */
62 #define BTA_GATT_READ_NOT_PERMIT GATT_READ_NOT_PERMIT /* 0x0002 */
63 #define BTA_GATT_WRITE_NOT_PERMIT GATT_WRITE_NOT_PERMIT /* 0x0003 */
64 #define BTA_GATT_INVALID_PDU GATT_INVALID_PDU /* 0x0004 */
65 #define BTA_GATT_INSUF_AUTHENTICATION GATT_INSUF_AUTHENTICATION /* 0x0005 */
66 #define BTA_GATT_REQ_NOT_SUPPORTED GATT_REQ_NOT_SUPPORTED /* 0x0006 */
67 #define BTA_GATT_INVALID_OFFSET GATT_INVALID_OFFSET /* 0x0007 */
68 #define BTA_GATT_INSUF_AUTHORIZATION GATT_INSUF_AUTHORIZATION /* 0x0008 */
69 #define BTA_GATT_PREPARE_Q_FULL GATT_PREPARE_Q_FULL /* 0x0009 */
70 #define BTA_GATT_NOT_FOUND GATT_NOT_FOUND /* 0x000a */
71 #define BTA_GATT_NOT_LONG GATT_NOT_LONG /* 0x000b */
72 #define BTA_GATT_INSUF_KEY_SIZE GATT_INSUF_KEY_SIZE /* 0x000c */
73 #define BTA_GATT_INVALID_ATTR_LEN GATT_INVALID_ATTR_LEN /* 0x000d */
74 #define BTA_GATT_ERR_UNLIKELY GATT_ERR_UNLIKELY /* 0x000e */
75 #define BTA_GATT_INSUF_ENCRYPTION GATT_INSUF_ENCRYPTION /* 0x000f */
76 #define BTA_GATT_UNSUPPORT_GRP_TYPE GATT_UNSUPPORT_GRP_TYPE /* 0x0010 */
77 #define BTA_GATT_INSUF_RESOURCE GATT_INSUF_RESOURCE /* 0x0011 */
80 #define BTA_GATT_NO_RESOURCES GATT_NO_RESOURCES /* 0x80 */
81 #define BTA_GATT_INTERNAL_ERROR GATT_INTERNAL_ERROR /* 0x81 */
82 #define BTA_GATT_WRONG_STATE GATT_WRONG_STATE /* 0x82 */
83 #define BTA_GATT_DB_FULL GATT_DB_FULL /* 0x83 */
84 #define BTA_GATT_BUSY GATT_BUSY /* 0x84 */
85 #define BTA_GATT_ERROR GATT_ERROR /* 0x85 */
86 #define BTA_GATT_CMD_STARTED GATT_CMD_STARTED /* 0x86 */
87 #define BTA_GATT_ILLEGAL_PARAMETER GATT_ILLEGAL_PARAMETER /* 0x87 */
88 #define BTA_GATT_PENDING GATT_PENDING /* 0x88 */
89 #define BTA_GATT_AUTH_FAIL GATT_AUTH_FAIL /* 0x89 */
90 #define BTA_GATT_MORE GATT_MORE /* 0x8a */
91 #define BTA_GATT_INVALID_CFG GATT_INVALID_CFG /* 0x8b */
92 #define BTA_GATT_SERVICE_STARTED GATT_SERVICE_STARTED /* 0x8c */
93 #define BTA_GATT_ENCRYPED_MITM GATT_ENCRYPED_MITM /* GATT_SUCCESS */
94 #define BTA_GATT_ENCRYPED_NO_MITM GATT_ENCRYPED_NO_MITM /* 0x8d */
95 #define BTA_GATT_NOT_ENCRYPTED GATT_NOT_ENCRYPTED /* 0x8e */
96 #define BTA_GATT_CONGESTED GATT_CONGESTED /* 0x8f */
98 #define BTA_GATT_DUP_REG 0x90 /* 0x90 */
99 #define BTA_GATT_ALREADY_OPEN 0x91 /* 0x91 */
100 #define BTA_GATT_CANCEL 0x92 /* 0x92 */
102 /* 0xE0 ~ 0xFC reserved for future use */
103 #define BTA_GATT_CCC_CFG_ERR GATT_CCC_CFG_ERR /* 0xFD Client Characteristic Configuration Descriptor Improperly Configured */
104 #define BTA_GATT_PRC_IN_PROGRESS GATT_PRC_IN_PROGRESS /* 0xFE Procedure Already in progress */
105 #define BTA_GATT_OUT_OF_RANGE GATT_OUT_OF_RANGE /* 0xFFAttribute value out of range */
107 typedef UINT8 tBTA_GATT_STATUS;
109 #define BTA_GATT_INVALID_CONN_ID GATT_INVALID_CONN_ID
112 /* Client callback function events */
113 #define BTA_GATTC_REG_EVT 0 /* GATT client is registered. */
114 #define BTA_GATTC_DEREG_EVT 1 /* GATT client deregistered event */
115 #define BTA_GATTC_OPEN_EVT 2 /* GATTC open request status event */
116 #define BTA_GATTC_READ_CHAR_EVT 3 /* GATT read characteristic event */
117 #define BTA_GATTC_WRITE_CHAR_EVT 4 /* GATT write characteristic or char descriptor event */
118 #define BTA_GATTC_CLOSE_EVT 5 /* GATTC close request status event */
119 #define BTA_GATTC_SEARCH_CMPL_EVT 6 /* GATT discovery complete event */
120 #define BTA_GATTC_SEARCH_RES_EVT 7 /* GATT discovery result event */
121 #define BTA_GATTC_READ_DESCR_EVT 8 /* GATT read characterisitc descriptor event */
122 #define BTA_GATTC_WRITE_DESCR_EVT 9 /* GATT write characteristic descriptor event */
123 #define BTA_GATTC_NOTIF_EVT 10 /* GATT attribute notification event */
124 #define BTA_GATTC_PREP_WRITE_EVT 11 /* GATT prepare write event */
125 #define BTA_GATTC_EXEC_EVT 12 /* execute write complete event */
126 #define BTA_GATTC_ACL_EVT 13 /* ACL up event */
127 #define BTA_GATTC_CANCEL_OPEN_EVT 14 /* cancel open event */
128 #define BTA_GATTC_SRVC_CHG_EVT 15 /* service change event */
129 #define BTA_GATTC_LISTEN_EVT 16 /* listen event */
130 #define BTA_GATTC_ENC_CMPL_CB_EVT 17 /* encryption complete callback event */
131 #define BTA_GATTC_CFG_MTU_EVT 18 /* configure MTU complete event */
132 #define BTA_GATTC_ADV_DATA_EVT 19 /* ADV data event */
133 #define BTA_GATTC_MULT_ADV_ENB_EVT 20 /* Enable Multi ADV event */
134 #define BTA_GATTC_MULT_ADV_UPD_EVT 21 /* Update parameter event */
135 #define BTA_GATTC_MULT_ADV_DATA_EVT 22 /* Multi ADV data event */
136 #define BTA_GATTC_MULT_ADV_DIS_EVT 23 /* Disable Multi ADV event */
137 #define BTA_GATTC_CONGEST_EVT 24 /* Congestion event */
138 #define BTA_GATTC_BTH_SCAN_ENB_EVT 25 /* Enable batch scan event */
139 #define BTA_GATTC_BTH_SCAN_CFG_EVT 26 /* Config storage event */
140 #define BTA_GATTC_BTH_SCAN_RD_EVT 27 /* Batch scan reports read event */
141 #define BTA_GATTC_BTH_SCAN_THR_EVT 28 /* Batch scan threshold event */
142 #define BTA_GATTC_BTH_SCAN_PARAM_EVT 29 /* Batch scan param event */
143 #define BTA_GATTC_BTH_SCAN_DIS_EVT 30 /* Disable batch scan event */
144 #define BTA_GATTC_SCAN_FLT_CFG_EVT 31 /* Scan filter config event */
145 #define BTA_GATTC_SCAN_FLT_PARAM_EVT 32 /* Param filter event */
146 #define BTA_GATTC_SCAN_FLT_STATUS_EVT 33 /* Filter status event */
147 #define BTA_GATTC_ADV_VSC_EVT 34 /* ADV VSC event */
149 typedef UINT8 tBTA_GATTC_EVT;
151 typedef tGATT_IF tBTA_GATTC_IF;
155 UINT16 unit; /* as UUIUD defined by SIG */
156 UINT16 descr; /* as UUID as defined by SIG */
159 UINT8 name_spc; /* The name space of the description */
160 }tBTA_GATT_CHAR_PRES;
162 #define BTA_GATT_CLT_CONFIG_NONE GATT_CLT_CONFIG_NONE /* 0x0000 */
163 #define BTA_GATT_CLT_CONFIG_NOTIFICATION GATT_CLT_CONFIG_NOTIFICATION /* 0x0001 */
164 #define BTA_GATT_CLT_CONFIG_INDICATION GATT_CLT_CONFIG_INDICATION /* 0x0002 */
165 typedef UINT16 tBTA_GATT_CLT_CHAR_CONFIG;
167 /* characteristic descriptor: server configuration value
169 #define BTA_GATT_SVR_CONFIG_NONE GATT_SVR_CONFIG_NONE /* 0x0000 */
170 #define BTA_GATT_SVR_CONFIG_BROADCAST GATT_SVR_CONFIG_BROADCAST /* 0x0001 */
171 typedef UINT16 tBTA_GATT_SVR_CHAR_CONFIG;
173 /* Characteristic Aggregate Format attribute value
175 #define BTA_GATT_AGGR_HANDLE_NUM_MAX 10
179 UINT16 handle_list[BTA_GATT_AGGR_HANDLE_NUM_MAX];
180 } tBTA_GATT_CHAR_AGGRE;
181 typedef tGATT_VALID_RANGE tBTA_GATT_VALID_RANGE;
189 #define BTA_GATT_MAX_ATTR_LEN GATT_MAX_ATTR_LEN
191 #define BTA_GATTC_TYPE_WRITE GATT_WRITE
192 #define BTA_GATTC_TYPE_WRITE_NO_RSP GATT_WRITE_NO_RSP
193 typedef UINT8 tBTA_GATTC_WRITE_TYPE;
195 #define BTA_GATT_CONN_UNKNOWN 0
196 #define BTA_GATT_CONN_L2C_FAILURE GATT_CONN_L2C_FAILURE /* general l2cap resource failure */
197 #define BTA_GATT_CONN_TIMEOUT GATT_CONN_TIMEOUT /* 0x08 connection timeout */
198 #define BTA_GATT_CONN_TERMINATE_PEER_USER GATT_CONN_TERMINATE_PEER_USER /* 0x13 connection terminate by peer user */
199 #define BTA_GATT_CONN_TERMINATE_LOCAL_HOST GATT_CONN_TERMINATE_LOCAL_HOST/* 0x16 connectionterminated by local host */
200 #define BTA_GATT_CONN_FAIL_ESTABLISH GATT_CONN_FAIL_ESTABLISH /* 0x03E connection fail to establish */
201 #define BTA_GATT_CONN_LMP_TIMEOUT GATT_CONN_LMP_TIMEOUT /* 0x22 connection fail for LMP response tout */
202 #define BTA_GATT_CONN_CANCEL GATT_CONN_CANCEL /* 0x0100 L2CAP connection cancelled */
203 #define BTA_GATT_CONN_NONE 0x0101 /* 0x0101 no connection to cancel */
204 typedef UINT16 tBTA_GATT_REASON;
214 tBTA_GATT_SRVC_ID srvc_id;
215 tBTA_GATT_ID char_id;
220 tBTA_GATTC_CHAR_ID char_id;
221 tBTA_GATT_ID descr_id;
222 }tBTA_GATTC_CHAR_DESCR_ID;
226 tBTA_GATT_SRVC_ID srvc_id;
227 tBTA_GATT_SRVC_ID incl_svc_id;
228 }tBTA_GATTC_INCL_SVC_ID;
230 #define BTA_GATT_TYPE_CHAR 0
231 #define BTA_GATT_TYPE_CHAR_DESCR 1
232 typedef UINT8 tBTA_GATT_ID_TYPE;
236 tBTA_GATT_ID_TYPE id_type;
239 tBTA_GATTC_CHAR_ID char_id;
240 tBTA_GATTC_CHAR_DESCR_ID char_descr_id;
245 #define BTA_GATTC_MULTI_MAX GATT_MAX_READ_MULTI_HANDLES
250 tBTA_GATTC_ATTR_ID id_list[BTA_GATTC_MULTI_MAX];
254 #define BTA_GATT_AUTH_REQ_NONE GATT_AUTH_REQ_NONE
255 #define BTA_GATT_AUTH_REQ_NO_MITM GATT_AUTH_REQ_NO_MITM /* unauthenticated encryption */
256 #define BTA_GATT_AUTH_REQ_MITM GATT_AUTH_REQ_MITM /* authenticated encryption */
257 #define BTA_GATT_AUTH_REQ_SIGNED_NO_MITM GATT_AUTH_REQ_SIGNED_NO_MITM
258 #define BTA_GATT_AUTH_REQ_SIGNED_MITM GATT_AUTH_REQ_SIGNED_MITM
260 typedef tGATT_AUTH_REQ tBTA_GATT_AUTH_REQ;
264 BTA_GATTC_ATTR_TYPE_INCL_SRVC,
265 BTA_GATTC_ATTR_TYPE_CHAR,
266 BTA_GATTC_ATTR_TYPE_CHAR_DESCR,
267 BTA_GATTC_ATTR_TYPE_SRVC
269 typedef UINT8 tBTA_GATTC_ATTR_TYPE;
276 UINT16 e_handle; /* used for service only */
279 UINT8 prop; /* used when attribute type is characteristic */
280 BOOLEAN is_primary; /* used when attribute type is service */
283 /* callback data structure */
286 tBTA_GATT_STATUS status;
287 tBTA_GATTC_IF client_if;
295 UINT8 num_pres_fmt; /* number of presentation format aggregated*/
296 tBTA_GATTC_CHAR_DESCR_ID pre_format[BTA_GATTC_MULTI_MAX];
297 }tBTA_GATT_CHAR_AGGRE_VALUE;
301 tBTA_GATT_CHAR_AGGRE_VALUE aggre_value;
302 tBTA_GATT_UNFMT unformat;
309 tBTA_GATT_STATUS status;
310 tBTA_GATT_SRVC_ID srvc_id;
311 tBTA_GATT_ID char_id;
312 tBTA_GATT_ID descr_type;
313 tBTA_GATT_READ_VAL *p_value;
319 tBTA_GATT_STATUS status;
320 tBTA_GATT_SRVC_ID srvc_id;
321 tBTA_GATT_ID char_id;
322 tBTA_GATT_ID descr_type;
328 tBTA_GATT_STATUS status;
329 }tBTA_GATTC_EXEC_CMPL;
334 tBTA_GATT_STATUS status;
335 }tBTA_GATTC_SEARCH_CMPL;
340 tBTA_GATT_SRVC_ID service_uuid;
341 }tBTA_GATTC_SRVC_RES;
346 tBTA_GATT_STATUS status;
352 tBTA_GATT_STATUS status;
354 tBTA_GATTC_IF client_if;
356 tBTA_TRANSPORT transport;
362 tBTA_GATT_STATUS status;
364 tBTA_GATTC_IF client_if;
366 tBTA_GATT_REASON reason; /* disconnect reason code, not useful when connect event is reported */
373 tBTA_GATTC_CHAR_ID char_id;
374 tBTA_GATT_ID descr_type;
376 UINT8 value[BTA_GATT_MAX_ATTR_LEN];
383 BOOLEAN congested; /* congestion indicator */
389 tBTA_GATT_STATUS status;
390 tBTA_GATTC_IF client_if;
393 }tBTA_GATTC_OPEN_CLOSE;
398 tBTA_GATTC_IF client_if;
400 }tBTA_GATTC_ENC_CMPL_CB;
404 tBTA_GATT_STATUS status;
406 tBTA_GATTC_SEARCH_CMPL search_cmpl; /* discovery complete */
407 tBTA_GATTC_SRVC_RES srvc_res; /* discovery result */
408 tBTA_GATTC_REG reg_oper; /* registration data */
409 tBTA_GATTC_OPEN open;
410 tBTA_GATTC_CLOSE close;
411 tBTA_GATTC_READ read; /* read attribute/descriptor data */
412 tBTA_GATTC_WRITE write; /* write complete data */
413 tBTA_GATTC_EXEC_CMPL exec_cmpl; /* execute complete */
414 tBTA_GATTC_NOTIFY notify; /* notification/indication event data */
415 tBTA_GATTC_ENC_CMPL_CB enc_cmpl;
416 BD_ADDR remote_bda; /* service change event */
417 tBTA_GATTC_CFG_MTU cfg_mtu; /* configure MTU operation */
418 tBTA_GATTC_CONGEST congest;
421 /* GATTC enable callback function */
422 typedef void (tBTA_GATTC_ENB_CBACK)(tBTA_GATT_STATUS status);
424 /* Client callback function */
425 typedef void (tBTA_GATTC_CBACK)(tBTA_GATTC_EVT event, tBTA_GATTC *p_data);
428 /* GATT Server Data Structure */
429 /* Server callback function events */
430 #define BTA_GATTS_REG_EVT 0
431 #define BTA_GATTS_READ_EVT GATTS_REQ_TYPE_READ /* 1 */
432 #define BTA_GATTS_WRITE_EVT GATTS_REQ_TYPE_WRITE /* 2 */
433 #define BTA_GATTS_EXEC_WRITE_EVT GATTS_REQ_TYPE_WRITE_EXEC /* 3 */
434 #define BTA_GATTS_MTU_EVT GATTS_REQ_TYPE_MTU /* 4 */
435 #define BTA_GATTS_CONF_EVT GATTS_REQ_TYPE_CONF /* 5 */
436 #define BTA_GATTS_DEREG_EVT 6
437 #define BTA_GATTS_CREATE_EVT 7
438 #define BTA_GATTS_ADD_INCL_SRVC_EVT 8
439 #define BTA_GATTS_ADD_CHAR_EVT 9
440 #define BTA_GATTS_ADD_CHAR_DESCR_EVT 10
441 #define BTA_GATTS_DELELTE_EVT 11
442 #define BTA_GATTS_START_EVT 12
443 #define BTA_GATTS_STOP_EVT 13
444 #define BTA_GATTS_CONNECT_EVT 14
445 #define BTA_GATTS_DISCONNECT_EVT 15
446 #define BTA_GATTS_OPEN_EVT 16
447 #define BTA_GATTS_CANCEL_OPEN_EVT 17
448 #define BTA_GATTS_CLOSE_EVT 18
449 #define BTA_GATTS_LISTEN_EVT 19
450 #define BTA_GATTS_CONGEST_EVT 20
452 typedef UINT8 tBTA_GATTS_EVT;
453 typedef tGATT_IF tBTA_GATTS_IF;
455 /* Attribute permissions
457 #define BTA_GATT_PERM_READ GATT_PERM_READ /* bit 0 - 0x0001 */
458 #define BTA_GATT_PERM_READ_ENCRYPTED GATT_PERM_READ_ENCRYPTED /* bit 1 - 0x0002 */
459 #define BTA_GATT_PERM_READ_ENC_MITM GATT_PERM_READ_ENC_MITM /* bit 2 - 0x0004 */
460 #define BTA_GATT_PERM_WRITE GATT_PERM_WRITE /* bit 4 - 0x0010 */
461 #define BTA_GATT_PERM_WRITE_ENCRYPTED GATT_PERM_WRITE_ENCRYPTED /* bit 5 - 0x0020 */
462 #define BTA_GATT_PERM_WRITE_ENC_MITM GATT_PERM_WRITE_ENC_MITM /* bit 6 - 0x0040 */
463 #define BTA_GATT_PERM_WRITE_SIGNED GATT_PERM_WRITE_SIGNED /* bit 7 - 0x0080 */
464 #define BTA_GATT_PERM_WRITE_SIGNED_MITM GATT_PERM_WRITE_SIGNED_MITM /* bit 8 - 0x0100 */
465 typedef UINT16 tBTA_GATT_PERM;
467 #define BTA_GATTS_INVALID_APP 0xff
469 #define BTA_GATTS_INVALID_IF 0
471 /* definition of characteristic properties */
472 #define BTA_GATT_CHAR_PROP_BIT_BROADCAST GATT_CHAR_PROP_BIT_BROADCAST /* 0x01 */
473 #define BTA_GATT_CHAR_PROP_BIT_READ GATT_CHAR_PROP_BIT_READ /* 0x02 */
474 #define BTA_GATT_CHAR_PROP_BIT_WRITE_NR GATT_CHAR_PROP_BIT_WRITE_NR /* 0x04 */
475 #define BTA_GATT_CHAR_PROP_BIT_WRITE GATT_CHAR_PROP_BIT_WRITE /* 0x08 */
476 #define BTA_GATT_CHAR_PROP_BIT_NOTIFY GATT_CHAR_PROP_BIT_NOTIFY /* 0x10 */
477 #define BTA_GATT_CHAR_PROP_BIT_INDICATE GATT_CHAR_PROP_BIT_INDICATE /* 0x20 */
478 #define BTA_GATT_CHAR_PROP_BIT_AUTH GATT_CHAR_PROP_BIT_AUTH /* 0x40 */
479 #define BTA_GATT_CHAR_PROP_BIT_EXT_PROP GATT_CHAR_PROP_BIT_EXT_PROP /* 0x80 */
480 typedef UINT8 tBTA_GATT_CHAR_PROP;
482 #ifndef BTA_GATTC_CHAR_DESCR_MAX
483 #define BTA_GATTC_CHAR_DESCR_MAX 7
486 /*********************** NV callback Data Definitions **********************
490 tBT_UUID app_uuid128;
495 BOOLEAN is_primary; /* primary service or secondary */
496 } tBTA_GATTS_HNDL_RANGE;
498 #define BTA_GATTS_SRV_CHG_CMD_ADD_CLIENT GATTS_SRV_CHG_CMD_ADD_CLIENT
499 #define BTA_GATTS_SRV_CHG_CMD_UPDATE_CLIENT GATTS_SRV_CHG_CMD_UPDATE_CLIENT
500 #define BTA_GATTS_SRV_CHG_CMD_REMOVE_CLIENT GATTS_SRV_CHG_CMD_REMOVE_CLIENT
501 #define BTA_GATTS_SRV_CHG_CMD_READ_NUM_CLENTS GATTS_SRV_CHG_CMD_READ_NUM_CLENTS
502 #define BTA_GATTS_SRV_CHG_CMD_READ_CLENT GATTS_SRV_CHG_CMD_READ_CLENT
503 typedef tGATTS_SRV_CHG_CMD tBTA_GATTS_SRV_CHG_CMD;
505 typedef tGATTS_SRV_CHG tBTA_GATTS_SRV_CHG;
506 typedef tGATTS_SRV_CHG_REQ tBTA_GATTS_SRV_CHG_REQ;
507 typedef tGATTS_SRV_CHG_RSP tBTA_GATTS_SRV_CHG_RSP;
509 #define BTA_GATT_TRANSPORT_LE GATT_TRANSPORT_LE
510 #define BTA_GATT_TRANSPORT_BR_EDR GATT_TRANSPORT_BR_EDR
511 #define BTA_GATT_TRANSPORT_LE_BR_EDR GATT_TRANSPORT_LE_BR_EDR
512 typedef UINT8 tBTA_GATT_TRANSPORT;
514 /* attribute value */
515 typedef tGATT_VALUE tBTA_GATT_VALUE;
517 /* attribute response data */
518 typedef tGATTS_RSP tBTA_GATTS_RSP;
520 /* attribute request data from the client */
521 #define BTA_GATT_PREP_WRITE_CANCEL 0x00
522 #define BTA_GATT_PREP_WRITE_EXEC 0x01
523 typedef tGATT_EXEC_FLAG tBTA_GATT_EXEC_FLAG;
525 /* read request always based on UUID */
526 typedef tGATT_READ_REQ tTA_GBATT_READ_REQ;
528 /* write request data */
529 typedef tGATT_WRITE_REQ tBTA_GATT_WRITE_REQ;
531 /* callback data for server access request from client */
532 typedef tGATTS_DATA tBTA_GATTS_REQ_DATA;
536 tBTA_GATT_STATUS status;
540 tBTA_GATTS_REQ_DATA *p_data;
545 tBTA_GATTS_IF server_if;
546 tBTA_GATT_STATUS status;
550 }tBTA_GATTS_REG_OPER;
555 tBTA_GATTS_IF server_if;
560 tBTA_GATT_STATUS status;
567 tBTA_GATTS_IF server_if;
570 tBTA_GATT_STATUS status;
574 }tBTA_GATTS_ADD_RESULT;
578 tBTA_GATTS_IF server_if;
580 tBTA_GATT_STATUS status;
581 }tBTA_GATTS_SRVC_OPER;
586 tBTA_GATTS_IF server_if;
589 tBTA_GATT_REASON reason; /* report disconnect reason */
590 tBTA_GATT_TRANSPORT transport;
596 BOOLEAN congested; /* report channel congestion indicator */
601 UINT16 conn_id; /* connection ID */
602 tBTA_GATT_STATUS status; /* notification/indication status */
605 /* GATTS callback data */
608 tBTA_GATTS_REG_OPER reg_oper;
609 tBTA_GATTS_CREATE create;
610 tBTA_GATTS_SRVC_OPER srvc_oper;
611 tBTA_GATT_STATUS status; /* BTA_GATTS_LISTEN_EVT */
612 tBTA_GATTS_ADD_RESULT add_result; /* add included service: BTA_GATTS_ADD_INCL_SRVC_EVT
613 add char : BTA_GATTS_ADD_CHAR_EVT
614 add char descriptor: BTA_GATTS_ADD_CHAR_DESCR_EVT */
615 tBTA_GATTS_REQ req_data;
616 tBTA_GATTS_CONN conn; /* BTA_GATTS_CONN_EVT */
617 tBTA_GATTS_CONGEST congest; /* BTA_GATTS_CONGEST_EVT callback data */
618 tBTA_GATTS_CONF confirm; /* BTA_GATTS_CONF_EVT callback data */
621 /* GATTS enable callback function */
622 typedef void (tBTA_GATTS_ENB_CBACK)(tBTA_GATT_STATUS status);
624 /* Server callback function */
625 typedef void (tBTA_GATTS_CBACK)(tBTA_GATTS_EVT event, tBTA_GATTS *p_data);
627 /*****************************************************************************
628 ** External Function Declarations
629 *****************************************************************************/
636 /**************************
638 ***************************/
640 /*******************************************************************************
642 ** Function BTA_GATTC_Disable
644 ** Description This function is called to disable the GATTC module
650 *******************************************************************************/
651 extern void BTA_GATTC_Disable(void);
653 /*******************************************************************************
655 ** Function BTA_GATTC_AppRegister
657 ** Description This function is called to register application callbacks
658 ** with BTA GATTC module.
660 ** Parameters p_app_uuid - applicaiton UUID
661 ** p_client_cb - pointer to the application callback function.
665 *******************************************************************************/
666 extern void BTA_GATTC_AppRegister(tBT_UUID *p_app_uuid, tBTA_GATTC_CBACK *p_client_cb);
668 /*******************************************************************************
670 ** Function BTA_GATTC_AppDeregister
672 ** Description This function is called to deregister an application
673 ** from BTA GATTC module.
675 ** Parameters client_if - client interface identifier.
679 *******************************************************************************/
680 extern void BTA_GATTC_AppDeregister (tBTA_GATTC_IF client_if);
682 /*******************************************************************************
684 ** Function BTA_GATTC_Open
686 ** Description Open a direct connection or add a background auto connection
689 ** Parameters client_if: server interface.
690 ** remote_bda: remote device BD address.
691 ** is_direct: direct connection or background auto connection
695 *******************************************************************************/
696 extern void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda,
697 BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport);
699 /*******************************************************************************
701 ** Function BTA_GATTC_CancelOpen
703 ** Description Open a direct connection or add a background auto connection
706 ** Parameters client_if: server interface.
707 ** remote_bda: remote device BD address.
708 ** is_direct: direct connection or background auto connection
712 *******************************************************************************/
713 extern void BTA_GATTC_CancelOpen(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, BOOLEAN is_direct);
715 /*******************************************************************************
717 ** Function BTA_GATTC_Close
719 ** Description Close a connection to a GATT server.
721 ** Parameters conn_id: connectino ID to be closed.
725 *******************************************************************************/
726 extern void BTA_GATTC_Close(UINT16 conn_id);
728 /*******************************************************************************
730 ** Function BTA_GATTC_ServiceSearchRequest
732 ** Description This function is called to request a GATT service discovery
733 ** on a GATT server. This function report service search result
734 ** by a callback event, and followed by a service search complete
737 ** Parameters conn_id: connection ID.
738 ** p_srvc_uuid: a UUID of the service application is interested in.
739 ** If Null, discover for all services.
743 *******************************************************************************/
744 extern void BTA_GATTC_ServiceSearchRequest(UINT16 conn_id, tBT_UUID *p_srvc_uuid);
746 /*******************************************************************************
748 ** Function BTA_GATTC_GetFirstChar
750 ** Description This function is called to find the first charatceristic of the
751 ** service on the given server.
753 ** Parameters conn_id: connection ID which identify the server.
754 ** p_srvc_id: the service ID of which the characteristic is belonged to.
755 ** p_char_uuid_cond: Characteristic UUID, if NULL find the first available
757 ** p_char_result: output parameter which will store the GATT
758 ** characteristic ID.
759 ** p_property: output parameter to carry the characteristic property.
761 ** Returns returns status.
763 *******************************************************************************/
764 extern tBTA_GATT_STATUS BTA_GATTC_GetFirstChar (UINT16 conn_id,
765 tBTA_GATT_SRVC_ID *p_srvc_id,
766 tBT_UUID *p_char_uuid_cond,
767 tBTA_GATTC_CHAR_ID *p_char_result,
768 tBTA_GATT_CHAR_PROP *p_property);
770 /*******************************************************************************
772 ** Function BTA_GATTC_GetNextChar
774 ** Description This function is called to find the next charatceristic of the
775 ** service on the given server.
777 ** Parameters conn_id: connection ID which identify the server.
778 ** p_start_char_id: start the characteristic search from the next record
779 ** after the one identified by char_id.
780 ** p_char_uuid_cond: Characteristic UUID, if NULL find the first available
782 ** p_char_result: output parameter which will store the GATT
783 ** characteristic ID.
784 ** p_property: output parameter, characteristic property.
786 ** Returns returns status.
788 *******************************************************************************/
789 extern tBTA_GATT_STATUS BTA_GATTC_GetNextChar (UINT16 conn_id,
790 tBTA_GATTC_CHAR_ID *p_start_char_id,
791 tBT_UUID *p_char_uuid_cond,
792 tBTA_GATTC_CHAR_ID *p_char_result,
793 tBTA_GATT_CHAR_PROP *p_property);
795 /*******************************************************************************
797 ** Function BTA_GATTC_GetFirstCharDescr
799 ** Description This function is called to find the first charatceristic descriptor of the
800 ** charatceristic on the given server.
802 ** Parameters conn_id: connection ID which identify the server.
803 ** p_char_id: the characteristic ID of which the descriptor is belonged to.
804 ** p_descr_uuid_cond: Characteristic Descr UUID, if NULL find the first available
806 ** p_descr_result: output parameter which will store the GATT
807 ** characteristic descriptor ID.
809 ** Returns returns status.
811 *******************************************************************************/
812 extern tBTA_GATT_STATUS BTA_GATTC_GetFirstCharDescr (UINT16 conn_id, tBTA_GATTC_CHAR_ID *p_char_id,
813 tBT_UUID *p_descr_uuid_cond,
814 tBTA_GATTC_CHAR_DESCR_ID *p_descr_result);
816 /*******************************************************************************
818 ** Function BTA_GATTC_GetFirstIncludedService
820 ** Description This function is called to find the first included service of the
821 ** service on the given server.
823 ** Parameters conn_id: connection ID which identify the server.
824 ** p_srvc_id: the service ID of which the included service is belonged to.
825 ** p_uuid_cond: include service UUID, if NULL find the first available
827 ** p_result: output parameter which will store the GATT ID
828 ** of the included service found.
830 ** Returns returns status.
832 *******************************************************************************/
833 extern tBTA_GATT_STATUS BTA_GATTC_GetFirstIncludedService(UINT16 conn_id,
834 tBTA_GATT_SRVC_ID *p_srvc_id,
835 tBT_UUID *p_uuid_cond,
836 tBTA_GATTC_INCL_SVC_ID *p_result);
838 /*******************************************************************************
840 ** Function BTA_GATTC_GetGattDb
842 ** Description This function is called to get gatt db.
844 ** Parameters conn_id: connection ID which identify the server.
845 ** db: output parameter which will contain gatt db copy.
846 ** Caller is responsible for freeing it.
847 ** count: number of elements in db.
849 *******************************************************************************/
850 extern void BTA_GATTC_GetGattDb(UINT16 conn_id, UINT16 start_handle, UINT16 end_handle,
851 btgatt_db_element_t **db, int *count);
853 /*******************************************************************************
855 ** Function BTA_GATTC_ReadCharacteristic
857 ** Description This function is called to read a service's characteristics of
858 ** the given characteritisc ID.
860 ** Parameters conn_id - connectino ID.
861 ** p_char_id - characteritic ID to read.
865 *******************************************************************************/
866 extern void BTA_GATTC_ReadCharacteristic (UINT16 conn_id,
867 tBTA_GATTC_CHAR_ID *p_char_id,
868 tBTA_GATT_AUTH_REQ auth_req);
870 /*******************************************************************************
872 ** Function BTA_GATTC_ReadCharDescr
874 ** Description This function is called to read a characteristics descriptor.
876 ** Parameters conn_id - connection ID.
877 ** p_char_descr_id - characteritic descriptor ID to read.
881 *******************************************************************************/
882 extern void BTA_GATTC_ReadCharDescr (UINT16 conn_id,
883 tBTA_GATTC_CHAR_DESCR_ID *p_char_descr_id,
884 tBTA_GATT_AUTH_REQ auth_req);
886 /*******************************************************************************
888 ** Function BTA_GATTC_WriteCharValue
890 ** Description This function is called to write characteristic value.
892 ** Parameters conn_id - connection ID.
893 ** p_char_id - characteristic ID to write.
894 ** write_type - type of write.
895 ** len: length of the data to be written.
896 ** p_value - the value to be written.
900 *******************************************************************************/
901 extern void BTA_GATTC_WriteCharValue (UINT16 conn_id,
902 tBTA_GATTC_CHAR_ID *p_char_id,
903 tBTA_GATTC_WRITE_TYPE write_type,
906 tBTA_GATT_AUTH_REQ auth_req);
908 /*******************************************************************************
910 ** Function BTA_GATTC_WriteCharDescr
912 ** Description This function is called to write characteristic descriptor value.
914 ** Parameters conn_id - connection ID
915 ** p_char_descr_id - characteristic descriptor ID to write.
916 ** write_type - type of write.
917 ** p_value - the value to be written.
921 *******************************************************************************/
922 extern void BTA_GATTC_WriteCharDescr (UINT16 conn_id,
923 tBTA_GATTC_CHAR_DESCR_ID *p_char_descr_id,
924 tBTA_GATTC_WRITE_TYPE write_type,
925 tBTA_GATT_UNFMT *p_data,
926 tBTA_GATT_AUTH_REQ auth_req);
928 /*******************************************************************************
930 ** Function BTA_GATTC_SendIndConfirm
932 ** Description This function is called to send handle value confirmation.
934 ** Parameters conn_id - connection ID.
935 ** p_char_id - characteristic ID to confrim.
939 *******************************************************************************/
940 extern void BTA_GATTC_SendIndConfirm (UINT16 conn_id, tBTA_GATTC_CHAR_ID *p_char_id);
942 /*******************************************************************************
944 ** Function BTA_GATTC_RegisterForNotifications
946 ** Description This function is called to register for notification of a service.
948 ** Parameters client_if - client interface.
949 ** remote_bda - target GATT server.
950 ** p_char_id - pointer to GATT characteristic ID.
952 ** Returns OK if registration succeed, otherwise failed.
954 *******************************************************************************/
955 extern tBTA_GATT_STATUS BTA_GATTC_RegisterForNotifications (tBTA_GATTC_IF client_if,
957 tBTA_GATTC_CHAR_ID *p_char_id);
960 /*******************************************************************************
962 ** Function BTA_GATTC_DeregisterForNotifications
964 ** Description This function is called to de-register for notification of a servbice.
966 ** Parameters client_if - client interface.
967 ** remote_bda - target GATT server.
968 ** p_char_id - pointer to a GATT characteristic ID.
970 ** Returns OK if deregistration succeed, otherwise failed.
972 *******************************************************************************/
973 extern tBTA_GATT_STATUS BTA_GATTC_DeregisterForNotifications (tBTA_GATTC_IF client_if,
975 tBTA_GATTC_CHAR_ID *p_char_id);
977 /*******************************************************************************
979 ** Function BTA_GATTC_PrepareWrite
981 ** Description This function is called to prepare write a characteristic value.
983 ** Parameters conn_id - connection ID.
984 ** p_char_id - GATT characteritic ID of the service.
985 ** offset - offset of the write value.
986 ** len: length of the data to be written.
987 ** p_value - the value to be written.
991 *******************************************************************************/
992 extern void BTA_GATTC_PrepareWrite (UINT16 conn_id,
993 tBTA_GATTC_CHAR_ID *p_char_id,
997 tBTA_GATT_AUTH_REQ auth_req);
999 /*******************************************************************************
1001 ** Function BTA_GATTC_ExecuteWrite
1003 ** Description This function is called to execute write a prepare write sequence.
1005 ** Parameters conn_id - connection ID.
1006 ** is_execute - execute or cancel.
1010 *******************************************************************************/
1011 extern void BTA_GATTC_ExecuteWrite (UINT16 conn_id, BOOLEAN is_execute);
1013 /*******************************************************************************
1015 ** Function BTA_GATTC_ReadMultiple
1017 ** Description This function is called to read multiple characteristic or
1018 ** characteristic descriptors.
1020 ** Parameters conn_id - connectino ID.
1021 ** p_read_multi - read multiple parameters.
1025 *******************************************************************************/
1026 extern void BTA_GATTC_ReadMultiple(UINT16 conn_id, tBTA_GATTC_MULTI *p_read_multi,
1027 tBTA_GATT_AUTH_REQ auth_req);
1030 /*******************************************************************************
1032 ** Function BTA_GATTC_Refresh
1034 ** Description Refresh the server cache of the remote device
1036 ** Parameters remote_bda: remote device BD address.
1040 *******************************************************************************/
1041 extern void BTA_GATTC_Refresh(BD_ADDR remote_bda);
1044 /*******************************************************************************
1046 ** Function BTA_GATTC_Listen
1048 ** Description Start advertisement to listen for connection request.
1050 ** Parameters client_if: server interface.
1051 ** start: to start or stop listening for connection
1052 ** remote_bda: remote device BD address, if listen to all device
1057 *******************************************************************************/
1058 extern void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, BOOLEAN start, BD_ADDR_PTR target_bda);
1060 /*******************************************************************************
1062 ** Function BTA_GATTC_Broadcast
1064 ** Description Start broadcasting (non-connectable advertisements)
1066 ** Parameters client_if: client interface.
1067 ** start: to start or stop listening for connection
1071 *******************************************************************************/
1072 extern void BTA_GATTC_Broadcast(tBTA_GATTC_IF client_if, BOOLEAN start);
1075 /*******************************************************************************
1077 ** Function BTA_GATTC_ConfigureMTU
1079 ** Description Configure the MTU size in the GATT channel. This can be done
1080 ** only once per connection.
1082 ** Parameters conn_id: connection ID.
1083 ** mtu: desired MTU size to use.
1087 *******************************************************************************/
1088 extern void BTA_GATTC_ConfigureMTU (UINT16 conn_id, UINT16 mtu);
1090 /*******************************************************************************
1091 ** BTA GATT Server API
1092 ********************************************************************************/
1094 /*******************************************************************************
1096 ** Function BTA_GATTS_Init
1098 ** Description This function is called to initalize GATTS module
1104 *******************************************************************************/
1105 extern void BTA_GATTS_Init();
1107 /*******************************************************************************
1109 ** Function BTA_GATTS_Disable
1111 ** Description This function is called to disable GATTS module
1117 *******************************************************************************/
1118 extern void BTA_GATTS_Disable(void);
1120 /*******************************************************************************
1122 ** Function BTA_GATTS_AppRegister
1124 ** Description This function is called to register application callbacks
1125 ** with BTA GATTS module.
1127 ** Parameters p_app_uuid - applicaiton UUID
1128 ** p_cback - pointer to the application callback function.
1132 *******************************************************************************/
1133 extern void BTA_GATTS_AppRegister(tBT_UUID *p_app_uuid, tBTA_GATTS_CBACK *p_cback);
1136 /*******************************************************************************
1138 ** Function BTA_GATTS_AppDeregister
1140 ** Description De-register with BTA GATT Server.
1142 ** Parameters server_if: server interface
1146 *******************************************************************************/
1147 extern void BTA_GATTS_AppDeregister(tBTA_GATTS_IF server_if);
1149 /*******************************************************************************
1151 ** Function BTA_GATTS_CreateService
1153 ** Description Create a service. When service creation is done, a callback
1154 ** event BTA_GATTS_CREATE_SRVC_EVT is called to report status
1155 ** and service ID to the profile. The service ID obtained in
1156 ** the callback function needs to be used when adding included
1157 ** service and characteristics/descriptors into the service.
1159 ** Parameters server_if: server interface.
1160 ** p_service_uuid: service UUID.
1161 ** inst: instance ID number of this service.
1162 ** num_handle: numble of handle requessted for this service.
1163 ** is_primary: is this service a primary one or not.
1167 *******************************************************************************/
1168 extern void BTA_GATTS_CreateService(tBTA_GATTS_IF server_if, tBT_UUID *p_service_uuid,
1169 UINT8 inst, UINT16 num_handle, BOOLEAN is_primary);
1171 /*******************************************************************************
1173 ** Function BTA_GATTS_AddIncludeService
1175 ** Description This function is called to add an included service. After included
1176 ** service is included, a callback event BTA_GATTS_ADD_INCL_SRVC_EVT
1177 ** is reported the included service ID.
1179 ** Parameters service_id: service ID to which this included service is to
1181 ** included_service_id: the service ID to be included.
1185 *******************************************************************************/
1186 extern void BTA_GATTS_AddIncludeService(UINT16 service_id, UINT16 included_service_id);
1188 /*******************************************************************************
1190 ** Function BTA_GATTS_AddCharacteristic
1192 ** Description This function is called to add a characteristic into a service.
1194 ** Parameters service_id: service ID to which this included service is to
1196 ** p_char_uuid : Characteristic UUID.
1197 ** perm : Characteristic value declaration attribute permission.
1198 ** property : Characteristic Properties
1202 *******************************************************************************/
1203 extern void BTA_GATTS_AddCharacteristic (UINT16 service_id, tBT_UUID *p_char_uuid,
1204 tBTA_GATT_PERM perm, tBTA_GATT_CHAR_PROP property);
1206 /*******************************************************************************
1208 ** Function BTA_GATTS_AddCharDescriptor
1210 ** Description This function is called to add characteristic descriptor. When
1211 ** it's done, a callback event BTA_GATTS_ADD_DESCR_EVT is called
1212 ** to report the status and an ID number for this descriptor.
1214 ** Parameters service_id: service ID to which this charatceristic descriptor is to
1216 ** perm: descriptor access permission.
1217 ** p_descr_uuid: descriptor UUID.
1218 ** p_descr_params: descriptor value if it's read only descriptor.
1220 ** Returns returns status.
1222 *******************************************************************************/
1223 extern void BTA_GATTS_AddCharDescriptor (UINT16 service_id,
1224 tBTA_GATT_PERM perm,
1225 tBT_UUID * p_descr_uuid);
1227 /*******************************************************************************
1229 ** Function BTA_GATTS_DeleteService
1231 ** Description This function is called to delete a service. When this is done,
1232 ** a callback event BTA_GATTS_DELETE_EVT is report with the status.
1234 ** Parameters service_id: service_id to be deleted.
1236 ** Returns returns none.
1238 *******************************************************************************/
1239 extern void BTA_GATTS_DeleteService(UINT16 service_id);
1241 /*******************************************************************************
1243 ** Function BTA_GATTS_StartService
1245 ** Description This function is called to start a service.
1247 ** Parameters service_id: the service ID to be started.
1248 ** sup_transport: supported trasnport.
1252 *******************************************************************************/
1253 extern void BTA_GATTS_StartService(UINT16 service_id, tBTA_GATT_TRANSPORT sup_transport);
1255 /*******************************************************************************
1257 ** Function BTA_GATTS_StopService
1259 ** Description This function is called to stop a service.
1261 ** Parameters service_id - service to be topped.
1265 *******************************************************************************/
1266 extern void BTA_GATTS_StopService(UINT16 service_id);
1268 /*******************************************************************************
1270 ** Function BTA_GATTS_HandleValueIndication
1272 ** Description This function is called to read a characteristics descriptor.
1274 ** Parameters conn_id - connection identifier.
1275 ** attr_id - attribute ID to indicate.
1276 ** data_len - indicate data length.
1277 ** p_data: data to indicate.
1278 ** need_confirm - if this indication expects a confirmation or not.
1282 *******************************************************************************/
1283 extern void BTA_GATTS_HandleValueIndication (UINT16 conn_id, UINT16 attr_id,
1286 BOOLEAN need_confirm);
1288 /*******************************************************************************
1290 ** Function BTA_GATTS_SendRsp
1292 ** Description This function is called to send a response to a request.
1294 ** Parameters conn_id - connection identifier.
1295 ** trans_id - transaction ID.
1296 ** status - response status
1297 ** p_msg - response data.
1301 *******************************************************************************/
1302 extern void BTA_GATTS_SendRsp (UINT16 conn_id, UINT32 trans_id,
1303 tBTA_GATT_STATUS status, tBTA_GATTS_RSP *p_msg);
1306 /*******************************************************************************
1308 ** Function BTA_GATTS_Open
1310 ** Description Open a direct open connection or add a background auto connection
1313 ** Parameters server_if: server interface.
1314 ** remote_bda: remote device BD address.
1315 ** is_direct: direct connection or background auto connection
1319 *******************************************************************************/
1320 extern void BTA_GATTS_Open(tBTA_GATTS_IF server_if, BD_ADDR remote_bda,
1321 BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport);
1324 /*******************************************************************************
1326 ** Function BTA_GATTS_CancelOpen
1328 ** Description Cancel a direct open connection or remove a background auto connection
1331 ** Parameters server_if: server interface.
1332 ** remote_bda: remote device BD address.
1333 ** is_direct: direct connection or background auto connection
1337 *******************************************************************************/
1338 extern void BTA_GATTS_CancelOpen(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, BOOLEAN is_direct);
1341 /*******************************************************************************
1343 ** Function BTA_GATTS_Close
1345 ** Description Close a connection a remote device.
1347 ** Parameters conn_id: connectino ID to be closed.
1351 *******************************************************************************/
1352 extern void BTA_GATTS_Close(UINT16 conn_id);
1354 /*******************************************************************************
1356 ** Function BTA_GATTS_Listen
1358 ** Description Start advertisement to listen for connection request for a
1361 ** Parameters server_if: server interface.
1362 ** start: to start or stop listening for connection
1363 ** remote_bda: remote device BD address, if listen to all device
1368 *******************************************************************************/
1369 extern void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, BOOLEAN start,
1370 BD_ADDR_PTR target_bda);
1379 #endif /* BTA_GATT_API_H */