• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Generated mock file from original source file
19  *   Functions generated:10
20  *
21  *  mockcify.pl ver 0.3.0
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 
27 // Original included files, if any
28 #include "bta/hh/bta_hh_int.h"
29 #include "types/raw_address.h"
30 
31 // Mocked compile conditionals, if any
32 
33 namespace test {
34 namespace mock {
35 namespace bta_hh_utils {
36 
37 // Shared state between mocked functions and tests
38 // Name: bta_hh_add_device_to_list
39 // Params: tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask, const
40 // tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class, uint16_t ssr_max_latency,
41 // uint16_t ssr_min_tout, uint8_t app_id Return: void
42 struct bta_hh_add_device_to_list {
43   std::function<void(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
44                      const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
45                      uint16_t ssr_max_latency, uint16_t ssr_min_tout, uint8_t app_id)>
46           body{[](tBTA_HH_DEV_CB* /* p_cb */, uint8_t /* handle */, uint16_t /* attr_mask */,
47                   const tHID_DEV_DSCP_INFO* /* p_dscp_info */, uint8_t /* sub_class */,
48                   uint16_t /* ssr_max_latency */, uint16_t /* ssr_min_tout */,
49                   uint8_t /* app_id */) {}};
operatorbta_hh_add_device_to_list50   void operator()(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
51                   const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
52                   uint16_t ssr_max_latency, uint16_t ssr_min_tout, uint8_t app_id) {
53     body(p_cb, handle, attr_mask, p_dscp_info, sub_class, ssr_max_latency, ssr_min_tout, app_id);
54   }
55 };
56 extern struct bta_hh_add_device_to_list bta_hh_add_device_to_list;
57 
58 // Name: bta_hh_clean_up_kdev
59 // Params: tBTA_HH_DEV_CB* p_cb
60 // Return: void
61 struct bta_hh_clean_up_kdev {
62   std::function<void(tBTA_HH_DEV_CB* p_cb)> body{[](tBTA_HH_DEV_CB* /* p_cb */) {}};
operatorbta_hh_clean_up_kdev63   void operator()(tBTA_HH_DEV_CB* p_cb) { body(p_cb); }
64 };
65 extern struct bta_hh_clean_up_kdev bta_hh_clean_up_kdev;
66 
67 // Name: bta_hh_cleanup_disable
68 // Params: tBTA_HH_STATUS status
69 // Return: void
70 struct bta_hh_cleanup_disable {
71   std::function<void(tBTA_HH_STATUS status)> body{[](tBTA_HH_STATUS /* status */) {}};
operatorbta_hh_cleanup_disable72   void operator()(tBTA_HH_STATUS status) { body(status); }
73 };
74 extern struct bta_hh_cleanup_disable bta_hh_cleanup_disable;
75 
76 // Name: bta_hh_find_cb
77 // Params: const tAclLinkSpec& link_spec
78 // Return: uint8_t
79 struct bta_hh_find_cb {
80   tBTA_HH_DEV_CB* return_value{nullptr};
81   std::function<tBTA_HH_DEV_CB*(const tAclLinkSpec& link_spec)> body{
82           [this](const tAclLinkSpec& /* link_spec */) { return return_value; }};
operatorbta_hh_find_cb83   tBTA_HH_DEV_CB* operator()(const tAclLinkSpec& link_spec) { return body(link_spec); }
84 };
85 extern struct bta_hh_find_cb bta_hh_find_cb;
86 
87 // Name: bta_hh_get_cb
88 // Params: const tAclLinkSpec& link_spec
89 // Return: tBTA_HH_DEV_CB*
90 struct bta_hh_get_cb {
91   tBTA_HH_DEV_CB* return_value{0};
92   std::function<tBTA_HH_DEV_CB*(const tAclLinkSpec& link_spec)> body{
93           [this](const tAclLinkSpec& /* link_spec */) { return return_value; }};
operatorbta_hh_get_cb94   tBTA_HH_DEV_CB* operator()(const tAclLinkSpec& link_spec) { return body(link_spec); }
95 };
96 extern struct bta_hh_get_cb bta_hh_get_cb;
97 
98 // Name: bta_hh_read_ssr_param
99 // Params: const tAclLinkSpec& bd_addr, uint16_t* p_max_ssr_lat, uint16_t*
100 // p_min_ssr_tout Return: tBTA_HH_STATUS
101 struct bta_hh_read_ssr_param {
102   tBTA_HH_STATUS return_value{0};
103   std::function<tBTA_HH_STATUS(const tAclLinkSpec& link_spec, uint16_t* p_max_ssr_lat,
104                                uint16_t* p_min_ssr_tout)>
105           body{[this](const tAclLinkSpec& /* link_spec */, uint16_t* /* p_max_ssr_lat */,
106                       uint16_t* /* p_min_ssr_tout */) { return return_value; }};
operatorbta_hh_read_ssr_param107   tBTA_HH_STATUS operator()(const tAclLinkSpec& link_spec, uint16_t* p_max_ssr_lat,
108                             uint16_t* p_min_ssr_tout) {
109     return body(link_spec, p_max_ssr_lat, p_min_ssr_tout);
110   }
111 };
112 extern struct bta_hh_read_ssr_param bta_hh_read_ssr_param;
113 
114 // Name: bta_hh_tod_spt
115 // Params: tBTA_HH_DEV_CB* p_cb, uint8_t sub_class
116 // Return: bool
117 struct bta_hh_tod_spt {
118   bool return_value{false};
119   std::function<bool(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class)> body{
120           [this](tBTA_HH_DEV_CB* /* p_cb */, uint8_t /* sub_class */) { return return_value; }};
operatorbta_hh_tod_spt121   bool operator()(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) { return body(p_cb, sub_class); }
122 };
123 extern struct bta_hh_tod_spt bta_hh_tod_spt;
124 
125 // Name: bta_hh_trace_dev_db
126 // Params: void
127 // Return: void
128 struct bta_hh_trace_dev_db {
129   std::function<void(void)> body{[](void) {}};
operatorbta_hh_trace_dev_db130   void operator()(void) { body(); }
131 };
132 extern struct bta_hh_trace_dev_db bta_hh_trace_dev_db;
133 
134 // Name: bta_hh_update_di_info
135 // Params: tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
136 // uint16_t version, uint8_t flag Return: void
137 struct bta_hh_update_di_info {
138   std::function<void(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
139                      uint16_t version, uint8_t flag, uint8_t ctry_code)>
140           body{[](tBTA_HH_DEV_CB* /* p_cb */, uint16_t /* vendor_id */, uint16_t /* product_id */,
141                   uint16_t /* version */, uint8_t /* flag */, uint8_t /* ctry_code */) {}};
operatorbta_hh_update_di_info142   void operator()(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id, uint16_t version,
143                   uint8_t flag, uint8_t ctry_code) {
144     body(p_cb, vendor_id, product_id, version, flag, ctry_code);
145   }
146 };
147 extern struct bta_hh_update_di_info bta_hh_update_di_info;
148 
149 }  // namespace bta_hh_utils
150 }  // namespace mock
151 }  // namespace test
152 
153 // END mockcify generation
154