From 6ef101187774e30ddba6b46bbedef549a42196ad Mon Sep 17 00:00:00 2001 From: Andre Eisenbach Date: Tue, 18 Sep 2012 01:35:44 -0700 Subject: Initual Bluetooth open source release First release under Apache source license with updated header files and whitespace cleanups. Also fixed file permission to remove executable bit from source files. Change-Id: I7155903edfc2f491c1cbbd0db108f207852caaa0 --- bta/hl/bta_hl_api.c | 123 +++++++++++++++++++++++++++++----------------------- 1 file changed, 68 insertions(+), 55 deletions(-) (limited to 'bta/hl/bta_hl_api.c') diff --git a/bta/hl/bta_hl_api.c b/bta/hl/bta_hl_api.c index 65ab7bd..8c8d621 100644 --- a/bta/hl/bta_hl_api.c +++ b/bta/hl/bta_hl_api.c @@ -1,15 +1,28 @@ -/***************************************************************************** -** -** Name: bta_hl_api.c -** -** Description: This is the implementation of the API for the HeaLth -** device profile (HL) subsystem of BTA, Broadcom Corp's Bluetooth -** application layer for mobile phones. -** -** Copyright (c) 2009-2011 Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 2009-2012 Broadcom Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +/****************************************************************************** + * + * This is the implementation of the API for the HeaLth device profile (HL) + * subsystem of BTA, Broadcom Corp's Bluetooth application layer for mobile + * phones. + * + ******************************************************************************/ #include @@ -66,7 +79,7 @@ void BTA_HlEnable(tBTA_HL_CTRL_CBACK *p_ctrl_cback) ** ** Function BTA_HlDisable ** -** Description Disable the HL subsystem. +** Description Disable the HL subsystem. ** ** Returns void ** @@ -87,11 +100,11 @@ void BTA_HlDisable(void) ** ** Function BTA_HlRegister ** -** Description Register an HDP application +** Description Register an HDP application ** ** Parameters app_id - Application ID -** p_reg_param - non-platform related parameters for the -** HDP application +** p_reg_param - non-platform related parameters for the +** HDP application ** p_cback - HL event callback fucntion ** ** Returns void @@ -146,10 +159,10 @@ void BTA_HlRegister(UINT8 app_id, ** ** Description Deregister an HDP application ** -** Parameters app_handle - Application handle +** Parameters app_handle - Application handle ** ** Returns void -** +** *******************************************************************************/ void BTA_HlDeregister(tBTA_HL_APP_HANDLE app_handle) { @@ -167,15 +180,15 @@ void BTA_HlDeregister(tBTA_HL_APP_HANDLE app_handle) ** Function BTA_HlCchOpen ** ** Description Open a Control channel connection with the specified BD address -** -** Parameters app_handle - Application Handle +** +** Parameters app_handle - Application Handle ** p_open_param - parameters for opening a control channel -** +** ** Returns void ** ** Note: The control PSM value is used to select which ** HDP insatnce should be used in case the peer device support -** multiple HDP instances. Also, if the control PSM value is zero +** multiple HDP instances. Also, if the control PSM value is zero ** then the first HDP instance is used for the control channel setup *******************************************************************************/ void BTA_HlCchOpen(tBTA_HL_APP_HANDLE app_handle, @@ -185,10 +198,10 @@ void BTA_HlCchOpen(tBTA_HL_APP_HANDLE app_handle, if ((p_buf = (tBTA_HL_API_CCH_OPEN *)GKI_getbuf((UINT16)(sizeof(tBTA_HL_API_CCH_OPEN)))) != NULL) { - p_buf->hdr.event = BTA_HL_API_CCH_OPEN_EVT; + p_buf->hdr.event = BTA_HL_API_CCH_OPEN_EVT; p_buf->app_handle = app_handle; p_buf->sec_mask = (p_open_param->sec_mask | BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT); - bdcpy(p_buf->bd_addr, p_open_param->bd_addr); + bdcpy(p_buf->bd_addr, p_open_param->bd_addr); p_buf->ctrl_psm = p_open_param->ctrl_psm; bta_sys_sendmsg(p_buf); } @@ -206,7 +219,7 @@ void BTA_HlCchOpen(tBTA_HL_APP_HANDLE app_handle, ** Returns void ** *******************************************************************************/ -void BTA_HlCchClose(tBTA_HL_MCL_HANDLE mcl_handle) +void BTA_HlCchClose(tBTA_HL_MCL_HANDLE mcl_handle) { tBTA_HL_API_CCH_CLOSE *p_buf; @@ -223,9 +236,9 @@ void BTA_HlCchClose(tBTA_HL_MCL_HANDLE mcl_handle) ** Function BTA_HlDchOpen ** ** Description Open a data channel connection with the specified DCH parameters -** +** ** Parameters mcl_handle - MCL handle -** p_open_param - parameters for opening a data channel +** p_open_param - parameters for opening a data channel ** ** Returns void ** @@ -239,7 +252,7 @@ void BTA_HlDchOpen(tBTA_HL_MCL_HANDLE mcl_handle, { p_buf->hdr.event = BTA_HL_API_DCH_OPEN_EVT; p_buf->mcl_handle = mcl_handle; - p_buf->ctrl_psm = p_open_param->ctrl_psm; + p_buf->ctrl_psm = p_open_param->ctrl_psm; p_buf->local_mdep_id = p_open_param->local_mdep_id; p_buf->peer_mdep_id = p_open_param->peer_mdep_id; p_buf->local_cfg = p_open_param->local_cfg; @@ -253,14 +266,14 @@ void BTA_HlDchOpen(tBTA_HL_MCL_HANDLE mcl_handle, ** Function BTA_HlDchReconnect ** ** Description Reconnect a data channel with the specified MDL_ID -** +** ** Parameters mcl_handle - MCL handle *8 p_recon_param - parameters for reconnecting a data channel ** ** Returns void ** *******************************************************************************/ -void BTA_HlDchReconnect(tBTA_HL_MCL_HANDLE mcl_handle, +void BTA_HlDchReconnect(tBTA_HL_MCL_HANDLE mcl_handle, tBTA_HL_DCH_RECONNECT_PARAM *p_recon_param) { tBTA_HL_API_DCH_RECONNECT *p_buf; @@ -286,14 +299,14 @@ void BTA_HlDchReconnect(tBTA_HL_MCL_HANDLE mcl_handle, ** Returns void ** *******************************************************************************/ -void BTA_HlDchClose(tBTA_HL_MDL_HANDLE mdl_handle) +void BTA_HlDchClose(tBTA_HL_MDL_HANDLE mdl_handle) { tBTA_HL_API_DCH_CLOSE *p_buf; if ((p_buf = (tBTA_HL_API_DCH_CLOSE *)GKI_getbuf((UINT16)(sizeof(tBTA_HL_API_DCH_CLOSE)))) != NULL) { p_buf->hdr.event = BTA_HL_API_DCH_CLOSE_EVT; - p_buf->mdl_handle = mdl_handle; + p_buf->mdl_handle = mdl_handle; bta_sys_sendmsg(p_buf); } } @@ -306,12 +319,12 @@ void BTA_HlDchClose(tBTA_HL_MDL_HANDLE mdl_handle) ** handle ** ** Parameters mcl_handle - MCL handle -** +** ** ** Returns void ** *******************************************************************************/ -void BTA_HlDchAbort(tBTA_HL_MCL_HANDLE mcl_handle) +void BTA_HlDchAbort(tBTA_HL_MCL_HANDLE mcl_handle) { tBTA_HL_API_DCH_ABORT *p_buf; @@ -327,15 +340,15 @@ void BTA_HlDchAbort(tBTA_HL_MCL_HANDLE mcl_handle) ** ** Function BTA_HlSendData ** -** Description Send an APDU to the peer device +** Description Send an APDU to the peer device ** ** Parameters mdl_handle - MDL handle ** pkt_size - size of the data packet to be sent ** -** Returns void +** Returns void ** *******************************************************************************/ -void BTA_HlSendData(tBTA_HL_MDL_HANDLE mdl_handle, +void BTA_HlSendData(tBTA_HL_MDL_HANDLE mdl_handle, UINT16 pkt_size) { tBTA_HL_API_SEND_DATA *p_buf = NULL; @@ -362,12 +375,12 @@ void BTA_HlSendData(tBTA_HL_MDL_HANDLE mdl_handle, ** Returns void ** ** note: If mdl_id = 0xFFFF then this means to delete all MDLs -** and this value can only be used with DeleteMdl request only +** and this value can only be used with DeleteMdl request only ** not other requests ** *******************************************************************************/ -void BTA_HlDeleteMdl(tBTA_HL_MCL_HANDLE mcl_handle, - tBTA_HL_MDL_ID mdl_id ) +void BTA_HlDeleteMdl(tBTA_HL_MCL_HANDLE mcl_handle, + tBTA_HL_MDL_ID mdl_id ) { tBTA_HL_API_DELETE_MDL *p_buf; @@ -375,7 +388,7 @@ void BTA_HlDeleteMdl(tBTA_HL_MCL_HANDLE mcl_handle, { p_buf->hdr.event = BTA_HL_API_DELETE_MDL_EVT; p_buf->mcl_handle = mcl_handle; - p_buf->mdl_id = mdl_id; + p_buf->mdl_id = mdl_id; bta_sys_sendmsg(p_buf); } } @@ -384,15 +397,15 @@ void BTA_HlDeleteMdl(tBTA_HL_MCL_HANDLE mcl_handle, ** ** Function BTA_HlDchEchoTest ** -** Description Initiate an echo test with the specified MCL handle +** Description Initiate an echo test with the specified MCL handle ** ** Parameters mcl_handle - MCL handle -*8 p_echo_test_param - parameters for echo testing +*8 p_echo_test_param - parameters for echo testing ** ** Returns void ** *******************************************************************************/ -void BTA_HlDchEchoTest( tBTA_HL_MCL_HANDLE mcl_handle, +void BTA_HlDchEchoTest( tBTA_HL_MCL_HANDLE mcl_handle, tBTA_HL_DCH_ECHO_TEST_PARAM *p_echo_test_param) { tBTA_HL_API_DCH_ECHO_TEST *p_buf; @@ -401,9 +414,9 @@ void BTA_HlDchEchoTest( tBTA_HL_MCL_HANDLE mcl_handle, { p_buf->hdr.event = BTA_HL_API_DCH_ECHO_TEST_EVT; p_buf->mcl_handle = mcl_handle; - p_buf->ctrl_psm = p_echo_test_param->ctrl_psm; - p_buf->local_cfg = p_echo_test_param->local_cfg; - p_buf->pkt_size = p_echo_test_param->pkt_size; + p_buf->ctrl_psm = p_echo_test_param->ctrl_psm; + p_buf->local_cfg = p_echo_test_param->local_cfg; + p_buf->pkt_size = p_echo_test_param->pkt_size; bta_sys_sendmsg(p_buf); } } @@ -417,7 +430,7 @@ void BTA_HlDchEchoTest( tBTA_HL_MCL_HANDLE mcl_handle, ** ** Parameters app_handle - application handle ** bd_addr - BD address -** +** ** Returns void ** *******************************************************************************/ @@ -430,7 +443,7 @@ void BTA_HlSdpQuery(tBTA_HL_APP_HANDLE app_handle, { p_buf->hdr.event = BTA_HL_API_SDP_QUERY_EVT; p_buf->app_handle = app_handle; - bdcpy(p_buf->bd_addr, bd_addr); + bdcpy(p_buf->bd_addr, bd_addr); bta_sys_sendmsg(p_buf); } } @@ -440,19 +453,19 @@ void BTA_HlSdpQuery(tBTA_HL_APP_HANDLE app_handle, ** ** Function BTA_HlDchCreateMdlRsp ** -** Description Set the Response and configuration values for the Create MDL +** Description Set the Response and configuration values for the Create MDL ** request ** ** Parameters mcl_handle - MCL handle -** p_rsp_param - parameters specified whether the request should +** p_rsp_param - parameters specified whether the request should ** be accepted or not and if it should be accepted -** then it also specified the configuration response -** value -** +** then it also specified the configuration response +** value +** ** Returns void ** *******************************************************************************/ -void BTA_HlDchCreateRsp(tBTA_HL_MCL_HANDLE mcl_handle, +void BTA_HlDchCreateRsp(tBTA_HL_MCL_HANDLE mcl_handle, tBTA_HL_DCH_CREATE_RSP_PARAM *p_rsp_param) { tBTA_HL_API_DCH_CREATE_RSP *p_buf; -- cgit v1.1