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:5
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <map>
25 #include <string>
26 
27 extern std::map<std::string, int> mock_function_count_map;
28 
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 //       include files may not be required.  The include-what-you-use
32 //       still applies, but crafting proper inclusion is out of scope
33 //       for this effort.  This compilation unit may compile as-is, or
34 //       may need attention to prune the inclusion set.
35 #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
36 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
37 #include "common/metrics.h"
38 #include "main/shim/metrics_api.h"
39 #include "main/shim/shim.h"
40 #include "stack/include/stack_metrics_logging.h"
41 #include "types/raw_address.h"
42 
43 // Mocked compile conditionals, if any
44 #ifndef UNUSED_ATTR
45 #define UNUSED_ATTR
46 #endif
47 
48 namespace test {
49 namespace mock {
50 namespace stack_metrics_logging {
51 
52 // Shared state between mocked functions and tests
53 // Name: log_classic_pairing_event
54 // Params: const RawAddress& address, uint16_t handle, uint32_t hci_cmd,
55 // uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, int64_t
56 // event_value Returns: void
57 struct log_classic_pairing_event {
58   std::function<void(const RawAddress& address, uint16_t handle,
59                      uint32_t hci_cmd, uint16_t hci_event, uint16_t cmd_status,
60                      uint16_t reason_code, int64_t event_value)>
61       body{[](const RawAddress& address, uint16_t handle, uint32_t hci_cmd,
62               uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code,
63               int64_t event_value) {}};
operatorlog_classic_pairing_event64   void operator()(const RawAddress& address, uint16_t handle, uint32_t hci_cmd,
65                   uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code,
66                   int64_t event_value) {
67     body(address, handle, hci_cmd, hci_event, cmd_status, reason_code,
68          event_value);
69   };
70 };
71 extern struct log_classic_pairing_event log_classic_pairing_event;
72 // Name: log_link_layer_connection_event
73 // Params:  const RawAddress* address, uint32_t connection_handle,
74 // android::bluetooth::DirectionEnum direction, uint16_t link_type, uint32_t
75 // hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, uint16_t cmd_status,
76 // uint16_t reason_code Returns: void
77 struct log_link_layer_connection_event {
78   std::function<void(const RawAddress* address, uint32_t connection_handle,
79                      android::bluetooth::DirectionEnum direction,
80                      uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event,
81                      uint16_t hci_ble_event, uint16_t cmd_status,
82                      uint16_t reason_code)>
83       body{[](const RawAddress* address, uint32_t connection_handle,
84               android::bluetooth::DirectionEnum direction, uint16_t link_type,
85               uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
86               uint16_t cmd_status, uint16_t reason_code) {}};
operatorlog_link_layer_connection_event87   void operator()(const RawAddress* address, uint32_t connection_handle,
88                   android::bluetooth::DirectionEnum direction,
89                   uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event,
90                   uint16_t hci_ble_event, uint16_t cmd_status,
91                   uint16_t reason_code) {
92     body(address, connection_handle, direction, link_type, hci_cmd, hci_event,
93          hci_ble_event, cmd_status, reason_code);
94   };
95 };
96 extern struct log_link_layer_connection_event log_link_layer_connection_event;
97 // Name: log_smp_pairing_event
98 // Params: const RawAddress& address, uint8_t smp_cmd,
99 // android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason Returns:
100 // void
101 struct log_smp_pairing_event {
102   std::function<void(const RawAddress& address, uint8_t smp_cmd,
103                      android::bluetooth::DirectionEnum direction,
104                      uint8_t smp_fail_reason)>
105       body{[](const RawAddress& address, uint8_t smp_cmd,
106               android::bluetooth::DirectionEnum direction,
107               uint8_t smp_fail_reason) {}};
operatorlog_smp_pairing_event108   void operator()(const RawAddress& address, uint8_t smp_cmd,
109                   android::bluetooth::DirectionEnum direction,
110                   uint8_t smp_fail_reason) {
111     body(address, smp_cmd, direction, smp_fail_reason);
112   };
113 };
114 extern struct log_smp_pairing_event log_smp_pairing_event;
115 // Name: log_sdp_attribute
116 // Params: const RawAddress& address, uint16_t protocol_uuid, uint16_t
117 // attribute_id, size_t attribute_size, const char* attribute_value Returns:
118 // void
119 struct log_sdp_attribute {
120   std::function<void(const RawAddress& address, uint16_t protocol_uuid,
121                      uint16_t attribute_id, size_t attribute_size,
122                      const char* attribute_value)>
123       body{[](const RawAddress& address, uint16_t protocol_uuid,
124               uint16_t attribute_id, size_t attribute_size,
125               const char* attribute_value) {}};
operatorlog_sdp_attribute126   void operator()(const RawAddress& address, uint16_t protocol_uuid,
127                   uint16_t attribute_id, size_t attribute_size,
128                   const char* attribute_value) {
129     body(address, protocol_uuid, attribute_id, attribute_size, attribute_value);
130   };
131 };
132 extern struct log_sdp_attribute log_sdp_attribute;
133 // Name: log_manufacturer_info
134 // Params: const RawAddress& address, android::bluetooth::DeviceInfoSrcEnum
135 // source_type, const std::string& source_name, const std::string& manufacturer,
136 // const std::string& model, const std::string& hardware_version, const
137 // std::string& software_version Returns: void
138 struct log_manufacturer_info {
139   std::function<void(const RawAddress& address,
140                      android::bluetooth::DeviceInfoSrcEnum source_type,
141                      const std::string& source_name,
142                      const std::string& manufacturer, const std::string& model,
143                      const std::string& hardware_version,
144                      const std::string& software_version)>
145       body{[](const RawAddress& address,
146               android::bluetooth::DeviceInfoSrcEnum source_type,
147               const std::string& source_name, const std::string& manufacturer,
148               const std::string& model, const std::string& hardware_version,
149               const std::string& software_version) {}};
operatorlog_manufacturer_info150   void operator()(const RawAddress& address,
151                   android::bluetooth::DeviceInfoSrcEnum source_type,
152                   const std::string& source_name,
153                   const std::string& manufacturer, const std::string& model,
154                   const std::string& hardware_version,
155                   const std::string& software_version) {
156     body(address, source_type, source_name, manufacturer, model,
157          hardware_version, software_version);
158   };
159 };
160 extern struct log_manufacturer_info log_manufacturer_info;
161 
162 }  // namespace stack_metrics_logging
163 }  // namespace mock
164 }  // namespace test
165 
166 // END mockcify generation