The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 28 | #include "hid_conn.h" |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 29 | #include "hidh_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 30 | #include "l2c_api.h" |
| 31 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 32 | enum { HID_DEV_NO_CONN, HID_DEV_CONNECTED }; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 33 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 34 | typedef struct per_device_ctb { |
| 35 | bool in_use; |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame^] | 36 | RawAddress addr; /* BD-Addr of the host device */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 37 | 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 44 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 45 | tHID_CONN conn; /* L2CAP channel info */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 46 | } tHID_HOST_DEV_CTB; |
| 47 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 48 | typedef 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 52 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 53 | #define MAX_SERVICE_DB_SIZE 4000 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 54 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 55 | 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 Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 61 | } tHID_HOST_CTB; |
| 62 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 63 | extern 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); |
| 66 | extern tHID_STATUS hidh_conn_reg(void); |
| 67 | extern void hidh_conn_dereg(void); |
| 68 | extern tHID_STATUS hidh_conn_disconnect(uint8_t dhandle); |
| 69 | extern tHID_STATUS hidh_conn_initiate(uint8_t dhandle); |
| 70 | extern void hidh_process_repage_timer_timeout(void* data); |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 71 | extern void hidh_try_repage(uint8_t dhandle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 72 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 73 | /****************************************************************************** |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 74 | * Main Control Block |
| 75 | ******************************************************************************/ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 76 | extern tHID_HOST_CTB hh_cb; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 77 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 78 | #endif |