1/******************************************************************************
2 *
3 *  Copyright (C) 2003-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 *  This is the interface file for GATT call-in functions.
22 *
23 ******************************************************************************/
24#ifndef BTA_GATTC_CI_H
25#define BTA_GATTC_CI_H
26
27#include "bta_gatt_api.h"
28
29/*****************************************************************************
30**  Constants and data types
31*****************************************************************************/
32
33/* Open Complete Event */
34typedef struct
35{
36    BT_HDR            hdr;
37    tBTA_GATT_STATUS  status;
38} tBTA_GATTC_CI_EVT;
39
40#define BTA_GATTC_NV_LOAD_MAX   10
41
42/* Read Ready Event */
43typedef struct
44{
45    BT_HDR              hdr;
46    tBTA_GATT_STATUS    status;
47    UINT16              num_attr;
48    tBTA_GATTC_NV_ATTR  attr[BTA_GATTC_NV_LOAD_MAX];
49} tBTA_GATTC_CI_LOAD;
50
51
52/*****************************************************************************
53**  Function Declarations
54*****************************************************************************/
55#ifdef __cplusplus
56extern "C"
57{
58#endif
59
60/*******************************************************************************
61**
62** Function         bta_gattc_ci_cache_open
63**
64** Description      This function sends an event to indicate server cache open
65**                  completed.
66**
67** Parameters       server_bda - server BDA of this cache.
68**                  status - BTA_GATT_OK if full buffer of data,
69**                           BTA_GATT_FAIL if an error has occurred.
70**
71** Returns          void
72**
73*******************************************************************************/
74BTA_API extern void bta_gattc_ci_cache_open(BD_ADDR server_bda, UINT16 evt,
75                                            tBTA_GATT_STATUS status, UINT16 conn_id);
76
77/*******************************************************************************
78**
79** Function         bta_gattc_ci_cache_load
80**
81** Description      This function sends an event to BTA indicating the phone has
82**                  load the servere cache and ready to send it to the stack.
83**
84** Parameters       server_bda - server BDA of this cache.
85**                  num_bytes_read - number of bytes read into the buffer
86**                      specified in the read callout-function.
87**                  status - BTA_GATT_OK if full buffer of data,
88**                           BTA_GATT_FAIL if an error has occurred.
89**
90** Returns          void
91**
92*******************************************************************************/
93BTA_API extern void bta_gattc_ci_cache_load(BD_ADDR server_bda, UINT16 evt,
94                                            UINT16 num_attr, tBTA_GATTC_NV_ATTR *p_atrr,
95                                            tBTA_GATT_STATUS status, UINT16 conn_id);
96
97/*******************************************************************************
98**
99** Function         bta_gattc_ci_save
100**
101** Description      This function sends an event to BTA indicating the phone has
102**                  save the server cache.
103**
104** Parameters       server_bda - server BDA of this cache.
105**                  status - BTA_GATT_OK if full buffer of data,
106**                           BTA_GATT_FAIL if an error has occurred.
107**
108** Returns          void
109**
110*******************************************************************************/
111BTA_API extern void bta_gattc_ci_cache_save(BD_ADDR server_bda, UINT16 evt,
112                                            tBTA_GATT_STATUS status, UINT16 conn_id);
113
114
115#ifdef __cplusplus
116}
117#endif
118
119#endif /* BTA_GATTC_CI_H */
120
121