summaryrefslogtreecommitdiffstats
path: root/stack/gatt/gatt_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'stack/gatt/gatt_attr.c')
-rw-r--r--stack/gatt/gatt_attr.c62
1 files changed, 38 insertions, 24 deletions
diff --git a/stack/gatt/gatt_attr.c b/stack/gatt/gatt_attr.c
index d8b417f..b7ec2fc 100644
--- a/stack/gatt/gatt_attr.c
+++ b/stack/gatt/gatt_attr.c
@@ -1,13 +1,27 @@
-/*****************************************************************************
-**
-** Name: gatt_attr.c
-**
-** Description: this file contains the main GATT server attributes access
-** request handling functions.
-**
-** Copyright (c) 2008-2011, Broadcom Corp., All Rights Reserved.
-** Broadcom Bluetooth Core. Proprietary and confidential.
-******************************************************************************/
+/******************************************************************************
+ *
+ * Copyright (C) 2008-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 main GATT server attributes access request
+ * handling functions.
+ *
+ ******************************************************************************/
#include "bt_target.h"
@@ -28,7 +42,7 @@
static void gatt_profile_request_cback (UINT16 conn_id, UINT32 trans_id, UINT8 op_code, tGATTS_DATA *p_data);
static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id, BOOLEAN connected, tGATT_DISCONN_REASON reason);
-static tGATT_CBACK gatt_profile_cback =
+static tGATT_CBACK gatt_profile_cback =
{
gatt_profile_connect_cback,
NULL,
@@ -144,14 +158,14 @@ BOOLEAN gatt_profile_clcb_dealloc (UINT16 conn_id)
**
** Function gatt_profile_request_cback
**
-** Description GATT profile attribute access request callback.
+** Description GATT profile attribute access request callback.
**
** Returns void.
**
*******************************************************************************/
-static void gatt_profile_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_REQ_TYPE type,
+static void gatt_profile_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_REQ_TYPE type,
tGATTS_DATA *p_data)
-{
+{
UINT8 status = GATT_INVALID_PDU;
tGATTS_RSP rsp_msg ;
BOOLEAN ignore = FALSE;
@@ -165,7 +179,7 @@ static void gatt_profile_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_
break;
case GATTS_REQ_TYPE_WRITE:
- status = GATT_WRITE_NOT_PERMIT;
+ status = GATT_WRITE_NOT_PERMIT;
break;
case GATTS_REQ_TYPE_WRITE_EXEC:
@@ -198,11 +212,11 @@ static void gatt_profile_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_
** Returns void
**
*******************************************************************************/
-static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
+static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
BOOLEAN connected, tGATT_DISCONN_REASON reason)
{
- GATT_TRACE_EVENT5 ("gatt_profile_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
- (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
+ GATT_TRACE_EVENT5 ("gatt_profile_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
+ (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
(bda[4]<<8)+bda[5], connected, conn_id, reason);
if (connected)
@@ -243,21 +257,21 @@ void gatt_profile_db_init (void)
GATT_StartIf(gatt_cb.gatt_if);
service_handle = GATTS_CreateService (gatt_cb.gatt_if , &uuid, 0, GATTP_MAX_ATTR_NUM, TRUE);
- /* add Service Changed characteristic
+ /* add Service Changed characteristic
*/
- uuid.uu.uuid16 = gatt_cb.gattp_attr.uuid = GATT_UUID_GATT_SRV_CHGD;
+ uuid.uu.uuid16 = gatt_cb.gattp_attr.uuid = GATT_UUID_GATT_SRV_CHGD;
gatt_cb.gattp_attr.service_change = 0;
- gatt_cb.gattp_attr.handle =
+ gatt_cb.gattp_attr.handle =
gatt_cb.handle_of_h_r = GATTS_AddCharacteristic(service_handle, &uuid, 0, GATT_CHAR_PROP_BIT_INDICATE);
- GATT_TRACE_DEBUG1 ("gatt_profile_db_init: handle of service changed%d",
+ GATT_TRACE_DEBUG1 ("gatt_profile_db_init: handle of service changed%d",
gatt_cb.handle_of_h_r );
- /* start service
+ /* start service
*/
status = GATTS_StartService (gatt_cb.gatt_if, service_handle, GATT_TRANSPORT_LE_BR_EDR);
- GATT_TRACE_DEBUG2 ("gatt_profile_db_init: gatt_if=%d start status%d",
+ GATT_TRACE_DEBUG2 ("gatt_profile_db_init: gatt_if=%d start status%d",
gatt_cb.gatt_if, status);
}