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/bta_gatt_api.h" 28 29 /***************************************************************************** 30 ** Constants and data types 31 *****************************************************************************/ 32 33 /* Open Complete Event */ 34 typedef struct { 35 BT_HDR hdr; 36 tBTA_GATT_STATUS status; 37 } tBTA_GATTC_CI_EVT; 38 39 #define BTA_GATTC_NV_LOAD_MAX 100 40 41 /* Read Ready Event */ 42 typedef struct { 43 BT_HDR hdr; 44 tBTA_GATT_STATUS status; 45 UINT16 num_attr; 46 tBTA_GATTC_NV_ATTR attr[BTA_GATTC_NV_LOAD_MAX]; 47 } tBTA_GATTC_CI_LOAD; 48 49 50 /***************************************************************************** 51 ** Function Declarations 52 *****************************************************************************/ 53 #ifdef __cplusplus 54 extern "C" 55 { 56 #endif 57 58 /******************************************************************************* 59 ** 60 ** Function bta_gattc_ci_cache_open 61 ** 62 ** Description This function sends an event to indicate server cache open 63 ** completed. 64 ** 65 ** Parameters server_bda - server BDA of this cache. 66 ** status - BTA_GATT_OK if full buffer of data, 67 ** BTA_GATT_FAIL if an error has occurred. 68 ** 69 ** Returns void 70 ** 71 *******************************************************************************/ 72 extern void bta_gattc_ci_cache_open(BD_ADDR server_bda, UINT16 evt, 73 tBTA_GATT_STATUS status, UINT16 conn_id); 74 75 /******************************************************************************* 76 ** 77 ** Function bta_gattc_ci_cache_load 78 ** 79 ** Description This function sends an event to BTA indicating the phone has 80 ** load the servere cache and ready to send it to the stack. 81 ** 82 ** Parameters server_bda - server BDA of this cache. 83 ** num_bytes_read - number of bytes read into the buffer 84 ** specified in the read callout-function. 85 ** status - BTA_GATT_OK if full buffer of data, 86 ** BTA_GATT_FAIL if an error has occurred. 87 ** 88 ** Returns void 89 ** 90 *******************************************************************************/ 91 extern void bta_gattc_ci_cache_load(BD_ADDR server_bda, UINT16 evt, 92 UINT16 num_attr, tBTA_GATTC_NV_ATTR *p_atrr, 93 tBTA_GATT_STATUS status, UINT16 conn_id); 94 95 /******************************************************************************* 96 ** 97 ** Function bta_gattc_ci_save 98 ** 99 ** Description This function sends an event to BTA indicating the phone has 100 ** save the server cache. 101 ** 102 ** Parameters server_bda - server BDA of this cache. 103 ** status - BTA_GATT_OK if full buffer of data, 104 ** BTA_GATT_FAIL if an error has occurred. 105 ** 106 ** Returns void 107 ** 108 *******************************************************************************/ 109 extern void bta_gattc_ci_cache_save(BD_ADDR server_bda, UINT16 evt, 110 tBTA_GATT_STATUS status, UINT16 conn_id); 111 112 113 #ifdef __cplusplus 114 } 115 #endif 116 117 #endif /* BTA_GATTC_CI_H */ 118