summaryrefslogtreecommitdiff
path: root/system/test/mock/mock_stack_l2cap_ble.cc
blob: ada82b9367fe9a216dbe76e5ef35223e3ff8179e (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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
 * 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:22
 *
 *  mockcify.pl ver 0.2
 */

#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 the inclusion set.

// Mock include file to share data between tests and mock
#include "test/mock/mock_stack_l2cap_ble.h"
#include "types/raw_address.h"

// Mocked compile conditionals, if any
#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

// Mocked internal structures, if any

namespace test {
namespace mock {
namespace stack_l2cap_ble {

// Function state capture and return values, if needed
struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
struct L2CA_EnableUpdateBleConnParams L2CA_EnableUpdateBleConnParams;
struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
struct l2cble_notify_le_connection l2cble_notify_le_connection;
struct l2cble_conn_comp l2cble_conn_comp;
struct l2cble_conn_comp_from_address_with_type
    l2cble_conn_comp_from_address_with_type;
struct l2cble_process_conn_update_evt l2cble_process_conn_update_evt;
struct l2cble_process_sig_cmd l2cble_process_sig_cmd;
struct l2cble_create_conn l2cble_create_conn;
struct l2c_link_processs_ble_num_bufs l2c_link_processs_ble_num_bufs;
struct l2c_ble_link_adjust_allocation l2c_ble_link_adjust_allocation;
struct l2cble_process_rc_param_request_evt l2cble_process_rc_param_request_evt;
struct l2cble_update_data_length l2cble_update_data_length;
struct l2cble_process_data_length_change_event
    l2cble_process_data_length_change_event;
struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req;
struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res;
struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit;
struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req;
struct l2cble_sec_comp l2cble_sec_comp;
struct l2ble_sec_access_req l2ble_sec_access_req;
struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals;
struct l2cble_use_preferred_conn_params l2cble_use_preferred_conn_params;

}  // namespace stack_l2cap_ble
}  // namespace mock
}  // namespace test

// Mocked functions, if any
bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda, uint16_t min_int,
                              uint16_t max_int, uint16_t latency,
                              uint16_t timeout, uint16_t min_ce_len,
                              uint16_t max_ce_len) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::L2CA_UpdateBleConnParams(
      rem_bda, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
}
bool L2CA_EnableUpdateBleConnParams(const RawAddress& rem_bda, bool enable) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::L2CA_EnableUpdateBleConnParams(rem_bda,
                                                                     enable);
}
hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::L2CA_GetBleConnRole(bd_addr);
}
void l2cble_notify_le_connection(const RawAddress& bda) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_notify_le_connection(bda);
}
bool l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
                      tBLE_ADDR_TYPE type, uint16_t conn_interval,
                      uint16_t conn_latency, uint16_t conn_timeout) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::l2cble_conn_comp(
      handle, role, bda, type, conn_interval, conn_latency, conn_timeout);
}
bool l2cble_conn_comp_from_address_with_type(
    uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type,
    uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::l2cble_conn_comp_from_address_with_type(
      handle, role, address_with_type, conn_interval, conn_latency,
      conn_timeout);
}
void l2cble_process_conn_update_evt(uint16_t handle, uint8_t status,
                                    uint16_t interval, uint16_t latency,
                                    uint16_t timeout) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_process_conn_update_evt(
      handle, status, interval, latency, timeout);
}
void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_process_sig_cmd(p_lcb, p, pkt_len);
}
bool l2cble_create_conn(tL2C_LCB* p_lcb) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::l2cble_create_conn(p_lcb);
}
void l2c_link_processs_ble_num_bufs(uint16_t num_lm_ble_bufs) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2c_link_processs_ble_num_bufs(num_lm_ble_bufs);
}
void l2c_ble_link_adjust_allocation(void) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2c_ble_link_adjust_allocation();
}
void l2cble_process_rc_param_request_evt(uint16_t handle, uint16_t int_min,
                                         uint16_t int_max, uint16_t latency,
                                         uint16_t timeout) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_process_rc_param_request_evt(
      handle, int_min, int_max, latency, timeout);
}
void l2cble_update_data_length(tL2C_LCB* p_lcb) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_update_data_length(p_lcb);
}
void l2cble_process_data_length_change_event(uint16_t handle,
                                             uint16_t tx_data_len,
                                             uint16_t rx_data_len) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_process_data_length_change_event(
      handle, tx_data_len, rx_data_len);
}
void l2cble_credit_based_conn_req(tL2C_CCB* p_ccb) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_credit_based_conn_req(p_ccb);
}
void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, uint16_t result) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_credit_based_conn_res(p_ccb, result);
}
void l2cble_send_flow_control_credit(tL2C_CCB* p_ccb, uint16_t credit_value) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_send_flow_control_credit(p_ccb,
                                                               credit_value);
}
void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_send_peer_disc_req(p_ccb);
}
void l2cble_sec_comp(const RawAddress* bda, tBT_TRANSPORT transport,
                     void* p_ref_data, tBTM_STATUS status) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_sec_comp(bda, transport, p_ref_data,
                                               status);
}
tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr,
                                           uint16_t psm, bool is_originator,
                                           tL2CAP_SEC_CBACK* p_callback,
                                           void* p_ref_data) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_l2cap_ble::l2ble_sec_access_req(
      bd_addr, psm, is_originator, p_callback, p_ref_data);
}
void L2CA_AdjustConnectionIntervals(uint16_t* min_interval,
                                    uint16_t* max_interval,
                                    uint16_t floor_interval) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::L2CA_AdjustConnectionIntervals(
      min_interval, max_interval, floor_interval);
}
void l2cble_use_preferred_conn_params(const RawAddress& bda) {
  mock_function_count_map[__func__]++;
  test::mock::stack_l2cap_ble::l2cble_use_preferred_conn_params(bda);
}

// END mockcify generation