blob: c332403e2f12af8d2259539f79411245b2dbed2c [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
3 * Copyright (C) 2002-2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 * This file contains HID HOST internal definitions
22 *
23 ******************************************************************************/
24
25#ifndef HIDH_INT_H
26#define HIDH_INT_H
27
The Android Open Source Project5738f832012-12-12 16:00:35 -080028#include "hid_conn.h"
Myles Watson911d1ae2016-11-28 16:44:40 -080029#include "hidh_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080030#include "l2c_api.h"
31
Myles Watson911d1ae2016-11-28 16:44:40 -080032enum { HID_DEV_NO_CONN, HID_DEV_CONNECTED };
The Android Open Source Project5738f832012-12-12 16:00:35 -080033
Myles Watson911d1ae2016-11-28 16:44:40 -080034typedef struct per_device_ctb {
35 bool in_use;
Jakub Pawlowskia484a882017-06-24 17:30:18 -070036 RawAddress addr; /* BD-Addr of the host device */
Myles Watson911d1ae2016-11-28 16:44:40 -080037 uint16_t attr_mask; /* 0x01- virtual_cable; 0x02- normally_connectable; 0x03-
38 reconn_initiate;
39 0x04- sdp_disable; */
40 uint8_t state; /* Device state if in HOST-KNOWN mode */
41 uint8_t conn_substate;
42 uint8_t conn_tries; /* Remembers the number of connection attempts while
43 CONNECTING */
The Android Open Source Project5738f832012-12-12 16:00:35 -080044
Myles Watson911d1ae2016-11-28 16:44:40 -080045 tHID_CONN conn; /* L2CAP channel info */
The Android Open Source Project5738f832012-12-12 16:00:35 -080046} tHID_HOST_DEV_CTB;
47
Myles Watson911d1ae2016-11-28 16:44:40 -080048typedef struct host_ctb {
49 tHID_HOST_DEV_CTB devices[HID_HOST_MAX_DEVICES];
50 tHID_HOST_DEV_CALLBACK* callback; /* Application callbacks */
51 tL2CAP_CFG_INFO l2cap_cfg;
The Android Open Source Project5738f832012-12-12 16:00:35 -080052
Myles Watson911d1ae2016-11-28 16:44:40 -080053#define MAX_SERVICE_DB_SIZE 4000
The Android Open Source Project5738f832012-12-12 16:00:35 -080054
Myles Watson911d1ae2016-11-28 16:44:40 -080055 bool sdp_busy;
56 tHID_HOST_SDP_CALLBACK* sdp_cback;
57 tSDP_DISCOVERY_DB* p_sdp_db;
58 tHID_DEV_SDP_INFO sdp_rec;
59 bool reg_flag;
60 uint8_t trace_level;
The Android Open Source Project5738f832012-12-12 16:00:35 -080061} tHID_HOST_CTB;
62
Myles Watson911d1ae2016-11-28 16:44:40 -080063extern tHID_STATUS hidh_conn_snd_data(uint8_t dhandle, uint8_t trans_type,
64 uint8_t param, uint16_t data,
65 uint8_t rpt_id, BT_HDR* buf);
66extern tHID_STATUS hidh_conn_reg(void);
67extern void hidh_conn_dereg(void);
68extern tHID_STATUS hidh_conn_disconnect(uint8_t dhandle);
69extern tHID_STATUS hidh_conn_initiate(uint8_t dhandle);
70extern void hidh_process_repage_timer_timeout(void* data);
Marie Janssend19e0782016-07-15 12:48:27 -070071extern void hidh_try_repage(uint8_t dhandle);
The Android Open Source Project5738f832012-12-12 16:00:35 -080072
The Android Open Source Project5738f832012-12-12 16:00:35 -080073/******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080074 * Main Control Block
75 ******************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -080076extern tHID_HOST_CTB hh_cb;
The Android Open Source Project5738f832012-12-12 16:00:35 -080077
The Android Open Source Project5738f832012-12-12 16:00:35 -080078#endif