• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 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 <cstdint>
28 
29 #include "bta/include/bta_hh_api.h"
30 #include "types/raw_address.h"
31 
32 typedef struct {
33   uint16_t rpt_uuid;
34   uint8_t rpt_id;
35   tBTA_HH_RPT_TYPE rpt_type;
36   uint8_t srvc_inst_id;
37   uint16_t char_inst_id;
38 } tBTA_HH_RPT_CACHE_ENTRY;
39 
40 /*******************************************************************************
41  *
42  * Function         bta_hh_co_data
43  *
44  * Description      This callout function is executed by HH when data is
45  *                  received
46  *                  in interupt channel.
47  *
48  *
49  * Returns          void.
50  *
51  ******************************************************************************/
52 extern void bta_hh_co_data(uint8_t dev_handle, uint8_t* p_rpt, uint16_t len,
53                            tBTA_HH_PROTO_MODE mode, uint8_t sub_class,
54                            uint8_t ctry_code, const RawAddress& peer_addr,
55                            uint8_t app_id);
56 
57 /*******************************************************************************
58  *
59  * Function         bta_hh_co_open
60  *
61  * Description      This callout function is executed by HH when connection is
62  *                  opened, and application may do some device specific
63  *                  initialization.
64  *
65  * Returns          void.
66  *
67  ******************************************************************************/
68 extern void bta_hh_co_open(uint8_t dev_handle, uint8_t sub_class,
69                            uint16_t attr_mask, uint8_t app_id);
70 
71 /*******************************************************************************
72  *
73  * Function         bta_hh_co_close
74  *
75  * Description      This callout function is executed by HH when connection is
76  *                  closed, and device specific finalizatio nmay be needed.
77  *
78  * Returns          void.
79  *
80  ******************************************************************************/
81 extern void bta_hh_co_close(uint8_t dev_handle, uint8_t app_id);
82 
83 /*******************************************************************************
84  *
85  * Function         bta_hh_co_set_rpt_rsp
86  *
87  * Description      This callout function is executed by HH when Set Report
88  *                  Response is received on Control Channel.
89  *
90  * Returns          void.
91  *
92  ******************************************************************************/
93 extern void bta_hh_co_set_rpt_rsp(uint8_t dev_handle, uint8_t status);
94 
95 /*******************************************************************************
96  *
97  * Function         bta_hh_co_get_rpt_rsp
98  *
99  * Description      This callout function is executed by HH when Get Report
100  *                  Response is received on Control Channel.
101  *
102  * Returns          void.
103  *
104  ******************************************************************************/
105 extern void bta_hh_co_get_rpt_rsp(uint8_t dev_handle, uint8_t status,
106                                   uint8_t* p_rpt, uint16_t len);
107 
108 /*******************************************************************************
109  *
110  * Function         bta_hh_le_co_rpt_info
111  *
112  * Description      This callout function is to convey the report information on
113  *                  a HOGP device to the application. Application can save this
114  *                  information in NV if device is bonded and load it back when
115  *                  stack reboot.
116  *
117  * Parameters       remote_bda  - remote device address
118  *                  p_entry     - report entry pointer
119  *                  app_id      - application id
120  *
121  * Returns          void.
122  *
123  ******************************************************************************/
124 extern void bta_hh_le_co_rpt_info(const RawAddress& remote_bda,
125                                   tBTA_HH_RPT_CACHE_ENTRY* p_entry,
126                                   uint8_t app_id);
127 
128 /*******************************************************************************
129  *
130  * Function         bta_hh_le_co_cache_load
131  *
132  * Description      This callout function is to request the application to load
133  *                  the cached HOGP report if there is any. When cache reading
134  *                  is completed, bta_hh_le_ci_cache_load() is called by the
135  *                  application.
136  *
137  * Parameters       remote_bda  - remote device address
138  *                  p_num_rpt: number of cached report
139  *                  app_id      - application id
140  *
141  * Returns          the acched report array
142  *
143  ******************************************************************************/
144 extern tBTA_HH_RPT_CACHE_ENTRY* bta_hh_le_co_cache_load(
145     const RawAddress& remote_bda, uint8_t* p_num_rpt, uint8_t app_id);
146 
147 /*******************************************************************************
148  *
149  * Function         bta_hh_le_co_reset_rpt_cache
150  *
151  * Description      This callout function is to reset the HOGP device cache.
152  *
153  * Parameters       remote_bda  - remote device address
154  *
155  * Returns          none
156  *
157  ******************************************************************************/
158 extern void bta_hh_le_co_reset_rpt_cache(const RawAddress& remote_bda,
159                                          uint8_t app_id);
160 
161 #endif /* BTA_HH_CO_H */
162