1 /****************************************************************************** 2 * 3 * Copyright (C) 2009-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 the HL (HeaLth device profile) subsystem 22 * call-out functions. 23 * 24 ******************************************************************************/ 25 #ifndef BTA_HL_CO_H 26 #define BTA_HL_CO_H 27 28 #include "bta_api.h" 29 #include "bta_hl_api.h" 30 31 /***************************************************************************** 32 ** Constants and Data Types 33 *****************************************************************************/ 34 /************************** 35 ** Common Definitions 36 ***************************/ 37 38 39 /******************************************************************************* 40 ** 41 ** Function bta_hl_co_get_num_of_mdep 42 ** 43 ** Description This function is called to get the number of MDEPs for this 44 ** application ID 45 ** 46 ** Parameters app_id - application ID 47 ** p_num_of_mdep (output) - number of MDEP configurations supported 48 ** by the application 49 ** 50 ** Returns Bloolean - TRUE success 51 ** 52 *******************************************************************************/ 53 BTA_API extern BOOLEAN bta_hl_co_get_num_of_mdep(UINT8 app_id, UINT8 *p_num_of_mdep); 54 /******************************************************************************* 55 ** 56 ** Function bta_hl_co_advrtise_source_sdp 57 ** 58 ** Description This function is called to find out whether the SOURCE MDEP 59 ** configuration information should be advertize in the SDP or nopt 60 ** 61 ** Parameters app_id - application ID 62 ** 63 ** Returns Bloolean - TRUE advertise the SOURCE MDEP configuration 64 ** information 65 ** 66 *******************************************************************************/ 67 BTA_API extern BOOLEAN bta_hl_co_advrtise_source_sdp(UINT8 app_id); 68 /******************************************************************************* 69 ** 70 ** Function bta_hl_co_get_mdep_config 71 ** 72 ** Description This function is called to get the supported feature 73 ** configuration for the specified mdep index and it also assigns 74 ** the MDEP ID for the specified mdep index 75 ** 76 ** Parameters app_id - HDP application ID 77 ** mdep_idx - the mdep index 78 ** mdep_counter - mdep_counter 79 ** mdep_id - the assigned MDEP ID for the specified medp_idx 80 ** p_mdl_cfg (output) - pointer to the MDEP configuration 81 ** 82 ** 83 ** Returns Bloolean - TRUE success 84 *******************************************************************************/ 85 BTA_API extern BOOLEAN bta_hl_co_get_mdep_config(UINT8 app_id, 86 UINT8 mdep_idx, 87 UINT8 mdep_counter, 88 tBTA_HL_MDEP_ID mdep_id, 89 tBTA_HL_MDEP_CFG *p_mdep_cfg); 90 91 92 /******************************************************************************* 93 ** 94 ** Function bta_hl_co_get_echo_config 95 ** 96 ** Description This function is called to get the echo test 97 ** maximum APDU size configuration 98 ** 99 ** Parameters app_id - HDP application ID 100 ** p_echo_cfg (output) - pointer to the Echo test maximum APDU size 101 ** configuration 102 ** 103 ** Returns Bloolean - TRUE success 104 *******************************************************************************/ 105 BTA_API extern BOOLEAN bta_hl_co_get_echo_config(UINT8 app_id, 106 tBTA_HL_ECHO_CFG *p_echo_cfg); 107 108 109 /******************************************************************************* 110 ** 111 ** Function bta_hl_co_save_mdl 112 ** 113 ** Description This function is called to save a MDL configuration item in persistent 114 ** storage 115 ** 116 ** Parameters app_id - HDP application ID 117 ** item_idx - the MDL configuration storage index 118 ** p_mdl_cfg - pointer to the MDL configuration data 119 ** 120 ** Returns void 121 ** 122 *******************************************************************************/ 123 BTA_API extern void bta_hl_co_save_mdl(UINT8 app_id, UINT8 item_idx, tBTA_HL_MDL_CFG *p_mdl_cfg ); 124 /******************************************************************************* 125 ** 126 ** Function bta_hl_co_delete_mdl 127 ** 128 ** Description This function is called to delete a MDL configuration item in persistent 129 ** storage 130 ** 131 ** Parameters app_id - HDP application ID 132 ** item_idx - the MDL configuration storage index 133 ** 134 ** Returns void 135 ** 136 *******************************************************************************/ 137 BTA_API extern void bta_hl_co_delete_mdl(UINT8 app_id, UINT8 item_idx); 138 /******************************************************************************* 139 ** 140 ** Function bta_hl_co_get_mdl_config 141 ** 142 ** Description This function is called to get the MDL configuration 143 ** from teh persistent memory. This function shall only be called 144 *8 once after the device is powered up 145 ** 146 ** Parameters app_id - HDP application ID 147 ** buffer_size - the unit of the buffer size is sizeof(tBTA_HL_MDL_CFG) 148 ** p_mdl_buf - Point to the starting location of the buffer 149 ** 150 ** Returns BOOLEAN 151 ** 152 ** 153 *******************************************************************************/ 154 BTA_API extern BOOLEAN bta_hl_co_load_mdl_config (UINT8 app_id, UINT8 buffer_size, 155 tBTA_HL_MDL_CFG *p_mdl_buf ); 156 157 158 /******************************************************************************* 159 ** 160 ** Function bta_hl_co_get_tx_data 161 ** 162 ** Description Get the data to be sent 163 ** 164 ** Parameters app_id - HDP application ID 165 ** mdl_handle - MDL handle 166 ** buf_size - the size of the buffer 167 ** p_buf - the buffer pointer 168 ** evt - the evt to be passed back to the HL in the 169 ** bta_hl_ci_get_tx_data call-in function 170 ** 171 ** Returns Void 172 ** 173 *******************************************************************************/ 174 BTA_API extern void bta_hl_co_get_tx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle, 175 UINT16 buf_size, UINT8 *p_buf, UINT16 evt); 176 177 178 /******************************************************************************* 179 ** 180 ** Function bta_hl_co_put_rx_data 181 ** 182 ** Description Put the received data 183 ** 184 ** Parameters app_id - HDP application ID 185 ** mdl_handle - MDL handle 186 ** data_size - the size of the data 187 ** p_data - the data pointer 188 ** evt - the evt to be passed back to the HL in the 189 ** bta_hl_ci_put_rx_data call-in function 190 ** 191 ** Returns Void 192 ** 193 *******************************************************************************/ 194 BTA_API extern void bta_hl_co_put_rx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle, 195 UINT16 data_size, UINT8 *p_data, UINT16 evt); 196 /******************************************************************************* 197 ** 198 ** Function bta_hl_co_get_tx_data 199 ** 200 ** Description Get the Echo data to be sent 201 ** 202 ** Parameters app_id - HDP application ID 203 ** mcl_handle - MCL handle 204 ** buf_size - the size of the buffer 205 ** p_buf - the buffer pointer 206 ** evt - the evt to be passed back to the HL in the 207 ** bta_hl_ci_get_tx_data call-in function 208 ** 209 ** Returns Void 210 ** 211 *******************************************************************************/ 212 BTA_API extern void bta_hl_co_get_echo_data (UINT8 app_id, tBTA_HL_MCL_HANDLE mcl_handle, 213 UINT16 buf_size, UINT8 *p_buf, UINT16 evt); 214 215 /******************************************************************************* 216 ** 217 ** Function bta_hl_co_put_echo_data 218 ** 219 ** Description Put the received loopback echo data 220 ** 221 ** Parameters app_id - HDP application ID 222 ** mcl_handle - MCL handle 223 ** data_size - the size of the data 224 ** p_data - the data pointer 225 ** evt - the evt to be passed back to the HL in the 226 ** bta_hl_ci_put_echo_data call-in function 227 ** 228 ** Returns Void 229 ** 230 *******************************************************************************/ 231 BTA_API extern void bta_hl_co_put_echo_data (UINT8 app_id, tBTA_HL_MCL_HANDLE mcl_handle, 232 UINT16 data_size, UINT8 *p_data, UINT16 evt); 233 234 #endif /* BTA_HL_CO_H */ 235