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 * Function bta_hl_co_get_num_of_mdep 41 * 42 * Description This function is called to get the number of MDEPs for this 43 * application ID 44 * 45 * Parameters app_id - application ID 46 * p_num_of_mdep (output) - number of MDEP configurations 47 * supported 48 * by the application 49 * 50 * Returns Bloolean - true success 51 * 52 ******************************************************************************/ 53 extern bool bta_hl_co_get_num_of_mdep(uint8_t app_id, uint8_t* 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 60 * not 61 * 62 * Parameters app_id - application ID 63 * 64 * Returns Bloolean - true advertise the SOURCE MDEP configuration 65 * information 66 * 67 ******************************************************************************/ 68 extern bool bta_hl_co_advrtise_source_sdp(uint8_t app_id); 69 /******************************************************************************* 70 * 71 * Function bta_hl_co_get_mdep_config 72 * 73 * Description This function is called to get the supported feature 74 * configuration for the specified mdep index and it also 75 * assigns 76 * the MDEP ID for the specified mdep index 77 * 78 * Parameters app_id - HDP application ID 79 * mdep_idx - the mdep index 80 * mdep_counter - mdep_counter 81 * mdep_id - the assigned MDEP ID for the specified medp_idx 82 * p_mdl_cfg (output) - pointer to the MDEP configuration 83 * 84 * 85 * Returns Bloolean - true success 86 ******************************************************************************/ 87 extern bool bta_hl_co_get_mdep_config(uint8_t app_id, uint8_t mdep_idx, 88 uint8_t mdep_counter, 89 tBTA_HL_MDEP_ID mdep_id, 90 tBTA_HL_MDEP_CFG* p_mdep_cfg); 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 101 * size configuration 102 * 103 * Returns Bloolean - true success 104 ******************************************************************************/ 105 extern bool bta_hl_co_get_echo_config(uint8_t app_id, 106 tBTA_HL_ECHO_CFG* p_echo_cfg); 107 108 /******************************************************************************* 109 * 110 * Function bta_hl_co_save_mdl 111 * 112 * Description This function is called to save a MDL configuration item in 113 * persistent storage 114 * 115 * Parameters app_id - HDP application ID 116 * item_idx - the MDL configuration storage index 117 * p_mdl_cfg - pointer to the MDL configuration data 118 * 119 * Returns void 120 * 121 ******************************************************************************/ 122 extern void bta_hl_co_save_mdl(uint8_t app_id, uint8_t item_idx, 123 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 129 * persistent storage 130 * 131 * Parameters app_id - HDP application ID 132 * item_idx - the MDL configuration storage index 133 * 134 * Returns void 135 * 136 ******************************************************************************/ 137 extern void bta_hl_co_delete_mdl(uint8_t app_id, uint8_t 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 144 *called 145 *8 once after the device is powered up 146 * 147 * Parameters app_id - HDP application ID 148 * buffer_size - the unit of the buffer size is 149 *sizeof(tBTA_HL_MDL_CFG) 150 * p_mdl_buf - Point to the starting location of the buffer 151 * 152 * Returns bool 153 * 154 * 155 ******************************************************************************/ 156 extern bool bta_hl_co_load_mdl_config(uint8_t app_id, uint8_t buffer_size, 157 tBTA_HL_MDL_CFG* p_mdl_buf); 158 159 /******************************************************************************* 160 * 161 * Function bta_hl_co_get_tx_data 162 * 163 * Description Get the data to be sent 164 * 165 * Parameters app_id - HDP application ID 166 * mdl_handle - MDL handle 167 * buf_size - the size of the buffer 168 * p_buf - the buffer pointer 169 * evt - the evt to be passed back to the HL in the 170 * bta_hl_ci_get_tx_data call-in function 171 * 172 * Returns Void 173 * 174 ******************************************************************************/ 175 extern void bta_hl_co_get_tx_data(uint8_t app_id, tBTA_HL_MDL_HANDLE mdl_handle, 176 uint16_t buf_size, uint8_t* p_buf, 177 uint16_t evt); 178 179 /******************************************************************************* 180 * 181 * Function bta_hl_co_put_rx_data 182 * 183 * Description Put the received data 184 * 185 * Parameters app_id - HDP application ID 186 * mdl_handle - MDL handle 187 * data_size - the size of the data 188 * p_data - the data pointer 189 * evt - the evt to be passed back to the HL in the 190 * bta_hl_ci_put_rx_data call-in function 191 * 192 * Returns Void 193 * 194 ******************************************************************************/ 195 extern void bta_hl_co_put_rx_data(uint8_t app_id, tBTA_HL_MDL_HANDLE mdl_handle, 196 uint16_t data_size, uint8_t* p_data, 197 uint16_t evt); 198 /******************************************************************************* 199 * 200 * Function bta_hl_co_get_tx_data 201 * 202 * Description Get the Echo data to be sent 203 * 204 * Parameters app_id - HDP application ID 205 * mcl_handle - MCL handle 206 * buf_size - the size of the buffer 207 * p_buf - the buffer pointer 208 * evt - the evt to be passed back to the HL in the 209 * bta_hl_ci_get_tx_data call-in function 210 * 211 * Returns Void 212 * 213 ******************************************************************************/ 214 extern void bta_hl_co_get_echo_data(uint8_t app_id, 215 tBTA_HL_MCL_HANDLE mcl_handle, 216 uint16_t buf_size, uint8_t* p_buf, 217 uint16_t evt); 218 219 /******************************************************************************* 220 * 221 * Function bta_hl_co_put_echo_data 222 * 223 * Description Put the received loopback echo data 224 * 225 * Parameters app_id - HDP application ID 226 * mcl_handle - MCL handle 227 * data_size - the size of the data 228 * p_data - the data pointer 229 * evt - the evt to be passed back to the HL in the 230 * bta_hl_ci_put_echo_data call-in function 231 * 232 * Returns Void 233 * 234 ******************************************************************************/ 235 extern void bta_hl_co_put_echo_data(uint8_t app_id, 236 tBTA_HL_MCL_HANDLE mcl_handle, 237 uint16_t data_size, uint8_t* p_data, 238 uint16_t evt); 239 240 #endif /* BTA_HL_CO_H */ 241