1 /******************************************************************************
2  *
3  *  Copyright (C) 2005-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 is the interface file for hid host call-out functions.
22  *
23  ******************************************************************************/
24 #ifndef BTA_HH_CO_H
25 #define BTA_HH_CO_H
26 
27 #include "bta/bta_hh_api.h"
28 
29 typedef struct {
30     UINT16              rpt_uuid;
31     UINT8               rpt_id;
32     tBTA_HH_RPT_TYPE    rpt_type;
33     UINT8               inst_id;
34     UINT8               prop;
35 } tBTA_HH_RPT_CACHE_ENTRY;
36 
37 /*******************************************************************************
38 **
39 ** Function         bta_hh_co_data
40 **
41 ** Description      This callout function is executed by HH when data is received
42 **                  in interupt channel.
43 **
44 **
45 ** Returns          void.
46 **
47 *******************************************************************************/
48 extern void bta_hh_co_data(UINT8 dev_handle, UINT8 *p_rpt, UINT16 len,
49                            tBTA_HH_PROTO_MODE  mode, UINT8 sub_class,
50                            UINT8 ctry_code, BD_ADDR peer_addr, UINT8 app_id);
51 
52 /*******************************************************************************
53 **
54 ** Function         bta_hh_co_open
55 **
56 ** Description      This callout function is executed by HH when connection is
57 **                  opened, and application may do some device specific
58 **                  initialization.
59 **
60 ** Returns          void.
61 **
62 *******************************************************************************/
63 extern void bta_hh_co_open(UINT8 dev_handle, UINT8 sub_class,
64                            UINT16 attr_mask, UINT8 app_id);
65 
66 /*******************************************************************************
67 **
68 ** Function         bta_hh_co_close
69 **
70 ** Description      This callout function is executed by HH when connection is
71 **                  closed, and device specific finalizatio nmay be needed.
72 **
73 ** Returns          void.
74 **
75 *******************************************************************************/
76 extern void bta_hh_co_close(UINT8 dev_handle, UINT8 app_id);
77 
78 #if (BLE_INCLUDED == TRUE && BTA_HH_LE_INCLUDED == TRUE)
79 /*******************************************************************************
80 **
81 ** Function         bta_hh_le_co_rpt_info
82 **
83 ** Description      This callout function is to convey the report information on
84 **                  a HOGP device to the application. Application can save this
85 **                  information in NV if device is bonded and load it back when
86 **                  stack reboot.
87 **
88 ** Parameters       remote_bda  - remote device address
89 **                  p_entry     - report entry pointer
90 **                  app_id      - application id
91 **
92 ** Returns          void.
93 **
94 *******************************************************************************/
95 extern void bta_hh_le_co_rpt_info(BD_ADDR remote_bda,
96                                   tBTA_HH_RPT_CACHE_ENTRY *p_entry,
97                                   UINT8 app_id);
98 
99 /*******************************************************************************
100 **
101 ** Function         bta_hh_le_co_cache_load
102 **
103 ** Description      This callout function is to request the application to load the
104 **                  cached HOGP report if there is any. When cache reading is completed,
105 **                  bta_hh_le_ci_cache_load() is called by the application.
106 **
107 ** Parameters       remote_bda  - remote device address
108 **                  p_num_rpt: number of cached report
109 **                  app_id      - application id
110 **
111 ** Returns          the acched report array
112 **
113 *******************************************************************************/
114 extern tBTA_HH_RPT_CACHE_ENTRY *bta_hh_le_co_cache_load (BD_ADDR remote_bda,
115         UINT8 *p_num_rpt,
116         UINT8 app_id);
117 
118 /*******************************************************************************
119 **
120 ** Function         bta_hh_le_co_reset_rpt_cache
121 **
122 ** Description      This callout function is to reset the HOGP device cache.
123 **
124 ** Parameters       remote_bda  - remote device address
125 **
126 ** Returns          none
127 **
128 *******************************************************************************/
129 extern void bta_hh_le_co_reset_rpt_cache (BD_ADDR remote_bda, UINT8 app_id);
130 
131 #endif /* #if (BLE_INCLUDED == TRUE && BTA_HH_LE_INCLUDED == TRUE) */
132 #endif /* BTA_HH_CO_H */
133