1 /******************************************************************************
3 * Copyright (C) 2009-2012 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 implementation file for the HeaLth device profile (HL)
22 * subsystem call-in functions.
24 ******************************************************************************/
30 #include "bta_hl_api.h"
31 #include "bta_hl_co.h"
32 #include "bta_hl_int.h"
34 /*******************************************************************************
36 ** Function bta_hl_ci_get_tx_data
38 ** Description This function is called in response to the
39 ** bta_hl_co_get_tx_data call-out function.
41 ** Parameters mdl_handle -MDL handle
42 ** status - BTA_MA_STATUS_OK if operation is successful
43 ** BTA_MA_STATUS_FAIL if any errors have occurred.
44 ** evt - evt from the call-out function
48 *******************************************************************************/
49 extern void bta_hl_ci_get_tx_data( tBTA_HL_MDL_HANDLE mdl_handle,
50 tBTA_HL_STATUS status,
53 tBTA_HL_CI_GET_PUT_DATA *p_evt =
54 (tBTA_HL_CI_GET_PUT_DATA *)osi_malloc(sizeof(tBTA_HL_CI_GET_PUT_DATA));
56 #if (BTA_HL_DEBUG == TRUE)
57 APPL_TRACE_DEBUG("%s mdl_handle=%d status=%d evt=%d\n", __func__,
58 mdl_handle, status, evt);
61 p_evt->hdr.event = evt;
62 p_evt->mdl_handle = mdl_handle;
63 p_evt->status = status;
65 bta_sys_sendmsg(p_evt);
68 /*******************************************************************************
70 ** Function bta_hl_ci_put_rx_data
72 ** Description This function is called in response to the
73 ** bta_hl_co_put_rx_data call-out function.
75 ** Parameters mdl_handle -MDL handle
76 ** status - BTA_MA_STATUS_OK if operation is successful
77 ** BTA_MA_STATUS_FAIL if any errors have occurred.
78 ** evt - evt from the call-out function
82 *******************************************************************************/
83 extern void bta_hl_ci_put_rx_data( tBTA_HL_MDL_HANDLE mdl_handle,
84 tBTA_HL_STATUS status,
87 tBTA_HL_CI_GET_PUT_DATA *p_evt =
88 (tBTA_HL_CI_GET_PUT_DATA *)osi_malloc(sizeof(tBTA_HL_CI_GET_PUT_DATA));
90 #if (BTA_HL_DEBUG == TRUE)
91 APPL_TRACE_DEBUG("%s mdl_handle=%d status=%d evt=%d\n", __func__,
92 mdl_handle, status, evt);
95 p_evt->hdr.event = evt;
96 p_evt->mdl_handle = mdl_handle;
97 p_evt->status = status;
99 bta_sys_sendmsg(p_evt);
102 /*******************************************************************************
104 ** Function bta_hl_ci_get_echo_data
106 ** Description This function is called in response to the
107 ** bta_hl_co_get_echo_data call-out function.
109 ** Parameters mcl_handle -MCL handle
110 ** status - BTA_MA_STATUS_OK if operation is successful
111 ** BTA_MA_STATUS_FAIL if any errors have occurred.
112 ** evt - evt from the call-out function
116 *******************************************************************************/
117 extern void bta_hl_ci_get_echo_data( tBTA_HL_MCL_HANDLE mcl_handle,
118 tBTA_HL_STATUS status,
121 tBTA_HL_CI_ECHO_DATA *p_evt =
122 (tBTA_HL_CI_ECHO_DATA *)osi_malloc(sizeof(tBTA_HL_CI_ECHO_DATA));
124 #if (BTA_HL_DEBUG == TRUE)
125 APPL_TRACE_DEBUG("%s mcl_handle=%d status=%d evt=%d\n", __func__,
126 mcl_handle, status, evt);
129 p_evt->hdr.event = evt;
130 p_evt->mcl_handle = mcl_handle;
131 p_evt->status = status;
133 bta_sys_sendmsg(p_evt);
136 /*******************************************************************************
138 ** Function bta_hl_ci_put_echo_data
140 ** Description This function is called in response to the
141 ** bta_hl_co_put_echo_data call-out function.
143 ** Parameters mcl_handle -MCL handle
144 ** status - BTA_MA_STATUS_OK if operation is successful
145 ** BTA_MA_STATUS_FAIL if any errors have occurred.
146 ** evt - evt from the call-out function
150 *******************************************************************************/
151 extern void bta_hl_ci_put_echo_data( tBTA_HL_MCL_HANDLE mcl_handle,
152 tBTA_HL_STATUS status,
155 tBTA_HL_CI_ECHO_DATA *p_evt =
156 (tBTA_HL_CI_ECHO_DATA *)osi_malloc(sizeof(tBTA_HL_CI_ECHO_DATA));
158 #if (BTA_HL_DEBUG == TRUE)
159 APPL_TRACE_DEBUG("%s mcl_handle=%d status=%d evt=%d\n", __func__,
160 mcl_handle, status, evt);
163 p_evt->hdr.event = evt;
164 p_evt->mcl_handle = mcl_handle;
165 p_evt->status = status;
167 bta_sys_sendmsg(p_evt);