summaryrefslogtreecommitdiff
path: root/system/test/mock/mock_bta_hh_utils.h
blob: 000bc0c3a2a7d5764e36294e6c1bc82bce03490d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
 * Copyright 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Generated mock file from original source file
 *   Functions generated:10
 *
 *  mockcify.pl ver 0.3.0
 */

#include <cstdint>
#include <functional>
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
//       include files may not be required.  The include-what-you-use
//       still applies, but crafting proper inclusion is out of scope
//       for this effort.  This compilation unit may compile as-is, or
//       may need attention to prune from (or add to ) the inclusion set.
#include <string.h>

#include <cstring>

#include "bt_target.h"
#include "bta/hh/bta_hh_int.h"
#include "btif/include/btif_storage.h"
#include "osi/include/osi.h"
#include "stack/include/acl_api.h"
#include "stack/include/btm_client_interface.h"
#include "types/raw_address.h"

// Mocked compile conditionals, if any

namespace test {
namespace mock {
namespace bta_hh_utils {

// Shared state between mocked functions and tests
// Name: bta_hh_add_device_to_list
// Params: tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask, const
// tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class, uint16_t ssr_max_latency,
// uint16_t ssr_min_tout, uint8_t app_id Return: void
struct bta_hh_add_device_to_list {
  std::function<void(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
                     const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
                     uint16_t ssr_max_latency, uint16_t ssr_min_tout,
                     uint8_t app_id)>
      body{[](tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
              const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
              uint16_t ssr_max_latency, uint16_t ssr_min_tout,
              uint8_t app_id) {}};
  void operator()(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask,
                  const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class,
                  uint16_t ssr_max_latency, uint16_t ssr_min_tout,
                  uint8_t app_id) {
    body(p_cb, handle, attr_mask, p_dscp_info, sub_class, ssr_max_latency,
         ssr_min_tout, app_id);
  };
};
extern struct bta_hh_add_device_to_list bta_hh_add_device_to_list;

// Name: bta_hh_clean_up_kdev
// Params: tBTA_HH_DEV_CB* p_cb
// Return: void
struct bta_hh_clean_up_kdev {
  std::function<void(tBTA_HH_DEV_CB* p_cb)> body{[](tBTA_HH_DEV_CB* p_cb) {}};
  void operator()(tBTA_HH_DEV_CB* p_cb) { body(p_cb); };
};
extern struct bta_hh_clean_up_kdev bta_hh_clean_up_kdev;

// Name: bta_hh_cleanup_disable
// Params: tBTA_HH_STATUS status
// Return: void
struct bta_hh_cleanup_disable {
  std::function<void(tBTA_HH_STATUS status)> body{[](tBTA_HH_STATUS status) {}};
  void operator()(tBTA_HH_STATUS status) { body(status); };
};
extern struct bta_hh_cleanup_disable bta_hh_cleanup_disable;

// Name: bta_hh_dev_handle_to_cb_idx
// Params: uint8_t dev_handle
// Return: uint8_t
struct bta_hh_dev_handle_to_cb_idx {
  uint8_t return_value{0};
  std::function<uint8_t(uint8_t dev_handle)> body{
      [this](uint8_t dev_handle) { return return_value; }};
  uint8_t operator()(uint8_t dev_handle) { return body(dev_handle); };
};
extern struct bta_hh_dev_handle_to_cb_idx bta_hh_dev_handle_to_cb_idx;

// Name: bta_hh_find_cb
// Params: const RawAddress& bda
// Return: uint8_t
struct bta_hh_find_cb {
  uint8_t return_value{0};
  std::function<uint8_t(const RawAddress& bda)> body{
      [this](const RawAddress& bda) { return return_value; }};
  uint8_t operator()(const RawAddress& bda) { return body(bda); };
};
extern struct bta_hh_find_cb bta_hh_find_cb;

// Name: bta_hh_get_cb
// Params: const RawAddress& bda
// Return: tBTA_HH_DEV_CB*
struct bta_hh_get_cb {
  tBTA_HH_DEV_CB* return_value{0};
  std::function<tBTA_HH_DEV_CB*(const RawAddress& bda)> body{
      [this](const RawAddress& bda) { return return_value; }};
  tBTA_HH_DEV_CB* operator()(const RawAddress& bda) { return body(bda); };
};
extern struct bta_hh_get_cb bta_hh_get_cb;

// Name: bta_hh_read_ssr_param
// Params: const RawAddress& bd_addr, uint16_t* p_max_ssr_lat, uint16_t*
// p_min_ssr_tout Return: tBTA_HH_STATUS
struct bta_hh_read_ssr_param {
  tBTA_HH_STATUS return_value{0};
  std::function<tBTA_HH_STATUS(const RawAddress& bd_addr,
                               uint16_t* p_max_ssr_lat,
                               uint16_t* p_min_ssr_tout)>
      body{[this](const RawAddress& bd_addr, uint16_t* p_max_ssr_lat,
                  uint16_t* p_min_ssr_tout) { return return_value; }};
  tBTA_HH_STATUS operator()(const RawAddress& bd_addr, uint16_t* p_max_ssr_lat,
                            uint16_t* p_min_ssr_tout) {
    return body(bd_addr, p_max_ssr_lat, p_min_ssr_tout);
  };
};
extern struct bta_hh_read_ssr_param bta_hh_read_ssr_param;

// Name: bta_hh_tod_spt
// Params: tBTA_HH_DEV_CB* p_cb, uint8_t sub_class
// Return: bool
struct bta_hh_tod_spt {
  bool return_value{false};
  std::function<bool(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class)> body{
      [this](tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) { return return_value; }};
  bool operator()(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) {
    return body(p_cb, sub_class);
  };
};
extern struct bta_hh_tod_spt bta_hh_tod_spt;

// Name: bta_hh_trace_dev_db
// Params: void
// Return: void
struct bta_hh_trace_dev_db {
  std::function<void(void)> body{[](void) {}};
  void operator()(void) { body(); };
};
extern struct bta_hh_trace_dev_db bta_hh_trace_dev_db;

// Name: bta_hh_update_di_info
// Params: tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
// uint16_t version, uint8_t flag Return: void
struct bta_hh_update_di_info {
  std::function<void(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id,
                     uint16_t product_id, uint16_t version, uint8_t flag)>
      body{[](tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
              uint16_t version, uint8_t flag) {}};
  void operator()(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id,
                  uint16_t version, uint8_t flag) {
    body(p_cb, vendor_id, product_id, version, flag);
  };
};
extern struct bta_hh_update_di_info bta_hh_update_di_info;

}  // namespace bta_hh_utils
}  // namespace mock
}  // namespace test

// END mockcify generation