diff options
author | Andre Eisenbach <andre@broadcom.com> | 2012-09-18 01:35:44 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-09-18 16:26:28 -0700 |
commit | 6ef101187774e30ddba6b46bbedef549a42196ad (patch) | |
tree | f36eb347f03083671640fbc750171e3b951e0082 /stack/a2dp | |
parent | f80d3d045eab5f002be4b5e8a3d2d376fdf7581a (diff) | |
download | external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.zip external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.tar.gz external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.tar.bz2 |
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
Diffstat (limited to 'stack/a2dp')
-rw-r--r-- | stack/a2dp/a2d_api.c | 49 | ||||
-rw-r--r-- | stack/a2dp/a2d_int.h | 35 | ||||
-rw-r--r-- | stack/a2dp/a2d_sbc.c | 37 |
3 files changed, 81 insertions, 40 deletions
diff --git a/stack/a2dp/a2d_api.c b/stack/a2dp/a2d_api.c index dbff646..71dcc13 100644 --- a/stack/a2dp/a2d_api.c +++ b/stack/a2dp/a2d_api.c @@ -1,13 +1,26 @@ -/***************************************************************************** -** -** Name: a2d_api.c -** -** Description:Common API for the Advanced Audio Distribution Profile (A2DP) -** -** Copyright (c) 2002-2009, Broadcom Corp., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 2002-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. + * + ******************************************************************************/ + +/****************************************************************************** + * + * ommon API for the Advanced Audio Distribution Profile (A2DP) + * + ******************************************************************************/ #include <string.h> #include "bt_target.h" #include "sdpdefs.h" @@ -54,7 +67,7 @@ static void a2d_sdp_cback(UINT16 status) do { /* get next record; if none found, we're done */ - if ((p_rec = SDP_FindServiceInDb(a2d_cb.find.p_db, + if ((p_rec = SDP_FindServiceInDb(a2d_cb.find.p_db, a2d_cb.find.service_uuid, p_rec)) == NULL) { break; @@ -112,7 +125,7 @@ static void a2d_sdp_cback(UINT16 status) ** ** Function a2d_set_avdt_sdp_ver ** -** Description This function allows the script wrapper to change the +** Description This function allows the script wrapper to change the ** avdt version of a2dp. ** ** Returns None @@ -172,7 +185,7 @@ tA2D_STATUS A2D_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_pro result &= SDP_AddServiceClassIdList(sdp_handle, 1, &service_uuid); memset((void*) proto_list, 0 , A2D_NUM_PROTO_ELEMS*sizeof(tSDP_PROTOCOL_ELEM)); - + /* add protocol descriptor list */ proto_list[0].protocol_uuid = UUID_PROTOCOL_L2CAP; proto_list[0].num_params = 1; @@ -239,7 +252,7 @@ tA2D_STATUS A2D_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_pro ** ** p_db: Pointer to the information to initialize ** the discovery database. -** +** ** p_cback: Pointer to the A2D_FindService() ** callback function. ** @@ -269,7 +282,7 @@ tA2D_STATUS A2D_FindService(UINT16 service_uuid, BD_ADDR bd_addr, p_db == NULL || p_db->p_db == NULL || p_cback == NULL) return A2D_INVALID_PARAMS; - if( a2d_cb.find.service_uuid == UUID_SERVCLASS_AUDIO_SOURCE || + if( a2d_cb.find.service_uuid == UUID_SERVCLASS_AUDIO_SOURCE || a2d_cb.find.service_uuid == UUID_SERVCLASS_AUDIO_SINK) return A2D_BUSY; @@ -360,9 +373,9 @@ UINT8 A2D_BitsSet(UINT8 num) ** Function A2D_Init ** ** Description This function is called to initialize the control block -** for this layer. It must be called before accessing any +** for this layer. It must be called before accessing any ** other API functions for this layer. It is typically called -** once during the start up of the stack. +** once during the start up of the stack. ** ** Returns void ** @@ -372,7 +385,7 @@ void A2D_Init(void) memset(&a2d_cb, 0, sizeof(tA2D_CB)); a2d_cb.avdt_sdp_ver = AVDT_VERSION; - + #if defined(A2D_INITIAL_TRACE_LEVEL) a2d_cb.trace_level = A2D_INITIAL_TRACE_LEVEL; #else diff --git a/stack/a2dp/a2d_int.h b/stack/a2dp/a2d_int.h index 07cf34c..4aaa083 100644 --- a/stack/a2dp/a2d_int.h +++ b/stack/a2dp/a2d_int.h @@ -1,13 +1,26 @@ -/***************************************************************************** -** -** Name: a2d_int.h -** -** Description:A2DP internal header file -** -** Copyright (c) 2002-2009, Broadcom Corp., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 2002-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. + * + ******************************************************************************/ + +/****************************************************************************** + * + * 2DP internal header file + * + ******************************************************************************/ #ifndef A2D_INT_H #define A2D_INT_H @@ -29,7 +42,7 @@ *****************************************************************************/ /* Control block used by A2D_FindService(). */ -typedef struct +typedef struct { tA2D_FIND_CBACK *p_cback; /* pointer to application callback */ tSDP_DISCOVERY_DB *p_db; /* pointer to discovery database */ diff --git a/stack/a2dp/a2d_sbc.c b/stack/a2dp/a2d_sbc.c index cec335a..a4e5255 100644 --- a/stack/a2dp/a2d_sbc.c +++ b/stack/a2dp/a2d_sbc.c @@ -1,13 +1,28 @@ -/***************************************************************************** -** -** Name: a2d_sbc.c -** -** Description:utility functions to help build and parse SBC -** Codec Information Element and Media Payload. -** Copyright (c) 2002-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 2002-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. + * + ******************************************************************************/ + +/****************************************************************************** + * + * Utility functions to help build and parse SBC Codec Information Element + * and Media Payload. + * + ******************************************************************************/ + #include "bt_target.h" #if (A2D_SBC_INCLUDED == TRUE) @@ -46,7 +61,7 @@ * * if(index > 0) * { - * p = &u8frame[base_index]; + * p = &u8frame[base_index]; * if((index&1)&&(u16PacketLength > (base_index+index*2))) * { * // odd index: swap 2 bytes |