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/gatt/bta_gattc_main.c | 60 ++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 24 deletions(-) (limited to 'bta/gatt/bta_gattc_main.c') diff --git a/bta/gatt/bta_gattc_main.c b/bta/gatt/bta_gattc_main.c index 5016c46..a1fb536 100644 --- a/bta/gatt/bta_gattc_main.c +++ b/bta/gatt/bta_gattc_main.c @@ -1,14 +1,26 @@ -/***************************************************************************** -** -** Name: bta_gattc_main.c -** -** Description: This file contains the GATT client main functions -** and state machine. -** -** Copyright (c) 2003-2009, Broadcom Corp., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 2003-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 file contains the GATT client main functions and state machine. + * + ******************************************************************************/ #include "bt_target.h" @@ -33,7 +45,7 @@ enum //BTA_GATTC_OPEN_FAIL_IN_CONN, //<--- need to remove this? BTA_GATTC_OPEN_ERROR, BTA_GATTC_CANCEL_OPEN, - BTA_GATTC_CANCEL_OPEN_OK, + BTA_GATTC_CANCEL_OPEN_OK, BTA_GATTC_CANCEL_OPEN_ERROR, BTA_GATTC_CONN, BTA_GATTC_START_DISCOVER, @@ -72,7 +84,7 @@ const tBTA_GATTC_ACTION bta_gattc_action[] = bta_gattc_cancel_open, bta_gattc_cancel_open_ok, bta_gattc_cancel_open_error, - bta_gattc_conn, + bta_gattc_conn, bta_gattc_start_discover, bta_gattc_disc_cmpl, @@ -85,7 +97,7 @@ const tBTA_GATTC_ACTION bta_gattc_action[] = bta_gattc_op_cmpl, bta_gattc_search, bta_gattc_fail, - bta_gattc_confirm, + bta_gattc_confirm, bta_gattc_execute, bta_gattc_read_multi, bta_gattc_ci_open, @@ -126,7 +138,7 @@ static const UINT8 bta_gattc_st_idle[][BTA_GATTC_NUM_COLS] = /* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_IDLE_ST}, -/* ===> for cache loading, saving */ +/* ===> for cache loading, saving */ /* BTA_GATTC_START_CACHE_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_IDLE_ST}, /* BTA_GATTC_CI_CACHE_OPEN_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_IDLE_ST}, /* BTA_GATTC_CI_CACHE_LOAD_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_IDLE_ST}, @@ -172,7 +184,7 @@ static const UINT8 bta_gattc_st_connected[][BTA_GATTC_NUM_COLS] = /* BTA_GATTC_API_OPEN_EVT */ {BTA_GATTC_OPEN_ERROR, BTA_GATTC_CONN_ST}, /* BTA_GATTC_INT_OPEN_FAIL_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_CONN_ST}, /* BTA_GATTC_API_CANCEL_OPEN_EVT */ {BTA_GATTC_CANCEL_OPEN_ERROR, BTA_GATTC_CONN_ST}, -/* BTA_GATTC_INT_CANCEL_OPEN_OK_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_CONN_ST}, +/* BTA_GATTC_INT_CANCEL_OPEN_OK_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_CONN_ST}, /* BTA_GATTC_API_READ_EVT */ {BTA_GATTC_READ, BTA_GATTC_CONN_ST}, /* BTA_GATTC_API_WRITE_EVT */ {BTA_GATTC_WRITE, BTA_GATTC_CONN_ST}, @@ -190,7 +202,7 @@ static const UINT8 bta_gattc_st_connected[][BTA_GATTC_NUM_COLS] = /* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_CLOSE, BTA_GATTC_IDLE_ST}, -/* ===> for cache loading, saving */ +/* ===> for cache loading, saving */ /* BTA_GATTC_START_CACHE_EVT */ {BTA_GATTC_CACHE_OPEN, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_CI_CACHE_OPEN_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_CONN_ST}, /* BTA_GATTC_CI_CACHE_LOAD_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_CONN_ST}, @@ -204,7 +216,7 @@ static const UINT8 bta_gattc_st_discover[][BTA_GATTC_NUM_COLS] = /* BTA_GATTC_API_OPEN_EVT */ {BTA_GATTC_OPEN_ERROR, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_INT_OPEN_FAIL_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_API_CANCEL_OPEN_EVT */ {BTA_GATTC_CANCEL_OPEN_ERROR, BTA_GATTC_DISCOVER_ST}, -/* BTA_GATTC_INT_CANCEL_OPEN_OK_EVT */ {BTA_GATTC_FAIL, BTA_GATTC_DISCOVER_ST}, +/* BTA_GATTC_INT_CANCEL_OPEN_OK_EVT */ {BTA_GATTC_FAIL, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_API_READ_EVT */ {BTA_GATTC_Q_CMD, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_API_WRITE_EVT */ {BTA_GATTC_Q_CMD, BTA_GATTC_DISCOVER_ST}, @@ -217,11 +229,11 @@ static const UINT8 bta_gattc_st_discover[][BTA_GATTC_NUM_COLS] = /* BTA_GATTC_API_READ_MULTI_EVT */ {BTA_GATTC_Q_CMD, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_INT_CONN_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_INT_DISCOVER_EVT */ {BTA_GATTC_START_DISCOVER, BTA_GATTC_DISCOVER_ST}, -/* BTA_GATTC_DISCOVER_CMPL_EVT */ {BTA_GATTC_DISC_CMPL, BTA_GATTC_CONN_ST}, +/* BTA_GATTC_DISCOVER_CMPL_EVT */ {BTA_GATTC_DISC_CMPL, BTA_GATTC_CONN_ST}, /* BTA_GATTC_OP_CMPL_EVT */ {BTA_GATTC_IGNORE_OP_CMPL, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_INT_DISCONN_EVT */ {BTA_GATTC_CLOSE, BTA_GATTC_IDLE_ST}, -/* ===> for cache loading, saving */ +/* ===> for cache loading, saving */ /* BTA_GATTC_START_CACHE_EVT */ {BTA_GATTC_IGNORE, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_CI_CACHE_OPEN_EVT */ {BTA_GATTC_CI_OPEN, BTA_GATTC_DISCOVER_ST}, /* BTA_GATTC_CI_CACHE_LOAD_EVT */ {BTA_GATTC_CI_LOAD, BTA_GATTC_DISCOVER_ST}, @@ -259,7 +271,7 @@ static char *gattc_state_code(tBTA_GATTC_STATE state_code); ** Function bta_gattc_sm_execute ** ** Description State machine event handling function for GATTC -** +** ** ** Returns void ** @@ -316,7 +328,7 @@ void bta_gattc_sm_execute(tBTA_GATTC_CLCB *p_clcb, UINT16 event, tBTA_GATTC_DATA ** Function bta_gattc_hdl_event ** ** Description GATT client main event handling function. -** +** ** ** Returns void ** @@ -383,7 +395,7 @@ BOOLEAN bta_gattc_hdl_event(BT_HDR *p_msg) ** ** Function gattc_evt_code ** -** Description +** Description ** ** Returns void ** @@ -448,7 +460,7 @@ static char *gattc_evt_code(tBTA_GATTC_INT_EVT evt_code) ** ** Function gattc_state_code ** -** Description +** Description ** ** Returns void ** -- cgit v1.1