summaryrefslogtreecommitdiffstats
path: root/stack/hid
diff options
context:
space:
mode:
authorAndre Eisenbach <andre@broadcom.com>2012-09-18 01:35:44 -0700
committerMatthew Xie <mattx@google.com>2012-09-18 16:26:28 -0700
commit6ef101187774e30ddba6b46bbedef549a42196ad (patch)
treef36eb347f03083671640fbc750171e3b951e0082 /stack/hid
parentf80d3d045eab5f002be4b5e8a3d2d376fdf7581a (diff)
downloadexternal_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/hid')
-rw-r--r--stack/hid/hid_conn.h37
-rw-r--r--stack/hid/hidh_api.c78
-rw-r--r--stack/hid/hidh_conn.c82
-rw-r--r--stack/hid/hidh_int.h37
4 files changed, 142 insertions, 92 deletions
diff --git a/stack/hid/hid_conn.h b/stack/hid/hid_conn.h
index 41eeaaf..79bb496 100644
--- a/stack/hid/hid_conn.h
+++ b/stack/hid/hid_conn.h
@@ -1,14 +1,27 @@
-/****************************************************************************/
-/* */
-/* Name: hid_conn.h */
-/* */
-/* Function: this file contains HID connection internal definitions */
-/* */
-/* */
-/* 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.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * This file contains HID connection internal definitions
+ *
+ ******************************************************************************/
+
#ifndef HID_CONN_H
#define HID_CONN_H
@@ -51,6 +64,6 @@ typedef struct hid_conn
#define HID_NOSEC_CHN 2
#define HIDD_SEC_CHN 3
-#define HIDD_NOSEC_CHN 4
+#define HIDD_NOSEC_CHN 4
#endif
diff --git a/stack/hid/hidh_api.c b/stack/hid/hidh_api.c
index 268b405..36ee5ea 100644
--- a/stack/hid/hidh_api.c
+++ b/stack/hid/hidh_api.c
@@ -1,14 +1,26 @@
-/*****************************************************************************/
-/* */
-/* Name: hidh_api.c */
-/* */
-/* Description: this file contains the HID HOST API entry points */
-/* */
-/* */
-/* */
-/* Copyright (c) 2002-2010, Broadcom Corp., All Rights Reserved. */
-/* Broadcom 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.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * This file contains the HID HOST API entry points
+ *
+ ******************************************************************************/
#include <stdlib.h>
#include <string.h>
@@ -134,31 +146,31 @@ static void hidh_search_callback (UINT16 sdp_result)
attr_mask |= HID_VIRTUAL_CABLE;
}
- if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_RECONNECT_INITIATE)) != NULL) &&
+ if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_RECONNECT_INITIATE)) != NULL) &&
(p_attr->attr_value.v.u8) )
{
attr_mask |= HID_RECONN_INIT;
}
- if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_NORMALLY_CONNECTABLE)) != NULL) &&
+ if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_NORMALLY_CONNECTABLE)) != NULL) &&
(p_attr->attr_value.v.u8) )
{
attr_mask |= HID_NORMALLY_CONNECTABLE;
}
- if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_SDP_DISABLE)) != NULL)&&
+ if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_SDP_DISABLE)) != NULL)&&
(p_attr->attr_value.v.u8) )
{
attr_mask |= HID_SDP_DISABLE;
}
- if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_BATTERY_POWER)) != NULL)&&
+ if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_BATTERY_POWER)) != NULL)&&
(p_attr->attr_value.v.u8) )
{
attr_mask |= HID_BATTERY_POWER;
}
- if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_REMOTE_WAKE)) != NULL)&&
+ if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_REMOTE_WAKE)) != NULL)&&
(p_attr->attr_value.v.u8) )
{
attr_mask |= HID_REMOTE_WAKE;
@@ -169,33 +181,33 @@ static void hidh_search_callback (UINT16 sdp_result)
hidh_get_str_attr( p_rec, ATTR_ID_PROVIDER_NAME, HID_MAX_PROV_NAME_LEN, p_nvi->prov_name );
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_DEVICE_RELNUM)) != NULL))
- {
+ {
p_nvi->rel_num = p_attr->attr_value.v.u16;
}
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_COUNTRY_CODE)) != NULL))
- {
+ {
p_nvi->ctry_code = p_attr->attr_value.v.u8;
}
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_DEVICE_SUBCLASS)) != NULL))
- {
+ {
p_nvi->sub_class = p_attr->attr_value.v.u8;
}
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_PARSER_VERSION)) != NULL))
- {
+ {
p_nvi->hpars_ver = p_attr->attr_value.v.u16;
}
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_LINK_SUPERVISION_TO)) != NULL))
- {
+ {
attr_mask |= HID_SUP_TOUT_AVLBL;
p_nvi->sup_timeout = p_attr->attr_value.v.u16;
}
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_SSR_HOST_MAX_LAT)) != NULL))
- {
+ {
attr_mask |= HID_SSR_MAX_LATENCY;
p_nvi->ssr_max_latency = p_attr->attr_value.v.u16;
}
@@ -203,7 +215,7 @@ static void hidh_search_callback (UINT16 sdp_result)
p_nvi->ssr_max_latency = HID_SSR_PARAM_INVALID;
if (((p_attr = SDP_FindAttributeInRec (p_rec, ATTR_ID_HID_SSR_HOST_MIN_TOUT)) != NULL))
- {
+ {
attr_mask |= HID_SSR_MIN_TOUT;
p_nvi->ssr_min_tout = p_attr->attr_value.v.u16;
}
@@ -304,7 +316,7 @@ tHID_STATUS HID_HostDeregister(void)
{
HID_HostRemoveDev( i ) ;
}
-
+
hidh_conn_dereg();
hh_cb.reg_flag = FALSE;
@@ -421,11 +433,11 @@ tHID_STATUS HID_HostOpenDev ( UINT8 dev_handle )
**
** report_id: is only used on GET_REPORT transaction if is specified.
** only valid when it's a non-zero value.
-**
+**
** Returns void
**
*******************************************************************************/
-tHID_STATUS HID_HostWriteDev( UINT8 dev_handle, UINT8 t_type,
+tHID_STATUS HID_HostWriteDev( UINT8 dev_handle, UINT8 t_type,
UINT8 param, UINT16 data, UINT8 report_id, BT_HDR *pbuf )
{
tHID_STATUS status = HID_SUCCESS;
@@ -455,7 +467,7 @@ tHID_STATUS HID_HostWriteDev( UINT8 dev_handle, UINT8 t_type,
}
else
status = hidh_conn_snd_data( dev_handle, t_type, param, data, report_id, pbuf ) ;
-
+
return status;
}
@@ -488,42 +500,42 @@ tHID_STATUS HID_HostCloseDev( UINT8 dev_handle )
tHID_STATUS HID_HostSetSecurityLevel( char serv_name[], UINT8 sec_lvl )
{
- if (!BTM_SetSecurityLevel (FALSE, serv_name, BTM_SEC_SERVICE_HID_SEC_CTRL,
+ if (!BTM_SetSecurityLevel (FALSE, serv_name, BTM_SEC_SERVICE_HID_SEC_CTRL,
sec_lvl, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_SEC_CHN))
{
HIDH_TRACE_ERROR0 ("Security Registration 1 failed");
return (HID_ERR_NO_RESOURCES);
}
- if (!BTM_SetSecurityLevel (TRUE, serv_name, BTM_SEC_SERVICE_HID_SEC_CTRL,
+ if (!BTM_SetSecurityLevel (TRUE, serv_name, BTM_SEC_SERVICE_HID_SEC_CTRL,
sec_lvl, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_SEC_CHN))
{
HIDH_TRACE_ERROR0 ("Security Registration 2 failed");
return (HID_ERR_NO_RESOURCES);
}
- if (!BTM_SetSecurityLevel (FALSE, serv_name, BTM_SEC_SERVICE_HID_NOSEC_CTRL,
+ if (!BTM_SetSecurityLevel (FALSE, serv_name, BTM_SEC_SERVICE_HID_NOSEC_CTRL,
BTM_SEC_NONE, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_NOSEC_CHN))
{
HIDH_TRACE_ERROR0 ("Security Registration 3 failed");
return (HID_ERR_NO_RESOURCES);
}
- if (!BTM_SetSecurityLevel (TRUE, serv_name, BTM_SEC_SERVICE_HID_NOSEC_CTRL,
+ if (!BTM_SetSecurityLevel (TRUE, serv_name, BTM_SEC_SERVICE_HID_NOSEC_CTRL,
BTM_SEC_NONE, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_NOSEC_CHN))
{
HIDH_TRACE_ERROR0 ("Security Registration 4 failed");
return (HID_ERR_NO_RESOURCES);
}
- if (!BTM_SetSecurityLevel (TRUE, serv_name, BTM_SEC_SERVICE_HID_INTR,
+ if (!BTM_SetSecurityLevel (TRUE, serv_name, BTM_SEC_SERVICE_HID_INTR,
BTM_SEC_NONE, HID_PSM_INTERRUPT, BTM_SEC_PROTO_HID, 0))
{
HIDH_TRACE_ERROR0 ("Security Registration 5 failed");
return (HID_ERR_NO_RESOURCES);
}
- if (!BTM_SetSecurityLevel (FALSE, serv_name, BTM_SEC_SERVICE_HID_INTR,
+ if (!BTM_SetSecurityLevel (FALSE, serv_name, BTM_SEC_SERVICE_HID_INTR,
BTM_SEC_NONE, HID_PSM_INTERRUPT, BTM_SEC_PROTO_HID, 0))
{
HIDH_TRACE_ERROR0 ("Security Registration 6 failed");
diff --git a/stack/hid/hidh_conn.c b/stack/hid/hidh_conn.c
index 29c4025..9ed3a0e 100644
--- a/stack/hid/hidh_conn.c
+++ b/stack/hid/hidh_conn.c
@@ -1,14 +1,26 @@
-/*****************************************************************************
-**
-** Name: hid_conn.c
-**
-** Description: this file contains the connection interface functions
-**
-**
-** Copyright (c) 2002-2010, Broadcom Corp., All Rights Reserved.
-** Broadcom 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.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * this file contains the connection interface functions
+ *
+ ******************************************************************************/
#include <stdlib.h>
#include <string.h>
@@ -46,7 +58,7 @@ static void hidh_l2cif_data_ind (UINT16 l2cap_cid, BT_HDR *p_msg);
static void hidh_l2cif_disconnect_cfm (UINT16 l2cap_cid, UINT16 result);
static void hidh_l2cif_cong_ind (UINT16 l2cap_cid, BOOLEAN congested);
-static const tL2CAP_APPL_INFO hst_reg_info =
+static const tL2CAP_APPL_INFO hst_reg_info =
{
hidh_l2cif_connect_ind,
hidh_l2cif_connect_cfm,
@@ -159,18 +171,18 @@ void hidh_sec_check_complete_term (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
p_dev->conn.conn_state = HID_CONN_STATE_CONNECTING_INTR;
/* Send response to the L2CAP layer. */
- L2CA_ConnectRsp (p_dev->addr, p_dev->conn.ctrl_id, p_dev->conn.ctrl_cid, L2CAP_CONN_OK, L2CAP_CONN_OK);
+ L2CA_ConnectRsp (p_dev->addr, p_dev->conn.ctrl_id, p_dev->conn.ctrl_cid, L2CAP_CONN_OK, L2CAP_CONN_OK);
/* Send a Configuration Request. */
L2CA_ConfigReq (p_dev->conn.ctrl_cid, &hh_cb.l2cap_cfg);
-
+
}
/* security check fail */
- else if (res != BTM_SUCCESS)
+ else if (res != BTM_SUCCESS)
{
p_dev->conn.disc_reason = HID_ERR_AUTH_FAILED; /* Save reason for disconnecting */
p_dev->conn.conn_state = HID_CONN_STATE_UNUSED;
- L2CA_ConnectRsp (p_dev->addr, p_dev->conn.ctrl_id, p_dev->conn.ctrl_cid, L2CAP_CONN_SECURITY_BLOCK, L2CAP_CONN_OK);
+ L2CA_ConnectRsp (p_dev->addr, p_dev->conn.ctrl_id, p_dev->conn.ctrl_cid, L2CAP_CONN_SECURITY_BLOCK, L2CAP_CONN_OK);
}
}
@@ -180,7 +192,7 @@ void hidh_sec_check_complete_term (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
**
** Description This function handles an inbound connection indication
** from L2CAP. This is the case where we are acting as a
-** server.
+** server.
**
** Returns void
**
@@ -190,7 +202,7 @@ static void hidh_l2cif_connect_ind (BD_ADDR bd_addr, UINT16 l2cap_cid, UINT16 p
tHID_CONN *p_hcon;
BOOLEAN bAccept = TRUE;
int i;
- tHID_HOST_DEV_CTB *p_dev;
+ tHID_HOST_DEV_CTB *p_dev;
HIDH_TRACE_EVENT2 ("HID - Rcvd L2CAP conn ind, PSM: 0x%04x CID 0x%x", psm, l2cap_cid);
@@ -228,7 +240,7 @@ static void hidh_l2cif_connect_ind (BD_ADDR bd_addr, UINT16 l2cap_cid, UINT16 p
#if defined(HID_HOST_ACPT_NEW_CONN) && (HID_HOST_ACPT_NEW_CONN == TRUE)
p_hcon->ctrl_cid = p_hcon->intr_cid = 0;
p_hcon->conn_state = HID_CONN_STATE_UNUSED;
-#else
+#else
if (p_hcon->conn_state != HID_CONN_STATE_UNUSED)
{
HIDH_TRACE_WARNING1 ("HID - Rcvd CTL L2CAP conn ind, wrong state: %d", p_hcon->conn_state);
@@ -251,12 +263,12 @@ static void hidh_l2cif_connect_ind (BD_ADDR bd_addr, UINT16 l2cap_cid, UINT16 p
p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* In case disconnection occurs before security is completed, then set CLOSE_EVT reason code to 'connection failure' */
p_hcon->conn_state = HID_CONN_STATE_SECURITY;
- if(btm_sec_mx_access_request (p_dev->addr, HID_PSM_CONTROL,
- FALSE, BTM_SEC_PROTO_HID,
+ if(btm_sec_mx_access_request (p_dev->addr, HID_PSM_CONTROL,
+ FALSE, BTM_SEC_PROTO_HID,
(p_dev->attr_mask & HID_SEC_REQUIRED) ? HID_SEC_CHN : HID_NOSEC_CHN,
&hidh_sec_check_complete_term, p_dev) == BTM_CMD_STARTED)
{
- L2CA_ConnectRsp (bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_PENDING, L2CAP_CONN_OK);
+ L2CA_ConnectRsp (bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_PENDING, L2CAP_CONN_OK);
}
return;
@@ -267,7 +279,7 @@ static void hidh_l2cif_connect_ind (BD_ADDR bd_addr, UINT16 l2cap_cid, UINT16 p
p_hcon->intr_cid = l2cap_cid;
/* Send response to the L2CAP layer. */
- L2CA_ConnectRsp (bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_OK, L2CAP_CONN_OK);
+ L2CA_ConnectRsp (bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_OK, L2CAP_CONN_OK);
/* Send a Configuration Request. */
L2CA_ConfigReq (l2cap_cid, &hh_cb.l2cap_cfg);
@@ -342,12 +354,12 @@ void hidh_sec_check_complete_orig (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
hidh_conn_retry (dhandle);
return;
}
- else
+ else
cb_res = HID_L2CAP_CONN_FAIL | HCI_ERR_PAGE_TIMEOUT ;
}
#endif
p_dev->conn.disc_reason = HID_ERR_AUTH_FAILED; /* Save reason for disconnecting */
- hidh_conn_disconnect(dhandle);
+ hidh_conn_disconnect(dhandle);
}
}
@@ -368,7 +380,7 @@ static void hidh_l2cif_connect_cfm (UINT16 l2cap_cid, UINT16 result)
UINT8 dhandle;
tHID_CONN *p_hcon = NULL;
UINT32 reason;
- tHID_HOST_DEV_CTB *p_dev = NULL;
+ tHID_HOST_DEV_CTB *p_dev = NULL;
/* Find CCB based on CID, and verify we are in a state to accept this message */
if( (dhandle = find_conn_by_cid(l2cap_cid)) < HID_HOST_MAX_DEVICES )
@@ -397,7 +409,7 @@ static void hidh_l2cif_connect_cfm (UINT16 l2cap_cid, UINT16 result)
#if (HID_HOST_MAX_CONN_RETRY > 0)
if( (hh_cb.devices[dhandle].conn_tries <= HID_HOST_MAX_CONN_RETRY) &&
- (result == HCI_ERR_CONNECTION_TOUT || result == HCI_ERR_UNSPECIFIED ||
+ (result == HCI_ERR_CONNECTION_TOUT || result == HCI_ERR_UNSPECIFIED ||
result == HCI_ERR_PAGE_TIMEOUT) )
{
hidh_conn_retry(dhandle);
@@ -417,8 +429,8 @@ static void hidh_l2cif_connect_cfm (UINT16 l2cap_cid, UINT16 result)
p_hcon->conn_state = HID_CONN_STATE_SECURITY;
p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* In case disconnection occurs before security is completed, then set CLOSE_EVT reason code to "connection failure" */
- btm_sec_mx_access_request (p_dev->addr, HID_PSM_CONTROL,
- TRUE, BTM_SEC_PROTO_HID,
+ btm_sec_mx_access_request (p_dev->addr, HID_PSM_CONTROL,
+ TRUE, BTM_SEC_PROTO_HID,
(p_dev->attr_mask & HID_SEC_REQUIRED) ? HID_SEC_CHN : HID_NOSEC_CHN,
&hidh_sec_check_complete_orig, p_dev);
}
@@ -448,7 +460,7 @@ static void hidh_l2cif_config_ind (UINT16 l2cap_cid, tL2CAP_CFG_INFO *p_cfg)
{
UINT8 dhandle;
tHID_CONN *p_hcon = NULL;
- tHID_HOST_DEV_CTB *p_dev;
+ tHID_HOST_DEV_CTB *p_dev;
/* Find CCB based on CID */
if( (dhandle = find_conn_by_cid(l2cap_cid)) < HID_HOST_MAX_DEVICES )
@@ -597,7 +609,7 @@ static void hidh_l2cif_disconnect_ind (UINT16 l2cap_cid, BOOLEAN ack_needed)
disc_res = btm_get_acl_disc_reason_code();
#if (HID_HOST_MAX_CONN_RETRY > 0)
- if( (disc_res == HCI_ERR_CONNECTION_TOUT || disc_res == HCI_ERR_UNSPECIFIED) &&
+ if( (disc_res == HCI_ERR_CONNECTION_TOUT || disc_res == HCI_ERR_UNSPECIFIED) &&
(!(hh_cb.devices[dhandle].attr_mask & HID_RECONN_INIT)) &&
(hh_cb.devices[dhandle].attr_mask & HID_NORMALLY_CONNECTABLE))
{
@@ -612,7 +624,7 @@ static void hidh_l2cif_disconnect_ind (UINT16 l2cap_cid, BOOLEAN ack_needed)
hid_close_evt_reason = p_hcon->disc_reason;
/* If we got baseband sent HCI_DISCONNECT_COMPLETE_EVT due to security failure, then set reason to HID_ERR_AUTH_FAILED */
- if ((disc_res == HCI_ERR_AUTH_FAILURE) ||
+ if ((disc_res == HCI_ERR_AUTH_FAILURE) ||
(disc_res == HCI_ERR_KEY_MISSING) ||
(disc_res == HCI_ERR_HOST_REJECT_SECURITY) ||
(disc_res == HCI_ERR_PAIRING_NOT_ALLOWED) ||
@@ -775,13 +787,13 @@ static void hidh_l2cif_data_ind (UINT16 l2cap_cid, BT_HDR *p_msg)
case HID_TRANS_DATA:
- evt = (hh_cb.devices[dhandle].conn.intr_cid == l2cap_cid) ?
+ evt = (hh_cb.devices[dhandle].conn.intr_cid == l2cap_cid) ?
HID_HDEV_EVT_INTR_DATA : HID_HDEV_EVT_CTRL_DATA;
hh_cb.callback(dhandle, evt, rep_type, p_msg);
break;
case HID_TRANS_DATAC:
- evt = (hh_cb.devices[dhandle].conn.intr_cid == l2cap_cid) ?
+ evt = (hh_cb.devices[dhandle].conn.intr_cid == l2cap_cid) ?
HID_HDEV_EVT_INTR_DATC : HID_HDEV_EVT_CTRL_DATC;
hh_cb.callback(dhandle, evt, rep_type, p_msg);
break;
@@ -802,7 +814,7 @@ static void hidh_l2cif_data_ind (UINT16 l2cap_cid, BT_HDR *p_msg)
** Returns tHID_STATUS
**
*******************************************************************************/
-tHID_STATUS hidh_conn_snd_data (UINT8 dhandle, UINT8 trans_type, UINT8 param,
+tHID_STATUS hidh_conn_snd_data (UINT8 dhandle, UINT8 trans_type, UINT8 param,
UINT16 data, UINT8 report_id, BT_HDR *buf)
{
tHID_CONN *p_hcon = &hh_cb.devices[dhandle].conn;
diff --git a/stack/hid/hidh_int.h b/stack/hid/hidh_int.h
index 8e1a8a2..ad07412 100644
--- a/stack/hid/hidh_int.h
+++ b/stack/hid/hidh_int.h
@@ -1,13 +1,26 @@
-/****************************************************************************/
-/* */
-/* Name: hidh_int.h */
-/* */
-/* Function: this file contains HID HOST internal definitions */
-/* */
-/* 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.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * This file contains HID HOST internal definitions
+ *
+ ******************************************************************************/
#ifndef HIDH_INT_H
#define HIDH_INT_H
@@ -28,7 +41,7 @@ typedef struct per_device_ctb
UINT16 attr_mask; /* 0x01- virtual_cable; 0x02- normally_connectable; 0x03- reconn_initiate;
0x04- sdp_disable; */
UINT8 state; /* Device state if in HOST-KNOWN mode */
- UINT8 conn_substate;
+ UINT8 conn_substate;
UINT8 conn_tries; /* Remembers to the number of connection attempts while CONNECTING */
tHID_CONN conn; /* L2CAP channel info */
@@ -43,7 +56,7 @@ typedef struct host_ctb
#define MAX_SERVICE_DB_SIZE 4000
BOOLEAN sdp_busy;
- tHID_HOST_SDP_CALLBACK *sdp_cback;
+ tHID_HOST_SDP_CALLBACK *sdp_cback;
tSDP_DISCOVERY_DB *p_sdp_db;
tHID_DEV_SDP_INFO sdp_rec;
BOOLEAN reg_flag;