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 #pragma once
18 
19 /*
20  * Generated mock file from original source file
21  *   Functions generated:5
22  *
23  *  mockcify.pl ver 0.7.0
24  */
25 
26 #include <functional>
27 
28 #include "hci/include/hci_layer.h"
29 
30 // Original included files, if any
31 // NOTE: Since this is a mock file with mock definitions some number of
32 //       include files may not be required.  The include-what-you-use
33 //       still applies, but crafting proper inclusion is out of scope
34 //       for this effort.  This compilation unit may compile as-is, or
35 //       may need attention to prune from (or add to ) the inclusion set.
36 #include <base/functional/bind.h>
37 
38 #include "hci/hci_packets.h"
39 #include "osi/include/allocator.h"
40 
41 // Original usings
42 using CommandCallbackData = struct {
43   void* context;
44 };
45 // Mocked compile conditionals, if any
46 
47 namespace bluetooth::shim {
48 namespace testing {
49 extern void hci_layer_set_interface(const hci_t* interface);
50 }  // namespace testing
51 }  // namespace bluetooth::shim
52 
53 namespace test {
54 namespace mock {
55 namespace main_shim_hci_layer {
56 
57 // Shared state between mocked functions and tests
58 // Name: OnTransmitPacketCommandComplete
59 // Params: command_complete_cb complete_callback, void* context,
60 // bluetooth::hci::CommandCompleteView view Return: void
61 struct OnTransmitPacketCommandComplete {
62   std::function<void(command_complete_cb complete_callback, void* context,
63                      bluetooth::hci::CommandCompleteView view)>
64           body{[](command_complete_cb /* complete_callback */, void* /* context */,
65                   bluetooth::hci::CommandCompleteView /* view */) {}};
operatorOnTransmitPacketCommandComplete66   void operator()(command_complete_cb complete_callback, void* context,
67                   bluetooth::hci::CommandCompleteView view) {
68     body(complete_callback, context, view);
69   }
70 };
71 extern struct OnTransmitPacketCommandComplete OnTransmitPacketCommandComplete;
72 
73 // Name: OnTransmitPacketStatus
74 // Params: command_status_cb status_callback, void* context,
75 // std::unique_ptr<OsiObject> command, bluetooth::hci::CommandStatusView view
76 // Return: void
77 struct OnTransmitPacketStatus {
78   std::function<void(command_status_cb status_callback, void* context,
79                      std::unique_ptr<OsiObject> command, bluetooth::hci::CommandStatusView view)>
80           body{[](command_status_cb /* status_callback */, void* /* context */,
81                   std::unique_ptr<OsiObject> /* command */,
82                   bluetooth::hci::CommandStatusView /* view */) {}};
operatorOnTransmitPacketStatus83   void operator()(command_status_cb status_callback, void* context,
84                   std::unique_ptr<OsiObject> command, bluetooth::hci::CommandStatusView view) {
85     body(status_callback, context, std::move(command), view);
86   }
87 };
88 extern struct OnTransmitPacketStatus OnTransmitPacketStatus;
89 
90 // Name: hci_layer_get_interface
91 // Params:
92 // Return: const hci_t*
93 struct hci_layer_get_interface {
94   static const hci_t* return_value;
95   std::function<const hci_t*()> body{[]() { return return_value; }};
operatorhci_layer_get_interface96   const hci_t* operator()() { return body(); }
97 };
98 extern struct hci_layer_get_interface hci_layer_get_interface;
99 
100 // Name: hci_on_reset_complete
101 // Params:
102 // Return: void
103 struct hci_on_reset_complete {
104   std::function<void()> body{[]() {}};
operatorhci_on_reset_complete105   void operator()() { body(); }
106 };
107 extern struct hci_on_reset_complete hci_on_reset_complete;
108 
109 // Name: hci_on_shutting_down
110 // Params:
111 // Return: void
112 struct hci_on_shutting_down {
113   std::function<void()> body{[]() {}};
operatorhci_on_shutting_down114   void operator()() { body(); }
115 };
116 extern struct hci_on_shutting_down hci_on_shutting_down;
117 
118 }  // namespace main_shim_hci_layer
119 }  // namespace mock
120 }  // namespace test
121 
122 // END mockcify generation
123