• 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 #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,
80                      bluetooth::hci::CommandStatusView view)>
81       body{[](command_status_cb /* status_callback */, void* /* context */,
82               std::unique_ptr<OsiObject> /* command */,
83               bluetooth::hci::CommandStatusView /* view */) {}};
operatorOnTransmitPacketStatus84   void operator()(command_status_cb status_callback, void* context,
85                   std::unique_ptr<OsiObject> command,
86                   bluetooth::hci::CommandStatusView view) {
87     body(status_callback, context, std::move(command), view);
88   };
89 };
90 extern struct OnTransmitPacketStatus OnTransmitPacketStatus;
91 
92 // Name: hci_layer_get_interface
93 // Params:
94 // Return: const hci_t*
95 struct hci_layer_get_interface {
96   static const hci_t* return_value;
97   std::function<const hci_t*()> body{[]() { return return_value; }};
operatorhci_layer_get_interface98   const hci_t* operator()() { return body(); };
99 };
100 extern struct hci_layer_get_interface hci_layer_get_interface;
101 
102 // Name: hci_on_reset_complete
103 // Params:
104 // Return: void
105 struct hci_on_reset_complete {
106   std::function<void()> body{[]() {}};
operatorhci_on_reset_complete107   void operator()() { body(); };
108 };
109 extern struct hci_on_reset_complete hci_on_reset_complete;
110 
111 // Name: hci_on_shutting_down
112 // Params:
113 // Return: void
114 struct hci_on_shutting_down {
115   std::function<void()> body{[]() {}};
operatorhci_on_shutting_down116   void operator()() { body(); };
117 };
118 extern struct hci_on_shutting_down hci_on_shutting_down;
119 
120 }  // namespace main_shim_hci_layer
121 }  // namespace mock
122 }  // namespace test
123 
124 // END mockcify generation
125