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