summaryrefslogtreecommitdiffstats
path: root/btif/include
diff options
context:
space:
mode:
authorPriti Aghera <paghera@broadcom.com>2012-03-22 11:51:08 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:14 -0700
commitc01f69a35563261eca49bd2083afd7064790940d (patch)
treeab42ef0ba2a5f9d86b6b972aa3f9143148e72b30 /btif/include
parent146738bdcf0accdbd5d865440f86152d2430812d (diff)
downloadexternal_bluetooth_bluedroid-c01f69a35563261eca49bd2083afd7064790940d.zip
external_bluetooth_bluedroid-c01f69a35563261eca49bd2083afd7064790940d.tar.gz
external_bluetooth_bluedroid-c01f69a35563261eca49bd2083afd7064790940d.tar.bz2
HID-Host:Fixed white space issue and power management issue
Included more code to support mouse connectiona and reconnection Signed-off-by: Priti Aghera <paghera@broadcom.com> Change-Id: I1e20997e85eda5919f20a069131e580bcbb0ca63
Diffstat (limited to 'btif/include')
-rw-r--r--btif/include/btif_common.h4
-rw-r--r--btif/include/btif_hh.h123
-rw-r--r--btif/include/btif_util.h1
3 files changed, 127 insertions, 1 deletions
diff --git a/btif/include/btif_common.h b/btif/include/btif_common.h
index 48ed00f..ec3f4f3 100644
--- a/btif/include/btif_common.h
+++ b/btif/include/btif_common.h
@@ -135,7 +135,9 @@ enum
BTIF_DM_CB_START = BTIF_SIG_CB_START(BTIF_DM),
BTIF_DM_CB_DISCOVERY_STARTED, /* Discovery has started */
- BTIF_DM_CB_BONDING_STARTED, /* Bonding process has started */
+ BTIF_DM_CB_CREATE_BOND, /* Create bond */
+ BTIF_DM_CB_REMOVE_BOND, /*Remove bond */
+ BTIF_DM_CB_HID_REMOTE_NAME, /* Remote name callback for HID device */
};
/************************************************************************************
diff --git a/btif/include/btif_hh.h b/btif/include/btif_hh.h
new file mode 100644
index 0000000..0f26b71
--- /dev/null
+++ b/btif/include/btif_hh.h
@@ -0,0 +1,123 @@
+/******************************************************************************
+ *
+ * Copyright (C) 2009-2012 Broadcom Corporation
+ *
+ * This program is the proprietary software of Broadcom Corporation and/or its
+ * licensors, and may only be used, duplicated, modified or distributed
+ * pursuant to the terms and conditions of a separate, written license
+ * agreement executed between you and Broadcom (an "Authorized License").
+ * Except as set forth in an Authorized License, Broadcom grants no license
+ * (express or implied), right to use, or waiver of any kind with respect to
+ * the Software, and Broadcom expressly reserves all rights in and to the
+ * Software and all intellectual property rights therein.
+ * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
+ * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
+ * ALL USE OF THE SOFTWARE.
+ *
+ * Except as expressly set forth in the Authorized License,
+ *
+ * 1. This program, including its structure, sequence and organization,
+ * constitutes the valuable trade secrets of Broadcom, and you shall
+ * use all reasonable efforts to protect the confidentiality thereof,
+ * and to use this information only in connection with your use of
+ * Broadcom integrated circuit products.
+ *
+ * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
+ * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
+ * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
+ * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
+ * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
+ * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
+ * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
+ * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING
+ * OUT OF USE OR PERFORMANCE OF THE SOFTWARE.
+ *
+ * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM
+ * OR ITS LICENSORS BE LIABLE FOR
+ * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
+ * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
+ * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
+ * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
+ * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
+ * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
+ * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
+ *
+ *****************************************************************************/
+
+/*****************************************************************************
+**
+** Name: btif_hh.h
+**
+** Description:
+**
+******************************************************************************/
+
+
+#ifndef BTIF_HH_H
+#define BTIF_HH_H
+
+#include <hardware/bluetooth.h>
+#include <hardware/bt_hh.h>
+#include <stdint.h>
+#include "bta_hh_api.h"
+
+
+#define BTIF_HH_MAX_HID 8
+#define BTIF_HH_MAX_ADDED_DEV 32
+
+typedef struct
+{
+ bthh_connection_state_t dev_status;
+ UINT8 dev_handle;
+ bt_bdaddr_t bd_addr;
+ tBTA_HH_ATTR_MASK attr_mask;
+ UINT8 sub_class;
+ UINT8 app_id;
+ int fd;
+ BT_HDR *p_buf;
+} btif_hh_device_t;
+
+//Control block to maintain properties of devices
+typedef struct
+{
+ UINT8 dev_handle;
+ bt_bdaddr_t bd_addr;
+ tBTA_HH_ATTR_MASK attr_mask;
+} btif_hh_added_device_t;
+
+typedef enum
+{
+ BTIF_HH_DISABLED = 0,
+ BTIF_HH_ENABLED,
+ BTIF_HH_DISABLING,
+ BTIF_HH_DEV_UNKNOWN,
+ BTIF_HH_DEV_PAIRED,
+ BTIF_HH_DEV_CONNECTED
+} BTIF_HH_STATUS;
+
+// BTIF-HH control block to maintain added devices and current connected hid device
+typedef struct
+{
+ BTIF_HH_STATUS status;
+ BOOLEAN mouse_pairing;
+ bt_bdaddr_t mouse_pairing_bda;
+ btif_hh_device_t devices[BTIF_HH_MAX_HID];
+ UINT32 device_num;
+ btif_hh_added_device_t added_devices[BTIF_HH_MAX_ADDED_DEV];
+ btif_hh_device_t *p_curr_dev;
+} btif_hh_cb_t;
+
+extern btif_hh_cb_t btif_hh_cb;
+
+extern btif_hh_device_t *btif_hh_find_connected_dev_by_handle(UINT8 handle);
+extern void btif_hh_update_keyevents(UINT8 dev_handle, int keyevents);
+extern void btif_hh_mouse_pairing(bt_bdaddr_t bd_addr);
+extern void btif_hh_clear_mouse_pairing(bt_bdaddr_t bd_addr);
+extern void btif_hh_remove_device(bt_bdaddr_t bd_addr);
+BOOLEAN btif_hh_add_added_dev(bt_bdaddr_t bda, tBTA_HH_ATTR_MASK attr_mask);
+
+
+
+#endif
+
diff --git a/btif/include/btif_util.h b/btif/include/btif_util.h
index 2688b09..05b7e76 100644
--- a/btif/include/btif_util.h
+++ b/btif/include/btif_util.h
@@ -87,6 +87,7 @@ typedef char bdstr_t[18];
const char* dump_bt_status(bt_status_t status);
const char* dump_dm_search_event(UINT16 event);
const char* dump_hf_event(UINT16 event);
+const char* dump_hh_event(UINT16 event);
const char* dump_hf_conn_state(UINT16 event);
const char* dump_hf_call_state(bthf_call_state_t call_state);
const char* dump_property_type(bt_property_type_t type);