#include "bta/include/bta_ag_api.h" // tBTA_AG_RES_DATA::kEmpty
#include "hci/include/hci_layer.h" // hci_t
+#include "test/mock/mock_hci_layer.h"
std::map<std::string, int> mock_function_count_map;
.transmit_command_futured = transmit_command_futured,
.transmit_downward = transmit_downward,
};
-const hci_t* hci_layer_get_interface() { return &mock_hci; }
bool is_bluetooth_uid() { return false; }
const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {};
class StackCycleTest : public ::testing::Test {
protected:
- void SetUp() override { stack_manager_ = stack_manager_get_interface(); }
+ void SetUp() override {
+ test::mock::hci_layer::hci_layer_get_interface.hci = &mock_hci;
+ stack_manager_ = stack_manager_get_interface();
+ }
void TearDown() override { stack_manager_ = nullptr; }
const stack_manager_t* stack_manager_{nullptr};
},
},
}
+
+cc_test {
+ name: "net_test_stack_btu",
+ test_suites: ["device-tests"],
+ host_supported: true,
+ defaults: ["fluoride_defaults"],
+ local_include_dirs: [
+ "include",
+ "test/common",
+ ],
+ include_dirs: [
+ "system/bt",
+ "system/bt/gd",
+ ],
+ generated_headers: [
+ "BluetoothGeneratedBundlerSchema_h_bfbs",
+ "BluetoothGeneratedDumpsysDataSchema_h",
+ "BluetoothGeneratedPackets_h",
+ ],
+ srcs: [
+ ":TestMockBta",
+ ":TestMockBtif",
+ ":TestMockHci",
+ ":TestMockLegacyHciCommands",
+ ":TestMockMainShim",
+ ":TestMockStackAcl",
+ ":TestMockStackSmp",
+ ":TestStackBtm",
+ ":TestStackL2cap",
+ ":TestMockStackMetrics",
+ "btu/btu_hcif.cc",
+ "btu/btu_task.cc",
+ "test/stack_btu_test.cc",
+ ],
+ static_libs: [
+ "libbt-common",
+ "libbt-protos-lite",
+ "libbtdevice",
+ "libgmock",
+ "liblog",
+ "libosi",
+ ],
+ shared_libs: [
+ "libcrypto",
+ "libprotobuf-cpp-lite",
+ "libflatbuffers-cpp",
+ ],
+ sanitize: {
+ address: true,
+ all_undefined: true,
+ cfi: true,
+ integer_overflow: true,
+ scs: true,
+ diag: {
+ undefined : true
+ },
+ },
+}
static void do_post_on_bt_main(BtMainClosure closure) { closure(); }
void post_on_bt_main(BtMainClosure closure) {
- ASSERT(do_in_main_thread(FROM_HERE,
- base::Bind(do_post_on_bt_main, std::move(closure))));
+ ASSERT(do_in_main_thread(
+ FROM_HERE, base::Bind(do_post_on_bt_main, std::move(closure))) ==
+ BT_STATUS_SUCCESS);
}
void main_thread_start_up() {
--- /dev/null
+/*
+ * 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.
+ */
+
+#include <gtest/gtest.h>
+#include <cstdint>
+#include <map>
+#include <string>
+
+#include "stack/include/btu.h"
+
+std::map<std::string, int> mock_function_count_map;
+
+void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}
+
+class StackBtuTest : public ::testing::Test {};
+
+TEST_F(StackBtuTest, post_on_main) {}
"mock/mock_stack_acl*.cc",
],
}
+
+filegroup {
+ name: "TestMockStackSmp",
+ srcs: [
+ "mock/mock_stack_smp*.cc",
+ ],
+}
+
+filegroup {
+ name: "TestMockStackMetrics",
+ srcs: [
+ "mock/mock_stack_metrics*.cc",
+ ],
+}
--- /dev/null
+/*
+ * 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:18
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_btif_config.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace btif_config {
+
+// Function state capture and return values, if needed
+struct btif_get_device_type btif_get_device_type;
+struct btif_get_address_type btif_get_address_type;
+struct btif_config_exist btif_config_exist;
+struct btif_config_get_int btif_config_get_int;
+struct btif_config_set_int btif_config_set_int;
+struct btif_config_get_uint64 btif_config_get_uint64;
+struct btif_config_set_uint64 btif_config_set_uint64;
+struct btif_config_get_str btif_config_get_str;
+struct btif_config_set_str btif_config_set_str;
+struct btif_config_get_bin btif_config_get_bin;
+struct btif_config_get_bin_length btif_config_get_bin_length;
+struct btif_config_set_bin btif_config_set_bin;
+struct btif_config_get_paired_devices btif_config_get_paired_devices;
+struct btif_config_remove btif_config_remove;
+struct btif_config_save btif_config_save;
+struct btif_config_flush btif_config_flush;
+struct btif_config_clear btif_config_clear;
+struct btif_debug_config_dump btif_debug_config_dump;
+
+} // namespace btif_config
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+bool btif_get_device_type(const RawAddress& bda, int* p_device_type) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_get_device_type(bda, p_device_type);
+}
+bool btif_get_address_type(const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_get_address_type(bda, p_addr_type);
+}
+bool btif_config_exist(const std::string& section, const std::string& key) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_exist(section, key);
+}
+bool btif_config_get_int(const std::string& section, const std::string& key,
+ int* value) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_get_int(section, key, value);
+}
+bool btif_config_set_int(const std::string& section, const std::string& key,
+ int value) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_set_int(section, key, value);
+}
+bool btif_config_get_uint64(const std::string& section, const std::string& key,
+ uint64_t* value) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_get_uint64(section, key, value);
+}
+bool btif_config_set_uint64(const std::string& section, const std::string& key,
+ uint64_t value) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_set_uint64(section, key, value);
+}
+bool btif_config_get_str(const std::string& section, const std::string& key,
+ char* value, int* size_bytes) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_get_str(section, key, value,
+ size_bytes);
+}
+bool btif_config_set_str(const std::string& section, const std::string& key,
+ const std::string& value) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_set_str(section, key, value);
+}
+bool btif_config_get_bin(const std::string& section, const std::string& key,
+ uint8_t* value, size_t* length) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_get_bin(section, key, value,
+ length);
+}
+size_t btif_config_get_bin_length(const std::string& section,
+ const std::string& key) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_get_bin_length(section, key);
+}
+bool btif_config_set_bin(const std::string& section, const std::string& key,
+ const uint8_t* value, size_t length) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_set_bin(section, key, value,
+ length);
+}
+std::vector<RawAddress> btif_config_get_paired_devices() {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_get_paired_devices();
+}
+bool btif_config_remove(const std::string& section, const std::string& key) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_remove(section, key);
+}
+void btif_config_save(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::btif_config::btif_config_save();
+}
+void btif_config_flush(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::btif_config::btif_config_flush();
+}
+bool btif_config_clear(void) {
+ mock_function_count_map[__func__]++;
+ return test::mock::btif_config::btif_config_clear();
+}
+void btif_debug_config_dump(int fd) {
+ mock_function_count_map[__func__]++;
+ test::mock::btif_config::btif_debug_config_dump(fd);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:18
+ *
+ * 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.
+
+#include "btif/include/btif_config.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace btif_config {
+
+// Shared state between mocked functions and tests
+// Name: btif_get_device_type
+// Params: const RawAddress& bda, int* p_device_type
+// Returns: bool
+struct btif_get_device_type {
+ std::function<bool(const RawAddress& bda, int* p_device_type)> body{
+ [](const RawAddress& bda, int* p_device_type) { return false; }};
+ bool operator()(const RawAddress& bda, int* p_device_type) {
+ return body(bda, p_device_type);
+ };
+};
+extern struct btif_get_device_type btif_get_device_type;
+// Name: btif_get_address_type
+// Params: const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type
+// Returns: bool
+struct btif_get_address_type {
+ std::function<bool(const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type)> body{
+ [](const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type) { return false; }};
+ bool operator()(const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type) {
+ return body(bda, p_addr_type);
+ };
+};
+extern struct btif_get_address_type btif_get_address_type;
+// Name: btif_config_exist
+// Params: const std::string& section, const std::string& key
+// Returns: bool
+struct btif_config_exist {
+ std::function<bool(const std::string& section, const std::string& key)> body{
+ [](const std::string& section, const std::string& key) { return false; }};
+ bool operator()(const std::string& section, const std::string& key) {
+ return body(section, key);
+ };
+};
+extern struct btif_config_exist btif_config_exist;
+// Name: btif_config_get_int
+// Params: const std::string& section, const std::string& key, int* value
+// Returns: bool
+struct btif_config_get_int {
+ std::function<bool(const std::string& section, const std::string& key,
+ int* value)>
+ body{[](const std::string& section, const std::string& key, int* value) {
+ return false;
+ }};
+ bool operator()(const std::string& section, const std::string& key,
+ int* value) {
+ return body(section, key, value);
+ };
+};
+extern struct btif_config_get_int btif_config_get_int;
+// Name: btif_config_set_int
+// Params: const std::string& section, const std::string& key, int value
+// Returns: bool
+struct btif_config_set_int {
+ std::function<bool(const std::string& section, const std::string& key,
+ int value)>
+ body{[](const std::string& section, const std::string& key, int value) {
+ return false;
+ }};
+ bool operator()(const std::string& section, const std::string& key,
+ int value) {
+ return body(section, key, value);
+ };
+};
+extern struct btif_config_set_int btif_config_set_int;
+// Name: btif_config_get_uint64
+// Params: const std::string& section, const std::string& key, uint64_t* value
+// Returns: bool
+struct btif_config_get_uint64 {
+ std::function<bool(const std::string& section, const std::string& key,
+ uint64_t* value)>
+ body{[](const std::string& section, const std::string& key,
+ uint64_t* value) { return false; }};
+ bool operator()(const std::string& section, const std::string& key,
+ uint64_t* value) {
+ return body(section, key, value);
+ };
+};
+extern struct btif_config_get_uint64 btif_config_get_uint64;
+// Name: btif_config_set_uint64
+// Params: const std::string& section, const std::string& key, uint64_t value
+// Returns: bool
+struct btif_config_set_uint64 {
+ std::function<bool(const std::string& section, const std::string& key,
+ uint64_t value)>
+ body{[](const std::string& section, const std::string& key,
+ uint64_t value) { return false; }};
+ bool operator()(const std::string& section, const std::string& key,
+ uint64_t value) {
+ return body(section, key, value);
+ };
+};
+extern struct btif_config_set_uint64 btif_config_set_uint64;
+// Name: btif_config_get_str
+// Params: const std::string& section, const std::string& key, char* value, int*
+// size_bytes Returns: bool
+struct btif_config_get_str {
+ std::function<bool(const std::string& section, const std::string& key,
+ char* value, int* size_bytes)>
+ body{[](const std::string& section, const std::string& key, char* value,
+ int* size_bytes) { return false; }};
+ bool operator()(const std::string& section, const std::string& key,
+ char* value, int* size_bytes) {
+ return body(section, key, value, size_bytes);
+ };
+};
+extern struct btif_config_get_str btif_config_get_str;
+// Name: btif_config_set_str
+// Params: const std::string& section, const std::string& key, const
+// std::string& value Returns: bool
+struct btif_config_set_str {
+ std::function<bool(const std::string& section, const std::string& key,
+ const std::string& value)>
+ body{[](const std::string& section, const std::string& key,
+ const std::string& value) { return false; }};
+ bool operator()(const std::string& section, const std::string& key,
+ const std::string& value) {
+ return body(section, key, value);
+ };
+};
+extern struct btif_config_set_str btif_config_set_str;
+// Name: btif_config_get_bin
+// Params: const std::string& section, const std::string& key, uint8_t* value,
+// size_t* length Returns: bool
+struct btif_config_get_bin {
+ std::function<bool(const std::string& section, const std::string& key,
+ uint8_t* value, size_t* length)>
+ body{[](const std::string& section, const std::string& key,
+ uint8_t* value, size_t* length) { return false; }};
+ bool operator()(const std::string& section, const std::string& key,
+ uint8_t* value, size_t* length) {
+ return body(section, key, value, length);
+ };
+};
+extern struct btif_config_get_bin btif_config_get_bin;
+// Name: btif_config_get_bin_length
+// Params: const std::string& section, const std::string& key
+// Returns: size_t
+struct btif_config_get_bin_length {
+ std::function<size_t(const std::string& section, const std::string& key)>
+ body{
+ [](const std::string& section, const std::string& key) { return 0; }};
+ size_t operator()(const std::string& section, const std::string& key) {
+ return body(section, key);
+ };
+};
+extern struct btif_config_get_bin_length btif_config_get_bin_length;
+// Name: btif_config_set_bin
+// Params: const std::string& section, const std::string& key, const uint8_t*
+// value, size_t length Returns: bool
+struct btif_config_set_bin {
+ std::function<bool(const std::string& section, const std::string& key,
+ const uint8_t* value, size_t length)>
+ body{[](const std::string& section, const std::string& key,
+ const uint8_t* value, size_t length) { return false; }};
+ bool operator()(const std::string& section, const std::string& key,
+ const uint8_t* value, size_t length) {
+ return body(section, key, value, length);
+ };
+};
+extern struct btif_config_set_bin btif_config_set_bin;
+// Name: btif_config_get_paired_devices
+// Params:
+// Returns: std::vector<RawAddress>
+struct btif_config_get_paired_devices {
+ std::vector<RawAddress> raw_addresses;
+ std::function<std::vector<RawAddress>()> body{
+ [this]() { return raw_addresses; }};
+ std::vector<RawAddress> operator()() { return body(); };
+};
+extern struct btif_config_get_paired_devices btif_config_get_paired_devices;
+// Name: btif_config_remove
+// Params: const std::string& section, const std::string& key
+// Returns: bool
+struct btif_config_remove {
+ std::function<bool(const std::string& section, const std::string& key)> body{
+ [](const std::string& section, const std::string& key) { return false; }};
+ bool operator()(const std::string& section, const std::string& key) {
+ return body(section, key);
+ };
+};
+extern struct btif_config_remove btif_config_remove;
+// Name: btif_config_save
+// Params: void
+// Returns: void
+struct btif_config_save {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct btif_config_save btif_config_save;
+// Name: btif_config_flush
+// Params: void
+// Returns: void
+struct btif_config_flush {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct btif_config_flush btif_config_flush;
+// Name: btif_config_clear
+// Params: void
+// Returns: bool
+struct btif_config_clear {
+ std::function<bool(void)> body{[](void) { return false; }};
+ bool operator()(void) { return body(); };
+};
+extern struct btif_config_clear btif_config_clear;
+// Name: btif_debug_config_dump
+// Params: int fd
+// Returns: void
+struct btif_debug_config_dump {
+ std::function<void(int fd)> body{[](int fd) {}};
+ void operator()(int fd) { body(fd); };
+};
+extern struct btif_debug_config_dump btif_debug_config_dump;
+
+} // namespace btif_config
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:13
+ *
+ * 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_hci_layer.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+typedef struct {
+} waiting_command_t;
+
+namespace test {
+namespace mock {
+namespace hci_layer {
+
+// Function state capture and return values, if needed
+struct initialization_complete initialization_complete;
+struct hci_event_received hci_event_received;
+struct acl_event_received acl_event_received;
+struct sco_data_received sco_data_received;
+struct iso_data_received iso_data_received;
+struct hal_service_died hal_service_died;
+struct process_command_credits process_command_credits;
+struct hci_is_root_inflammation_event_received
+ hci_is_root_inflammation_event_received;
+struct handle_root_inflammation_event handle_root_inflammation_event;
+struct hci_layer_cleanup_interface hci_layer_cleanup_interface;
+struct hci_layer_get_interface hci_layer_get_interface;
+struct hci_layer_get_test_interface hci_layer_get_test_interface;
+
+} // namespace hci_layer
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void initialization_complete() {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::initialization_complete();
+}
+void hci_event_received(const base::Location& from_here, BT_HDR* packet) {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::hci_event_received(from_here, packet);
+}
+void acl_event_received(BT_HDR* packet) {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::acl_event_received(packet);
+}
+void sco_data_received(BT_HDR* packet) {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::sco_data_received(packet);
+}
+void iso_data_received(BT_HDR* packet) {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::iso_data_received(packet);
+}
+void hal_service_died() {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::hal_service_died();
+}
+void process_command_credits(int credits) {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::process_command_credits(credits);
+}
+bool hci_is_root_inflammation_event_received() {
+ mock_function_count_map[__func__]++;
+ return test::mock::hci_layer::hci_is_root_inflammation_event_received();
+}
+void handle_root_inflammation_event() {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::handle_root_inflammation_event();
+}
+void hci_layer_cleanup_interface() {
+ mock_function_count_map[__func__]++;
+ test::mock::hci_layer::hci_layer_cleanup_interface();
+}
+const hci_t* hci_layer_get_interface() {
+ mock_function_count_map[__func__]++;
+ return test::mock::hci_layer::hci_layer_get_interface();
+}
+const hci_t* hci_layer_get_test_interface(
+ const allocator_t* buffer_allocator_interface,
+ const btsnoop_t* btsnoop_interface,
+ const packet_fragmenter_t* packet_fragmenter_interface) {
+ mock_function_count_map[__func__]++;
+ return test::mock::hci_layer::hci_layer_get_test_interface(
+ buffer_allocator_interface, btsnoop_interface,
+ packet_fragmenter_interface);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:13
+ *
+ * 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.
+
+#include "hci/include/hci_layer.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace hci_layer {
+
+// Shared state between mocked functions and tests
+// Name: initialization_complete
+// Params:
+// Returns: void
+struct initialization_complete {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct initialization_complete initialization_complete;
+// Name: hci_event_received
+// Params: const base::Location& from_here, BT_HDR* packet
+// Returns: void
+struct hci_event_received {
+ std::function<void(const base::Location& from_here, BT_HDR* packet)> body{
+ [](const base::Location& from_here, BT_HDR* packet) {}};
+ void operator()(const base::Location& from_here, BT_HDR* packet) {
+ body(from_here, packet);
+ };
+};
+extern struct hci_event_received hci_event_received;
+// Name: acl_event_received
+// Params: BT_HDR* packet
+// Returns: void
+struct acl_event_received {
+ std::function<void(BT_HDR* packet)> body{[](BT_HDR* packet) {}};
+ void operator()(BT_HDR* packet) { body(packet); };
+};
+extern struct acl_event_received acl_event_received;
+// Name: sco_data_received
+// Params: BT_HDR* packet
+// Returns: void
+struct sco_data_received {
+ std::function<void(BT_HDR* packet)> body{[](BT_HDR* packet) {}};
+ void operator()(BT_HDR* packet) { body(packet); };
+};
+extern struct sco_data_received sco_data_received;
+// Name: iso_data_received
+// Params: BT_HDR* packet
+// Returns: void
+struct iso_data_received {
+ std::function<void(BT_HDR* packet)> body{[](BT_HDR* packet) {}};
+ void operator()(BT_HDR* packet) { body(packet); };
+};
+extern struct iso_data_received iso_data_received;
+// Name: hal_service_died
+// Params:
+// Returns: void
+struct hal_service_died {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct hal_service_died hal_service_died;
+// Name: process_command_credits
+// Params: int credits
+// Returns: void
+struct process_command_credits {
+ std::function<void(int credits)> body{[](int credits) {}};
+ void operator()(int credits) { body(credits); };
+};
+extern struct process_command_credits process_command_credits;
+// Name: hci_is_root_inflammation_event_received
+// Params:
+// Returns: bool
+struct hci_is_root_inflammation_event_received {
+ std::function<bool()> body{[]() { return false; }};
+ bool operator()() { return body(); };
+};
+extern struct hci_is_root_inflammation_event_received
+ hci_is_root_inflammation_event_received;
+// Name: handle_root_inflammation_event
+// Params:
+// Returns: void
+struct handle_root_inflammation_event {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct handle_root_inflammation_event handle_root_inflammation_event;
+// Name: hci_layer_cleanup_interface
+// Params:
+// Returns: void
+struct hci_layer_cleanup_interface {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct hci_layer_cleanup_interface hci_layer_cleanup_interface;
+// Name: hci_layer_get_interface
+// Params:
+// Returns: const hci_t*
+struct hci_layer_get_interface {
+ hci_t* hci;
+ std::function<const hci_t*()> body{[this]() { return hci; }};
+ const hci_t* operator()() { return body(); };
+};
+extern struct hci_layer_get_interface hci_layer_get_interface;
+// Name: hci_layer_get_test_interface
+// Params: const allocator_t* buffer_allocator_interface, const btsnoop_t*
+// btsnoop_interface, const packet_fragmenter_t* packet_fragmenter_interface
+// Returns: const hci_t*
+struct hci_layer_get_test_interface {
+ std::function<const hci_t*(
+ const allocator_t* buffer_allocator_interface,
+ const btsnoop_t* btsnoop_interface,
+ const packet_fragmenter_t* packet_fragmenter_interface)>
+ body{[](const allocator_t* buffer_allocator_interface,
+ const btsnoop_t* btsnoop_interface,
+ const packet_fragmenter_t* packet_fragmenter_interface) {
+ return nullptr;
+ }};
+ const hci_t* operator()(
+ const allocator_t* buffer_allocator_interface,
+ const btsnoop_t* btsnoop_interface,
+ const packet_fragmenter_t* packet_fragmenter_interface) {
+ return body(buffer_allocator_interface, btsnoop_interface,
+ packet_fragmenter_interface);
+ };
+};
+extern struct hci_layer_get_test_interface hci_layer_get_test_interface;
+
+} // namespace hci_layer
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
extern std::map<std::string, int> mock_function_count_map;
-#include <base/logging.h>
-#include "bt_types.h"
-#include "buffer_allocator.h"
-#include "hci_internals.h"
-#include "hci_layer.h"
-#include "hci_packet_factory.h"
-#include "hcidefs.h"
-#include "hcimsgs.h"
-#include "osi/include/allocator.h"
+#include "hci/include/hci_packet_factory.h"
#ifndef UNUSED_ATTR
#define UNUSED_ATTR
--- /dev/null
+/*
+ * 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:6
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#include <cstdint>
+#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_acl_btm_ble_connection_establishment.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_acl_btm_ble_connection_establishment {
+
+// Function state capture and return values, if needed
+struct btm_send_hci_create_connection btm_send_hci_create_connection;
+struct btm_ble_create_ll_conn_complete btm_ble_create_ll_conn_complete;
+struct maybe_resolve_address maybe_resolve_address;
+struct btm_ble_conn_complete btm_ble_conn_complete;
+struct btm_ble_create_conn_cancel btm_ble_create_conn_cancel;
+struct btm_ble_create_conn_cancel_complete btm_ble_create_conn_cancel_complete;
+
+} // namespace stack_acl_btm_ble_connection_establishment
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void btm_send_hci_create_connection(
+ uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
+ uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t addr_type_own,
+ uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency,
+ uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len,
+ uint8_t initiating_phys) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_acl_btm_ble_connection_establishment::
+ btm_send_hci_create_connection(
+ scan_int, scan_win, init_filter_policy, addr_type_peer, bda_peer,
+ addr_type_own, conn_int_min, conn_int_max, conn_latency, conn_timeout,
+ min_ce_len, max_ce_len, initiating_phys);
+}
+void btm_ble_create_ll_conn_complete(tHCI_STATUS status) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_acl_btm_ble_connection_establishment::
+ btm_ble_create_ll_conn_complete(status);
+}
+bool maybe_resolve_address(RawAddress* bda, tBLE_ADDR_TYPE* bda_type) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_acl_btm_ble_connection_establishment::
+ maybe_resolve_address(bda, bda_type);
+}
+void btm_ble_conn_complete(uint8_t* p, uint16_t evt_len, bool enhanced) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_acl_btm_ble_connection_establishment::btm_ble_conn_complete(
+ p, evt_len, enhanced);
+}
+void btm_ble_create_conn_cancel() {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_acl_btm_ble_connection_establishment::
+ btm_ble_create_conn_cancel();
+}
+void btm_ble_create_conn_cancel_complete(uint8_t* p) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_acl_btm_ble_connection_establishment::
+ btm_ble_create_conn_cancel_complete(p);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:6
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#include <cstdint>
+#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.
+
+#include "stack/include/hci_error_code.h"
+#include "types/ble_address_with_type.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_acl_btm_ble_connection_establishment {
+
+// Shared state between mocked functions and tests
+// Name: btm_send_hci_create_connection
+// Params: uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
+// uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t addr_type_own,
+// uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency, uint16_t
+// conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len, uint8_t
+// initiating_phys Returns: void
+struct btm_send_hci_create_connection {
+ std::function<void(
+ uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
+ uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t addr_type_own,
+ uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency,
+ uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len,
+ uint8_t initiating_phys)>
+ body{[](uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
+ uint8_t addr_type_peer, const RawAddress& bda_peer,
+ uint8_t addr_type_own, uint16_t conn_int_min,
+ uint16_t conn_int_max, uint16_t conn_latency,
+ uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len,
+ uint8_t initiating_phys) {}};
+ void operator()(uint16_t scan_int, uint16_t scan_win,
+ uint8_t init_filter_policy, uint8_t addr_type_peer,
+ const RawAddress& bda_peer, uint8_t addr_type_own,
+ uint16_t conn_int_min, uint16_t conn_int_max,
+ uint16_t conn_latency, uint16_t conn_timeout,
+ uint16_t min_ce_len, uint16_t max_ce_len,
+ uint8_t initiating_phys) {
+ body(scan_int, scan_win, init_filter_policy, addr_type_peer, bda_peer,
+ addr_type_own, conn_int_min, conn_int_max, conn_latency, conn_timeout,
+ min_ce_len, max_ce_len, initiating_phys);
+ };
+};
+extern struct btm_send_hci_create_connection btm_send_hci_create_connection;
+// Name: btm_ble_create_ll_conn_complete
+// Params: tHCI_STATUS status
+// Returns: void
+struct btm_ble_create_ll_conn_complete {
+ std::function<void(tHCI_STATUS status)> body{[](tHCI_STATUS status) {}};
+ void operator()(tHCI_STATUS status) { body(status); };
+};
+extern struct btm_ble_create_ll_conn_complete btm_ble_create_ll_conn_complete;
+// Name: maybe_resolve_address
+// Params: RawAddress* bda, tBLE_ADDR_TYPE* bda_type
+// Returns: bool
+struct maybe_resolve_address {
+ std::function<bool(RawAddress* bda, tBLE_ADDR_TYPE* bda_type)> body{
+ [](RawAddress* bda, tBLE_ADDR_TYPE* bda_type) { return false; }};
+ bool operator()(RawAddress* bda, tBLE_ADDR_TYPE* bda_type) {
+ return body(bda, bda_type);
+ };
+};
+extern struct maybe_resolve_address maybe_resolve_address;
+// Name: btm_ble_conn_complete
+// Params: uint8_t* p, uint16_t evt_len, bool enhanced
+// Returns: void
+struct btm_ble_conn_complete {
+ std::function<void(uint8_t* p, uint16_t evt_len, bool enhanced)> body{
+ [](uint8_t* p, uint16_t evt_len, bool enhanced) {}};
+ void operator()(uint8_t* p, uint16_t evt_len, bool enhanced) {
+ body(p, evt_len, enhanced);
+ };
+};
+extern struct btm_ble_conn_complete btm_ble_conn_complete;
+// Name: btm_ble_create_conn_cancel
+// Params:
+// Returns: void
+struct btm_ble_create_conn_cancel {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct btm_ble_create_conn_cancel btm_ble_create_conn_cancel;
+// Name: btm_ble_create_conn_cancel_complete
+// Params: uint8_t* p
+// Returns: void
+struct btm_ble_create_conn_cancel_complete {
+ std::function<void(uint8_t* p)> body{[](uint8_t* p) {}};
+ void operator()(uint8_t* p) { body(p); };
+};
+extern struct btm_ble_create_conn_cancel_complete
+ btm_ble_create_conn_cancel_complete;
+
+} // namespace stack_acl_btm_ble_connection_establishment
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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.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_btm_ble_addr.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_addr {
+
+// Function state capture and return values, if needed
+struct btm_gen_resolve_paddr_low btm_gen_resolve_paddr_low;
+struct btm_gen_resolvable_private_addr btm_gen_resolvable_private_addr;
+struct btm_get_next_private_addrress_interval_ms
+ btm_get_next_private_addrress_interval_ms;
+struct btm_ble_init_pseudo_addr btm_ble_init_pseudo_addr;
+struct btm_ble_addr_resolvable btm_ble_addr_resolvable;
+struct btm_ble_resolve_random_addr btm_ble_resolve_random_addr;
+struct btm_identity_addr_to_random_pseudo btm_identity_addr_to_random_pseudo;
+struct btm_identity_addr_to_random_pseudo_from_address_with_type
+ btm_identity_addr_to_random_pseudo_from_address_with_type;
+struct btm_random_pseudo_to_identity_addr btm_random_pseudo_to_identity_addr;
+struct btm_ble_refresh_peer_resolvable_private_addr
+ btm_ble_refresh_peer_resolvable_private_addr;
+
+} // namespace stack_btm_ble_addr
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void btm_gen_resolve_paddr_low(const RawAddress& address) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_addr::btm_gen_resolve_paddr_low(address);
+}
+void btm_gen_resolvable_private_addr(
+ base::Callback<void(const RawAddress&)> cb) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_addr::btm_gen_resolvable_private_addr(cb);
+}
+uint64_t btm_get_next_private_addrress_interval_ms() {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::
+ btm_get_next_private_addrress_interval_ms();
+}
+bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec,
+ const RawAddress& new_pseudo_addr) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::btm_ble_init_pseudo_addr(
+ p_dev_rec, new_pseudo_addr);
+}
+bool btm_ble_addr_resolvable(const RawAddress& rpa,
+ tBTM_SEC_DEV_REC* p_dev_rec) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::btm_ble_addr_resolvable(rpa,
+ p_dev_rec);
+}
+tBTM_SEC_DEV_REC* btm_ble_resolve_random_addr(const RawAddress& random_bda) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::btm_ble_resolve_random_addr(
+ random_bda);
+}
+bool btm_identity_addr_to_random_pseudo(RawAddress* bd_addr,
+ uint8_t* p_addr_type, bool refresh) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::btm_identity_addr_to_random_pseudo(
+ bd_addr, p_addr_type, refresh);
+}
+bool btm_identity_addr_to_random_pseudo_from_address_with_type(
+ tBLE_BD_ADDR* address_with_type, bool refresh) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::
+ btm_identity_addr_to_random_pseudo_from_address_with_type(
+ address_with_type, refresh);
+}
+bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo,
+ uint8_t* p_identity_addr_type) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_addr::btm_random_pseudo_to_identity_addr(
+ random_pseudo, p_identity_addr_type);
+}
+void btm_ble_refresh_peer_resolvable_private_addr(
+ const RawAddress& pseudo_bda, const RawAddress& rpa,
+ tBTM_SEC_BLE::tADDRESS_TYPE rra_type) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_addr::btm_ble_refresh_peer_resolvable_private_addr(
+ pseudo_bda, rpa, rra_type);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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.2
+ */
+
+#include <base/callback.h> // RepeatingCallback
+#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 the inclusion set.
+//
+#include "stack/btm/security_device_record.h"
+#include "types/ble_address_with_type.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_addr {
+
+// Shared state between mocked functions and tests
+// Name: btm_gen_resolve_paddr_low
+// Params: const RawAddress& address
+// Returns: void
+struct btm_gen_resolve_paddr_low {
+ std::function<void(const RawAddress& address)> body{
+ [](const RawAddress& address) {}};
+ void operator()(const RawAddress& address) { body(address); };
+};
+extern struct btm_gen_resolve_paddr_low btm_gen_resolve_paddr_low;
+// Name: btm_gen_resolvable_private_addr
+// Params: base::Callback<void(const RawAddress&)> cb
+// Returns: void
+struct btm_gen_resolvable_private_addr {
+ std::function<void(base::Callback<void(const RawAddress&)> cb)> body{
+ [](base::Callback<void(const RawAddress&)> cb) {}};
+ void operator()(base::Callback<void(const RawAddress&)> cb) { body(cb); };
+};
+extern struct btm_gen_resolvable_private_addr btm_gen_resolvable_private_addr;
+// Name: btm_get_next_private_addrress_interval_ms
+// Params:
+// Returns: uint64_t
+struct btm_get_next_private_addrress_interval_ms {
+ std::function<uint64_t()> body{[]() { return 0; }};
+ uint64_t operator()() { return body(); };
+};
+extern struct btm_get_next_private_addrress_interval_ms
+ btm_get_next_private_addrress_interval_ms;
+// Name: btm_ble_init_pseudo_addr
+// Params: tBTM_SEC_DEV_REC* p_dev_rec, const RawAddress& new_pseudo_addr
+// Returns: bool
+struct btm_ble_init_pseudo_addr {
+ std::function<bool(tBTM_SEC_DEV_REC* p_dev_rec,
+ const RawAddress& new_pseudo_addr)>
+ body{[](tBTM_SEC_DEV_REC* p_dev_rec, const RawAddress& new_pseudo_addr) {
+ return false;
+ }};
+ bool operator()(tBTM_SEC_DEV_REC* p_dev_rec,
+ const RawAddress& new_pseudo_addr) {
+ return body(p_dev_rec, new_pseudo_addr);
+ };
+};
+extern struct btm_ble_init_pseudo_addr btm_ble_init_pseudo_addr;
+// Name: btm_ble_addr_resolvable
+// Params: const RawAddress& rpa, tBTM_SEC_DEV_REC* p_dev_rec
+// Returns: bool
+struct btm_ble_addr_resolvable {
+ std::function<bool(const RawAddress& rpa, tBTM_SEC_DEV_REC* p_dev_rec)> body{
+ [](const RawAddress& rpa, tBTM_SEC_DEV_REC* p_dev_rec) { return false; }};
+ bool operator()(const RawAddress& rpa, tBTM_SEC_DEV_REC* p_dev_rec) {
+ return body(rpa, p_dev_rec);
+ };
+};
+extern struct btm_ble_addr_resolvable btm_ble_addr_resolvable;
+// Name: btm_ble_resolve_random_addr
+// Params: const RawAddress& random_bda
+// Returns: tBTM_SEC_DEV_REC*
+struct btm_ble_resolve_random_addr {
+ std::function<tBTM_SEC_DEV_REC*(const RawAddress& random_bda)> body{
+ [](const RawAddress& random_bda) { return nullptr; }};
+ tBTM_SEC_DEV_REC* operator()(const RawAddress& random_bda) {
+ return body(random_bda);
+ };
+};
+extern struct btm_ble_resolve_random_addr btm_ble_resolve_random_addr;
+// Name: btm_identity_addr_to_random_pseudo
+// Params: RawAddress* bd_addr, uint8_t* p_addr_type, bool refresh
+// Returns: bool
+struct btm_identity_addr_to_random_pseudo {
+ std::function<bool(RawAddress* bd_addr, uint8_t* p_addr_type, bool refresh)>
+ body{[](RawAddress* bd_addr, uint8_t* p_addr_type, bool refresh) {
+ return false;
+ }};
+ bool operator()(RawAddress* bd_addr, uint8_t* p_addr_type, bool refresh) {
+ return body(bd_addr, p_addr_type, refresh);
+ };
+};
+extern struct btm_identity_addr_to_random_pseudo
+ btm_identity_addr_to_random_pseudo;
+// Name: btm_identity_addr_to_random_pseudo_from_address_with_type
+// Params: tBLE_BD_ADDR* address_with_type, bool refresh
+// Returns: bool
+struct btm_identity_addr_to_random_pseudo_from_address_with_type {
+ std::function<bool(tBLE_BD_ADDR* address_with_type, bool refresh)> body{
+ [](tBLE_BD_ADDR* address_with_type, bool refresh) { return false; }};
+ bool operator()(tBLE_BD_ADDR* address_with_type, bool refresh) {
+ return body(address_with_type, refresh);
+ };
+};
+extern struct btm_identity_addr_to_random_pseudo_from_address_with_type
+ btm_identity_addr_to_random_pseudo_from_address_with_type;
+// Name: btm_random_pseudo_to_identity_addr
+// Params: RawAddress* random_pseudo, uint8_t* p_identity_addr_type
+// Returns: bool
+struct btm_random_pseudo_to_identity_addr {
+ std::function<bool(RawAddress* random_pseudo, uint8_t* p_identity_addr_type)>
+ body{[](RawAddress* random_pseudo, uint8_t* p_identity_addr_type) {
+ return false;
+ }};
+ bool operator()(RawAddress* random_pseudo, uint8_t* p_identity_addr_type) {
+ return body(random_pseudo, p_identity_addr_type);
+ };
+};
+extern struct btm_random_pseudo_to_identity_addr
+ btm_random_pseudo_to_identity_addr;
+// Name: btm_ble_refresh_peer_resolvable_private_addr
+// Params: const RawAddress& pseudo_bda, const RawAddress& rpa,
+// tBTM_SEC_BLE::tADDRESS_TYPE rra_type Returns: void
+struct btm_ble_refresh_peer_resolvable_private_addr {
+ std::function<void(const RawAddress& pseudo_bda, const RawAddress& rpa,
+ tBTM_SEC_BLE::tADDRESS_TYPE rra_type)>
+ body{[](const RawAddress& pseudo_bda, const RawAddress& rpa,
+ tBTM_SEC_BLE::tADDRESS_TYPE rra_type) {}};
+ void operator()(const RawAddress& pseudo_bda, const RawAddress& rpa,
+ tBTM_SEC_BLE::tADDRESS_TYPE rra_type) {
+ body(pseudo_bda, rpa, rra_type);
+ };
+};
+extern struct btm_ble_refresh_peer_resolvable_private_addr
+ btm_ble_refresh_peer_resolvable_private_addr;
+
+} // namespace stack_btm_ble_addr
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:5
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_stack_btm_ble_advertiser_hci_interface.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_advertiser_hci_interface {
+
+// Function state capture and return values, if needed
+struct btm_le_on_advertising_set_terminated
+ btm_le_on_advertising_set_terminated;
+struct btm_ble_advertiser_notify_terminated_legacy
+ btm_ble_advertiser_notify_terminated_legacy;
+
+} // namespace stack_btm_ble_advertiser_hci_interface
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void btm_le_on_advertising_set_terminated(uint8_t* p, uint16_t length) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_advertiser_hci_interface::
+ btm_le_on_advertising_set_terminated(p, length);
+}
+void btm_ble_advertiser_notify_terminated_legacy(uint8_t status,
+ uint16_t connection_handle) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_advertiser_hci_interface::
+ btm_ble_advertiser_notify_terminated_legacy(status, connection_handle);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:5
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+#include "stack/btm/ble_advertiser_hci_interface.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_advertiser_hci_interface {
+
+// Shared state between mocked functions and tests
+// Name: btm_le_on_advertising_set_terminated
+// Params: uint8_t* p, uint16_t length
+// Returns: void
+struct btm_le_on_advertising_set_terminated {
+ std::function<void(uint8_t* p, uint16_t length)> body{
+ [](uint8_t* p, uint16_t length) {}};
+ void operator()(uint8_t* p, uint16_t length) { body(p, length); };
+};
+extern struct btm_le_on_advertising_set_terminated
+ btm_le_on_advertising_set_terminated;
+// Name: btm_ble_advertiser_notify_terminated_legacy
+// Params: uint8_t status, uint16_t connection_handle
+// Returns: void
+struct btm_ble_advertiser_notify_terminated_legacy {
+ std::function<void(uint8_t status, uint16_t connection_handle)> body{
+ [](uint8_t status, uint16_t connection_handle) {}};
+ void operator()(uint8_t status, uint16_t connection_handle) {
+ body(status, connection_handle);
+ };
+};
+extern struct btm_ble_advertiser_notify_terminated_legacy
+ btm_ble_advertiser_notify_terminated_legacy;
+
+} // namespace stack_btm_ble_advertiser_hci_interface
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:13
+ *
+ * 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_btm_ble_privacy.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_privacy {
+
+// Function state capture and return values, if needed
+struct btm_ble_clear_resolving_list_complete
+ btm_ble_clear_resolving_list_complete;
+struct btm_ble_add_resolving_list_entry_complete
+ btm_ble_add_resolving_list_entry_complete;
+struct btm_ble_remove_resolving_list_entry_complete
+ btm_ble_remove_resolving_list_entry_complete;
+struct btm_ble_read_resolving_list_entry_complete
+ btm_ble_read_resolving_list_entry_complete;
+struct btm_ble_remove_resolving_list_entry btm_ble_remove_resolving_list_entry;
+struct btm_ble_clear_resolving_list btm_ble_clear_resolving_list;
+struct btm_ble_read_resolving_list_entry btm_ble_read_resolving_list_entry;
+struct btm_ble_disable_resolving_list btm_ble_disable_resolving_list;
+struct btm_ble_resolving_list_load_dev btm_ble_resolving_list_load_dev;
+struct btm_ble_resolving_list_remove_dev btm_ble_resolving_list_remove_dev;
+struct btm_ble_enable_resolving_list btm_ble_enable_resolving_list;
+struct btm_ble_enable_resolving_list_for_platform
+ btm_ble_enable_resolving_list_for_platform;
+struct btm_ble_resolving_list_init btm_ble_resolving_list_init;
+
+} // namespace stack_btm_ble_privacy
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void btm_ble_clear_resolving_list_complete(uint8_t* p, uint16_t evt_len) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_clear_resolving_list_complete(
+ p, evt_len);
+}
+void btm_ble_add_resolving_list_entry_complete(uint8_t* p, uint16_t evt_len) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_add_resolving_list_entry_complete(
+ p, evt_len);
+}
+void btm_ble_remove_resolving_list_entry_complete(uint8_t* p,
+ uint16_t evt_len) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::
+ btm_ble_remove_resolving_list_entry_complete(p, evt_len);
+}
+void btm_ble_read_resolving_list_entry_complete(uint8_t* p, uint16_t evt_len) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_read_resolving_list_entry_complete(
+ p, evt_len);
+}
+tBTM_STATUS btm_ble_remove_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_privacy::btm_ble_remove_resolving_list_entry(
+ p_dev_rec);
+}
+void btm_ble_clear_resolving_list(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_clear_resolving_list();
+}
+bool btm_ble_read_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_privacy::btm_ble_read_resolving_list_entry(
+ p_dev_rec);
+}
+bool btm_ble_disable_resolving_list(uint8_t rl_mask, bool to_resume) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_privacy::btm_ble_disable_resolving_list(
+ rl_mask, to_resume);
+}
+bool btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_btm_ble_privacy::btm_ble_resolving_list_load_dev(
+ p_dev_rec);
+}
+void btm_ble_resolving_list_remove_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_resolving_list_remove_dev(
+ p_dev_rec);
+}
+void btm_ble_enable_resolving_list(uint8_t rl_mask) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_enable_resolving_list(rl_mask);
+}
+void btm_ble_enable_resolving_list_for_platform(uint8_t rl_mask) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_enable_resolving_list_for_platform(
+ rl_mask);
+}
+void btm_ble_resolving_list_init(uint8_t max_irk_list_sz) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_privacy::btm_ble_resolving_list_init(
+ max_irk_list_sz);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:13
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+#include "stack/btm/security_device_record.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_privacy {
+
+// Shared state between mocked functions and tests
+// Name: btm_ble_clear_resolving_list_complete
+// Params: uint8_t* p, uint16_t evt_len
+// Returns: void
+struct btm_ble_clear_resolving_list_complete {
+ std::function<void(uint8_t* p, uint16_t evt_len)> body{
+ [](uint8_t* p, uint16_t evt_len) {}};
+ void operator()(uint8_t* p, uint16_t evt_len) { body(p, evt_len); };
+};
+extern struct btm_ble_clear_resolving_list_complete
+ btm_ble_clear_resolving_list_complete;
+// Name: btm_ble_add_resolving_list_entry_complete
+// Params: uint8_t* p, uint16_t evt_len
+// Returns: void
+struct btm_ble_add_resolving_list_entry_complete {
+ std::function<void(uint8_t* p, uint16_t evt_len)> body{
+ [](uint8_t* p, uint16_t evt_len) {}};
+ void operator()(uint8_t* p, uint16_t evt_len) { body(p, evt_len); };
+};
+extern struct btm_ble_add_resolving_list_entry_complete
+ btm_ble_add_resolving_list_entry_complete;
+// Name: btm_ble_remove_resolving_list_entry_complete
+// Params: uint8_t* p, uint16_t evt_len
+// Returns: void
+struct btm_ble_remove_resolving_list_entry_complete {
+ std::function<void(uint8_t* p, uint16_t evt_len)> body{
+ [](uint8_t* p, uint16_t evt_len) {}};
+ void operator()(uint8_t* p, uint16_t evt_len) { body(p, evt_len); };
+};
+extern struct btm_ble_remove_resolving_list_entry_complete
+ btm_ble_remove_resolving_list_entry_complete;
+// Name: btm_ble_read_resolving_list_entry_complete
+// Params: uint8_t* p, uint16_t evt_len
+// Returns: void
+struct btm_ble_read_resolving_list_entry_complete {
+ std::function<void(uint8_t* p, uint16_t evt_len)> body{
+ [](uint8_t* p, uint16_t evt_len) {}};
+ void operator()(uint8_t* p, uint16_t evt_len) { body(p, evt_len); };
+};
+extern struct btm_ble_read_resolving_list_entry_complete
+ btm_ble_read_resolving_list_entry_complete;
+// Name: btm_ble_remove_resolving_list_entry
+// Params: tBTM_SEC_DEV_REC* p_dev_rec
+// Returns: tBTM_STATUS
+struct btm_ble_remove_resolving_list_entry {
+ std::function<tBTM_STATUS(tBTM_SEC_DEV_REC* p_dev_rec)> body{
+ [](tBTM_SEC_DEV_REC* p_dev_rec) { return 0; }};
+ tBTM_STATUS operator()(tBTM_SEC_DEV_REC* p_dev_rec) {
+ return body(p_dev_rec);
+ };
+};
+extern struct btm_ble_remove_resolving_list_entry
+ btm_ble_remove_resolving_list_entry;
+// Name: btm_ble_clear_resolving_list
+// Params: void
+// Returns: void
+struct btm_ble_clear_resolving_list {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct btm_ble_clear_resolving_list btm_ble_clear_resolving_list;
+// Name: btm_ble_read_resolving_list_entry
+// Params: tBTM_SEC_DEV_REC* p_dev_rec
+// Returns: bool
+struct btm_ble_read_resolving_list_entry {
+ std::function<bool(tBTM_SEC_DEV_REC* p_dev_rec)> body{
+ [](tBTM_SEC_DEV_REC* p_dev_rec) { return false; }};
+ bool operator()(tBTM_SEC_DEV_REC* p_dev_rec) { return body(p_dev_rec); };
+};
+extern struct btm_ble_read_resolving_list_entry
+ btm_ble_read_resolving_list_entry;
+// Name: btm_ble_disable_resolving_list
+// Params: uint8_t rl_mask, bool to_resume
+// Returns: bool
+struct btm_ble_disable_resolving_list {
+ std::function<bool(uint8_t rl_mask, bool to_resume)> body{
+ [](uint8_t rl_mask, bool to_resume) { return false; }};
+ bool operator()(uint8_t rl_mask, bool to_resume) {
+ return body(rl_mask, to_resume);
+ };
+};
+extern struct btm_ble_disable_resolving_list btm_ble_disable_resolving_list;
+// Name: btm_ble_resolving_list_load_dev
+// Params: tBTM_SEC_DEV_REC* p_dev_rec
+// Returns: bool
+struct btm_ble_resolving_list_load_dev {
+ std::function<bool(tBTM_SEC_DEV_REC* p_dev_rec)> body{
+ [](tBTM_SEC_DEV_REC* p_dev_rec) { return false; }};
+ bool operator()(tBTM_SEC_DEV_REC* p_dev_rec) { return body(p_dev_rec); };
+};
+extern struct btm_ble_resolving_list_load_dev btm_ble_resolving_list_load_dev;
+// Name: btm_ble_resolving_list_remove_dev
+// Params: tBTM_SEC_DEV_REC* p_dev_rec
+// Returns: void
+struct btm_ble_resolving_list_remove_dev {
+ std::function<void(tBTM_SEC_DEV_REC* p_dev_rec)> body{
+ [](tBTM_SEC_DEV_REC* p_dev_rec) {}};
+ void operator()(tBTM_SEC_DEV_REC* p_dev_rec) { body(p_dev_rec); };
+};
+extern struct btm_ble_resolving_list_remove_dev
+ btm_ble_resolving_list_remove_dev;
+// Name: btm_ble_enable_resolving_list
+// Params: uint8_t rl_mask
+// Returns: void
+struct btm_ble_enable_resolving_list {
+ std::function<void(uint8_t rl_mask)> body{[](uint8_t rl_mask) {}};
+ void operator()(uint8_t rl_mask) { body(rl_mask); };
+};
+extern struct btm_ble_enable_resolving_list btm_ble_enable_resolving_list;
+// Name: btm_ble_enable_resolving_list_for_platform
+// Params: uint8_t rl_mask
+// Returns: void
+struct btm_ble_enable_resolving_list_for_platform {
+ std::function<void(uint8_t rl_mask)> body{[](uint8_t rl_mask) {}};
+ void operator()(uint8_t rl_mask) { body(rl_mask); };
+};
+extern struct btm_ble_enable_resolving_list_for_platform
+ btm_ble_enable_resolving_list_for_platform;
+// Name: btm_ble_resolving_list_init
+// Params: uint8_t max_irk_list_sz
+// Returns: void
+struct btm_ble_resolving_list_init {
+ std::function<void(uint8_t max_irk_list_sz)> body{
+ [](uint8_t max_irk_list_sz) {}};
+ void operator()(uint8_t max_irk_list_sz) { body(max_irk_list_sz); };
+};
+extern struct btm_ble_resolving_list_init btm_ble_resolving_list_init;
+
+} // namespace stack_btm_ble_privacy
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:6
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_stack_btm_ble_scanner_hci_interface.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_scanner_hci_interface {
+
+// Function state capture and return values, if needed
+struct btm_ble_process_periodic_adv_sync_est_evt
+ btm_ble_process_periodic_adv_sync_est_evt;
+struct btm_ble_process_periodic_adv_pkt btm_ble_process_periodic_adv_pkt;
+struct btm_ble_process_periodic_adv_sync_lost_evt
+ btm_ble_process_periodic_adv_sync_lost_evt;
+
+} // namespace stack_btm_ble_scanner_hci_interface
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void btm_ble_process_periodic_adv_sync_est_evt(uint8_t data_len,
+ uint8_t* data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_scanner_hci_interface::
+ btm_ble_process_periodic_adv_sync_est_evt(data_len, data);
+}
+void btm_ble_process_periodic_adv_pkt(uint8_t data_len, uint8_t* data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_scanner_hci_interface::
+ btm_ble_process_periodic_adv_pkt(data_len, data);
+}
+void btm_ble_process_periodic_adv_sync_lost_evt(uint8_t data_len,
+ uint8_t* data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_btm_ble_scanner_hci_interface::
+ btm_ble_process_periodic_adv_sync_lost_evt(data_len, data);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:6
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+#include "stack/btm/ble_scanner_hci_interface.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_btm_ble_scanner_hci_interface {
+
+// Name: btm_ble_process_periodic_adv_sync_est_evt
+// Params: uint8_t data_len, uint8_t* data
+// Returns: void
+struct btm_ble_process_periodic_adv_sync_est_evt {
+ std::function<void(uint8_t data_len, uint8_t* data)> body{
+ [](uint8_t data_len, uint8_t* data) {}};
+ void operator()(uint8_t data_len, uint8_t* data) { body(data_len, data); };
+};
+extern struct btm_ble_process_periodic_adv_sync_est_evt
+ btm_ble_process_periodic_adv_sync_est_evt;
+// Name: btm_ble_process_periodic_adv_pkt
+// Params: uint8_t data_len, uint8_t* data
+// Returns: void
+struct btm_ble_process_periodic_adv_pkt {
+ std::function<void(uint8_t data_len, uint8_t* data)> body{
+ [](uint8_t data_len, uint8_t* data) {}};
+ void operator()(uint8_t data_len, uint8_t* data) { body(data_len, data); };
+};
+extern struct btm_ble_process_periodic_adv_pkt btm_ble_process_periodic_adv_pkt;
+// Name: btm_ble_process_periodic_adv_sync_lost_evt
+// Params: uint8_t data_len, uint8_t* data
+// Returns: void
+struct btm_ble_process_periodic_adv_sync_lost_evt {
+ std::function<void(uint8_t data_len, uint8_t* data)> body{
+ [](uint8_t data_len, uint8_t* data) {}};
+ void operator()(uint8_t data_len, uint8_t* data) { body(data_len, data); };
+};
+extern struct btm_ble_process_periodic_adv_sync_lost_evt
+ btm_ble_process_periodic_adv_sync_lost_evt;
+
+} // namespace stack_btm_ble_scanner_hci_interface
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+#include <memory>
+
+#include "stack/include/btm_iso_api.h"
+
+using bluetooth::hci::iso_manager::BigCallbacks;
+using bluetooth::hci::iso_manager::CigCallbacks;
+
+namespace bluetooth {
+namespace hci {
+
+struct IsoManager::impl {};
+
+IsoManager::IsoManager() {}
+IsoManager::~IsoManager() {}
+void IsoManager::RegisterCigCallbacks(CigCallbacks* callbacks) const {}
+void IsoManager::RegisterBigCallbacks(BigCallbacks* callbacks) const {}
+void IsoManager::CreateCig(uint8_t cig_id,
+ struct iso_manager::cig_create_params cig_params) {}
+void IsoManager::ReconfigureCig(
+ uint8_t cig_id, struct iso_manager::cig_create_params cig_params) {}
+void IsoManager::RemoveCig(uint8_t cig_id) {}
+void IsoManager::EstablishCis(
+ struct iso_manager::cis_establish_params conn_params) {}
+void IsoManager::DisconnectCis(uint16_t cis_handle, uint8_t reason) {}
+void IsoManager::SetupIsoDataPath(
+ uint16_t iso_handle, struct iso_manager::iso_data_path_params path_params) {
+}
+void IsoManager::RemoveIsoDataPath(uint16_t iso_handle, uint8_t data_path_dir) {
+}
+void IsoManager::ReadIsoLinkQuality(uint16_t iso_handle) {}
+void IsoManager::SendIsoData(uint16_t iso_handle, const uint8_t* data,
+ uint16_t data_len) {}
+void IsoManager::CreateBig(uint8_t big_id,
+ struct iso_manager::big_create_params big_params) {}
+void IsoManager::TerminateBig(uint8_t big_id, uint8_t reason) {}
+void IsoManager::HandleIsoData(void* p_msg) {}
+void IsoManager::HandleDisconnect(uint16_t handle, uint8_t reason) {}
+void IsoManager::HandleNumComplDataPkts(uint8_t* p, uint8_t evt_len) {}
+void IsoManager::HandleHciEvent(uint8_t sub_code, uint8_t* params,
+ uint16_t length) {}
+void IsoManager::Start() {}
+void IsoManager::Stop() {}
+
+} // namespace hci
+} // namespace bluetooth
/*
- * Copyright 2020 The Android Open Source Project
+ * 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.
/*
* Generated mock file from original source file
- * Functions generated:26
+ * Functions generated:22
+ *
+ * mockcify.pl ver 0.2
*/
#include <map>
extern std::map<std::string, int> mock_function_count_map;
-#include <base/logging.h>
-#include "bt_target.h"
-#include "device/include/controller.h"
-#include "hcimsgs.h"
-#include "main/shim/shim.h"
-#include "osi/include/log.h"
-#include "osi/include/osi.h"
-#include "stack/btm/btm_dev.h"
-#include "stack/btm/btm_sec.h"
-#include "stack/include/acl_api.h"
-#include "stack/include/l2c_api.h"
-#include "stack/include/l2cdefs.h"
-#include "stack/l2cap/l2c_int.h"
-#include "stack_config.h"
+// 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"
+// 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 false;
+ return test::mock::stack_l2cap_ble::L2CA_EnableUpdateBleConnParams(rem_bda,
+ enable);
}
-bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda, uint16_t min_int,
- uint16_t max_int, uint16_t latency,
- uint16_t timeout) {
+hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr) {
mock_function_count_map[__func__]++;
- return false;
+ return test::mock::stack_l2cap_ble::L2CA_GetBleConnRole(bd_addr);
}
-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) {
+void l2cble_notify_le_connection(const RawAddress& bda) {
mock_function_count_map[__func__]++;
- return false;
+ 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 false;
+ 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 false;
-}
-bool l2cble_create_conn(tL2C_LCB* p_lcb) {
- mock_function_count_map[__func__]++;
- return false;
+ return test::mock::stack_l2cap_ble::l2cble_conn_comp_from_address_with_type(
+ handle, role, address_with_type, conn_interval, conn_latency,
+ conn_timeout);
}
-hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr) {
- mock_function_count_map[__func__]++;
- return HCI_ROLE_CENTRAL;
-}
-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 L2CAP_LE_RESULT_CONN_OK;
-}
-uint16_t L2CA_GetDisconnectReason(const RawAddress& remote_bda,
- tBT_TRANSPORT transport) {
- mock_function_count_map[__func__]++;
- return 0;
-}
-void L2CA_AdjustConnectionIntervals(uint16_t* min_interval,
- uint16_t* max_interval,
- uint16_t floor_interval) {
+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 L2CA_SetLeFixedChannelTxDataLength(const RawAddress& remote_bda,
- uint16_t fix_cid, uint16_t tx_mtu) {
+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);
}
-void l2c_ble_link_adjust_allocation(void) {
+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 l2cble_credit_based_conn_req(tL2C_CCB* p_ccb) {
- mock_function_count_map[__func__]++;
-}
-void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, uint16_t result) {
+void l2c_ble_link_adjust_allocation(void) {
mock_function_count_map[__func__]++;
+ test::mock::stack_l2cap_ble::l2c_ble_link_adjust_allocation();
}
-void l2cble_notify_le_connection(const RawAddress& bda) {
+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_process_conn_update_evt(uint16_t handle, uint8_t status,
- uint16_t interval, uint16_t latency,
- uint16_t 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_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_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_sec_comp(const RawAddress* bda, tBT_TRANSPORT transport,
- void* p_ref_data, uint8_t status) {
+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_set_fixed_channel_tx_data_length(const RawAddress& remote_bda,
- uint16_t fix_cid,
- uint16_t tx_mtu) {
+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);
}
-void l2cble_update_data_length(tL2C_LCB* p_lcb) {
+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
--- /dev/null
+/*
+ * 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 <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 the inclusion set.
+#include "stack/include/l2c_api.h"
+#include "stack/l2cap/l2c_int.h"
+#include "types/ble_address_with_type.h"
+#include "types/hci_role.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_l2cap_ble {
+
+// Shared state between mocked functions and tests
+// Name: L2CA_UpdateBleConnParams
+// Params: 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
+// Returns: bool
+struct L2CA_UpdateBleConnParams {
+ std::function<bool(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)>
+ body{[](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) { return false; }};
+ bool operator()(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) {
+ return body(rem_bda, min_int, max_int, latency, timeout, min_ce_len,
+ max_ce_len);
+ };
+};
+extern struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
+// Name: L2CA_EnableUpdateBleConnParams
+// Params: const RawAddress& rem_bda, bool enable
+// Returns: bool
+struct L2CA_EnableUpdateBleConnParams {
+ std::function<bool(const RawAddress& rem_bda, bool enable)> body{
+ [](const RawAddress& rem_bda, bool enable) { return false; }};
+ bool operator()(const RawAddress& rem_bda, bool enable) {
+ return body(rem_bda, enable);
+ };
+};
+extern struct L2CA_EnableUpdateBleConnParams L2CA_EnableUpdateBleConnParams;
+// Name: L2CA_GetBleConnRole
+// Params: const RawAddress& bd_addr
+// Returns: hci_role_t
+struct L2CA_GetBleConnRole {
+ std::function<hci_role_t(const RawAddress& bd_addr)> body{
+ [](const RawAddress& bd_addr) { return HCI_ROLE_CENTRAL; }};
+ hci_role_t operator()(const RawAddress& bd_addr) { return body(bd_addr); };
+};
+extern struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
+// Name: l2cble_notify_le_connection
+// Params: const RawAddress& bda
+// Returns: void
+struct l2cble_notify_le_connection {
+ std::function<void(const RawAddress& bda)> body{[](const RawAddress& bda) {}};
+ void operator()(const RawAddress& bda) { body(bda); };
+};
+extern struct l2cble_notify_le_connection l2cble_notify_le_connection;
+// Name: l2cble_conn_comp
+// Params: 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
+// Returns: bool
+struct l2cble_conn_comp {
+ std::function<bool(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)>
+ body{[](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) { return false; }};
+ bool operator()(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) {
+ return body(handle, role, bda, type, conn_interval, conn_latency,
+ conn_timeout);
+ };
+};
+extern struct l2cble_conn_comp l2cble_conn_comp;
+// Name: l2cble_conn_comp_from_address_with_type
+// Params: 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 Returns: bool
+struct l2cble_conn_comp_from_address_with_type {
+ std::function<bool(
+ 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)>
+ body{[](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) { return false; }};
+ bool operator()(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) {
+ return body(handle, role, address_with_type, conn_interval, conn_latency,
+ conn_timeout);
+ };
+};
+extern struct l2cble_conn_comp_from_address_with_type
+ l2cble_conn_comp_from_address_with_type;
+// Name: l2cble_process_conn_update_evt
+// Params: uint16_t handle, uint8_t status, uint16_t interval, uint16_t latency,
+// uint16_t timeout Returns: void
+struct l2cble_process_conn_update_evt {
+ std::function<void(uint16_t handle, uint8_t status, uint16_t interval,
+ uint16_t latency, uint16_t timeout)>
+ body{[](uint16_t handle, uint8_t status, uint16_t interval,
+ uint16_t latency, uint16_t timeout) {}};
+ void operator()(uint16_t handle, uint8_t status, uint16_t interval,
+ uint16_t latency, uint16_t timeout) {
+ body(handle, status, interval, latency, timeout);
+ };
+};
+extern struct l2cble_process_conn_update_evt l2cble_process_conn_update_evt;
+// Name: l2cble_process_sig_cmd
+// Params: tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len
+// Returns: void
+struct l2cble_process_sig_cmd {
+ std::function<void(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len)> body{
+ [](tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {}};
+ void operator()(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
+ body(p_lcb, p, pkt_len);
+ };
+};
+extern struct l2cble_process_sig_cmd l2cble_process_sig_cmd;
+// Name: l2cble_create_conn
+// Params: tL2C_LCB* p_lcb
+// Returns: bool
+struct l2cble_create_conn {
+ std::function<bool(tL2C_LCB* p_lcb)> body{
+ [](tL2C_LCB* p_lcb) { return false; }};
+ bool operator()(tL2C_LCB* p_lcb) { return body(p_lcb); };
+};
+extern struct l2cble_create_conn l2cble_create_conn;
+// Name: l2c_link_processs_ble_num_bufs
+// Params: uint16_t num_lm_ble_bufs
+// Returns: void
+struct l2c_link_processs_ble_num_bufs {
+ std::function<void(uint16_t num_lm_ble_bufs)> body{
+ [](uint16_t num_lm_ble_bufs) {}};
+ void operator()(uint16_t num_lm_ble_bufs) { body(num_lm_ble_bufs); };
+};
+extern struct l2c_link_processs_ble_num_bufs l2c_link_processs_ble_num_bufs;
+// Name: l2c_ble_link_adjust_allocation
+// Params: void
+// Returns: void
+struct l2c_ble_link_adjust_allocation {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct l2c_ble_link_adjust_allocation l2c_ble_link_adjust_allocation;
+// Name: l2cble_process_rc_param_request_evt
+// Params: uint16_t handle, uint16_t int_min, uint16_t int_max, uint16_t
+// latency, uint16_t timeout Returns: void
+struct l2cble_process_rc_param_request_evt {
+ std::function<void(uint16_t handle, uint16_t int_min, uint16_t int_max,
+ uint16_t latency, uint16_t timeout)>
+ body{[](uint16_t handle, uint16_t int_min, uint16_t int_max,
+ uint16_t latency, uint16_t timeout) {}};
+ void operator()(uint16_t handle, uint16_t int_min, uint16_t int_max,
+ uint16_t latency, uint16_t timeout) {
+ body(handle, int_min, int_max, latency, timeout);
+ };
+};
+extern struct l2cble_process_rc_param_request_evt
+ l2cble_process_rc_param_request_evt;
+// Name: l2cble_update_data_length
+// Params: tL2C_LCB* p_lcb
+// Returns: void
+struct l2cble_update_data_length {
+ std::function<void(tL2C_LCB* p_lcb)> body{[](tL2C_LCB* p_lcb) {}};
+ void operator()(tL2C_LCB* p_lcb) { body(p_lcb); };
+};
+extern struct l2cble_update_data_length l2cble_update_data_length;
+// Name: l2cble_process_data_length_change_event
+// Params: uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len
+// Returns: void
+struct l2cble_process_data_length_change_event {
+ std::function<void(uint16_t handle, uint16_t tx_data_len,
+ uint16_t rx_data_len)>
+ body{[](uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len) {}};
+ void operator()(uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len) {
+ body(handle, tx_data_len, rx_data_len);
+ };
+};
+extern struct l2cble_process_data_length_change_event
+ l2cble_process_data_length_change_event;
+// Name: l2cble_credit_based_conn_req
+// Params: tL2C_CCB* p_ccb
+// Returns: void
+struct l2cble_credit_based_conn_req {
+ std::function<void(tL2C_CCB* p_ccb)> body{[](tL2C_CCB* p_ccb) {}};
+ void operator()(tL2C_CCB* p_ccb) { body(p_ccb); };
+};
+extern struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req;
+// Name: l2cble_credit_based_conn_res
+// Params: tL2C_CCB* p_ccb, uint16_t result
+// Returns: void
+struct l2cble_credit_based_conn_res {
+ std::function<void(tL2C_CCB* p_ccb, uint16_t result)> body{
+ [](tL2C_CCB* p_ccb, uint16_t result) {}};
+ void operator()(tL2C_CCB* p_ccb, uint16_t result) { body(p_ccb, result); };
+};
+extern struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res;
+// Name: l2cble_send_flow_control_credit
+// Params: tL2C_CCB* p_ccb, uint16_t credit_value
+// Returns: void
+struct l2cble_send_flow_control_credit {
+ std::function<void(tL2C_CCB* p_ccb, uint16_t credit_value)> body{
+ [](tL2C_CCB* p_ccb, uint16_t credit_value) {}};
+ void operator()(tL2C_CCB* p_ccb, uint16_t credit_value) {
+ body(p_ccb, credit_value);
+ };
+};
+extern struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit;
+// Name: l2cble_send_peer_disc_req
+// Params: tL2C_CCB* p_ccb
+// Returns: void
+struct l2cble_send_peer_disc_req {
+ std::function<void(tL2C_CCB* p_ccb)> body{[](tL2C_CCB* p_ccb) {}};
+ void operator()(tL2C_CCB* p_ccb) { body(p_ccb); };
+};
+extern struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req;
+// Name: l2cble_sec_comp
+// Params: const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data,
+// tBTM_STATUS status Returns: void
+struct l2cble_sec_comp {
+ std::function<void(const RawAddress* bda, tBT_TRANSPORT transport,
+ void* p_ref_data, tBTM_STATUS status)>
+ body{[](const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data,
+ tBTM_STATUS status) {}};
+ void operator()(const RawAddress* bda, tBT_TRANSPORT transport,
+ void* p_ref_data, tBTM_STATUS status) {
+ body(bda, transport, p_ref_data, status);
+ };
+};
+extern struct l2cble_sec_comp l2cble_sec_comp;
+// Name: l2ble_sec_access_req
+// Params: const RawAddress& bd_addr, uint16_t psm, bool is_originator,
+// tL2CAP_SEC_CBACK* p_callback, void* p_ref_data Returns: tL2CAP_LE_RESULT_CODE
+struct l2ble_sec_access_req {
+ std::function<tL2CAP_LE_RESULT_CODE(
+ const RawAddress& bd_addr, uint16_t psm, bool is_originator,
+ tL2CAP_SEC_CBACK* p_callback, void* p_ref_data)>
+ body{[](const RawAddress& bd_addr, uint16_t psm, bool is_originator,
+ tL2CAP_SEC_CBACK* p_callback,
+ void* p_ref_data) { return L2CAP_LE_RESULT_CONN_OK; }};
+ tL2CAP_LE_RESULT_CODE operator()(const RawAddress& bd_addr, uint16_t psm,
+ bool is_originator,
+ tL2CAP_SEC_CBACK* p_callback,
+ void* p_ref_data) {
+ return body(bd_addr, psm, is_originator, p_callback, p_ref_data);
+ };
+};
+extern struct l2ble_sec_access_req l2ble_sec_access_req;
+// Name: L2CA_AdjustConnectionIntervals
+// Params: uint16_t* min_interval, uint16_t* max_interval, uint16_t
+// floor_interval Returns: void
+struct L2CA_AdjustConnectionIntervals {
+ std::function<void(uint16_t* min_interval, uint16_t* max_interval,
+ uint16_t floor_interval)>
+ body{[](uint16_t* min_interval, uint16_t* max_interval,
+ uint16_t floor_interval) {}};
+ void operator()(uint16_t* min_interval, uint16_t* max_interval,
+ uint16_t floor_interval) {
+ body(min_interval, max_interval, floor_interval);
+ };
+};
+extern struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals;
+// Name: l2cble_use_preferred_conn_params
+// Params: const RawAddress& bda
+// Returns: void
+struct l2cble_use_preferred_conn_params {
+ std::function<void(const RawAddress& bda)> body{[](const RawAddress& bda) {}};
+ void operator()(const RawAddress& bda) { body(bda); };
+};
+extern struct l2cble_use_preferred_conn_params l2cble_use_preferred_conn_params;
+
+} // namespace stack_l2cap_ble
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:5
+ *
+ * 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.
+#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
+#include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
+#include "common/metrics.h"
+#include "main/shim/metrics_api.h"
+#include "main/shim/shim.h"
+#include "stack/include/stack_metrics_logging.h"
+#include "types/raw_address.h"
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_stack_metrics_logging.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_metrics_logging {
+
+// Function state capture and return values, if needed
+struct log_classic_pairing_event log_classic_pairing_event;
+struct log_link_layer_connection_event log_link_layer_connection_event;
+struct log_smp_pairing_event log_smp_pairing_event;
+struct log_sdp_attribute log_sdp_attribute;
+struct log_manufacturer_info log_manufacturer_info;
+
+} // namespace stack_metrics_logging
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void log_classic_pairing_event(const RawAddress& address, uint16_t handle,
+ uint32_t hci_cmd, uint16_t hci_event,
+ uint16_t cmd_status, uint16_t reason_code,
+ int64_t event_value) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_metrics_logging::log_classic_pairing_event(
+ address, handle, hci_cmd, hci_event, cmd_status, reason_code,
+ event_value);
+}
+void log_link_layer_connection_event(
+ const RawAddress* address, uint32_t connection_handle,
+ android::bluetooth::DirectionEnum direction, uint16_t link_type,
+ uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
+ uint16_t cmd_status, uint16_t reason_code) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_metrics_logging::log_link_layer_connection_event(
+ address, connection_handle, direction, link_type, hci_cmd, hci_event,
+ hci_ble_event, cmd_status, reason_code);
+}
+void log_smp_pairing_event(const RawAddress& address, uint8_t smp_cmd,
+ android::bluetooth::DirectionEnum direction,
+ uint8_t smp_fail_reason) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_metrics_logging::log_smp_pairing_event(
+ address, smp_cmd, direction, smp_fail_reason);
+}
+void log_sdp_attribute(const RawAddress& address, uint16_t protocol_uuid,
+ uint16_t attribute_id, size_t attribute_size,
+ const char* attribute_value) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_metrics_logging::log_sdp_attribute(
+ address, protocol_uuid, attribute_id, attribute_size, attribute_value);
+}
+void log_manufacturer_info(const RawAddress& address,
+ android::bluetooth::DeviceInfoSrcEnum source_type,
+ const std::string& source_name,
+ const std::string& manufacturer,
+ const std::string& model,
+ const std::string& hardware_version,
+ const std::string& software_version) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_metrics_logging::log_manufacturer_info(
+ address, source_type, source_name, manufacturer, model, hardware_version,
+ software_version);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:5
+ *
+ * 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.
+#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
+#include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
+#include "common/metrics.h"
+#include "main/shim/metrics_api.h"
+#include "main/shim/shim.h"
+#include "stack/include/stack_metrics_logging.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_metrics_logging {
+
+// Shared state between mocked functions and tests
+// Name: log_classic_pairing_event
+// Params: const RawAddress& address, uint16_t handle, uint32_t hci_cmd,
+// uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, int64_t
+// event_value Returns: void
+struct log_classic_pairing_event {
+ std::function<void(const RawAddress& address, uint16_t handle,
+ uint32_t hci_cmd, uint16_t hci_event, uint16_t cmd_status,
+ uint16_t reason_code, int64_t event_value)>
+ body{[](const RawAddress& address, uint16_t handle, uint32_t hci_cmd,
+ uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code,
+ int64_t event_value) {}};
+ void operator()(const RawAddress& address, uint16_t handle, uint32_t hci_cmd,
+ uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code,
+ int64_t event_value) {
+ body(address, handle, hci_cmd, hci_event, cmd_status, reason_code,
+ event_value);
+ };
+};
+extern struct log_classic_pairing_event log_classic_pairing_event;
+// Name: log_link_layer_connection_event
+// Params: const RawAddress* address, uint32_t connection_handle,
+// android::bluetooth::DirectionEnum direction, uint16_t link_type, uint32_t
+// hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, uint16_t cmd_status,
+// uint16_t reason_code Returns: void
+struct log_link_layer_connection_event {
+ std::function<void(const RawAddress* address, uint32_t connection_handle,
+ android::bluetooth::DirectionEnum direction,
+ uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event,
+ uint16_t hci_ble_event, uint16_t cmd_status,
+ uint16_t reason_code)>
+ body{[](const RawAddress* address, uint32_t connection_handle,
+ android::bluetooth::DirectionEnum direction, uint16_t link_type,
+ uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
+ uint16_t cmd_status, uint16_t reason_code) {}};
+ void operator()(const RawAddress* address, uint32_t connection_handle,
+ android::bluetooth::DirectionEnum direction,
+ uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event,
+ uint16_t hci_ble_event, uint16_t cmd_status,
+ uint16_t reason_code) {
+ body(address, connection_handle, direction, link_type, hci_cmd, hci_event,
+ hci_ble_event, cmd_status, reason_code);
+ };
+};
+extern struct log_link_layer_connection_event log_link_layer_connection_event;
+// Name: log_smp_pairing_event
+// Params: const RawAddress& address, uint8_t smp_cmd,
+// android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason Returns:
+// void
+struct log_smp_pairing_event {
+ std::function<void(const RawAddress& address, uint8_t smp_cmd,
+ android::bluetooth::DirectionEnum direction,
+ uint8_t smp_fail_reason)>
+ body{[](const RawAddress& address, uint8_t smp_cmd,
+ android::bluetooth::DirectionEnum direction,
+ uint8_t smp_fail_reason) {}};
+ void operator()(const RawAddress& address, uint8_t smp_cmd,
+ android::bluetooth::DirectionEnum direction,
+ uint8_t smp_fail_reason) {
+ body(address, smp_cmd, direction, smp_fail_reason);
+ };
+};
+extern struct log_smp_pairing_event log_smp_pairing_event;
+// Name: log_sdp_attribute
+// Params: const RawAddress& address, uint16_t protocol_uuid, uint16_t
+// attribute_id, size_t attribute_size, const char* attribute_value Returns:
+// void
+struct log_sdp_attribute {
+ std::function<void(const RawAddress& address, uint16_t protocol_uuid,
+ uint16_t attribute_id, size_t attribute_size,
+ const char* attribute_value)>
+ body{[](const RawAddress& address, uint16_t protocol_uuid,
+ uint16_t attribute_id, size_t attribute_size,
+ const char* attribute_value) {}};
+ void operator()(const RawAddress& address, uint16_t protocol_uuid,
+ uint16_t attribute_id, size_t attribute_size,
+ const char* attribute_value) {
+ body(address, protocol_uuid, attribute_id, attribute_size, attribute_value);
+ };
+};
+extern struct log_sdp_attribute log_sdp_attribute;
+// Name: log_manufacturer_info
+// Params: const RawAddress& address, android::bluetooth::DeviceInfoSrcEnum
+// source_type, const std::string& source_name, const std::string& manufacturer,
+// const std::string& model, const std::string& hardware_version, const
+// std::string& software_version Returns: void
+struct log_manufacturer_info {
+ std::function<void(const RawAddress& address,
+ android::bluetooth::DeviceInfoSrcEnum source_type,
+ const std::string& source_name,
+ const std::string& manufacturer, const std::string& model,
+ const std::string& hardware_version,
+ const std::string& software_version)>
+ body{[](const RawAddress& address,
+ android::bluetooth::DeviceInfoSrcEnum source_type,
+ const std::string& source_name, const std::string& manufacturer,
+ const std::string& model, const std::string& hardware_version,
+ const std::string& software_version) {}};
+ void operator()(const RawAddress& address,
+ android::bluetooth::DeviceInfoSrcEnum source_type,
+ const std::string& source_name,
+ const std::string& manufacturer, const std::string& model,
+ const std::string& hardware_version,
+ const std::string& software_version) {
+ body(address, source_type, source_name, manufacturer, model,
+ hardware_version, software_version);
+ };
+};
+extern struct log_manufacturer_info log_manufacturer_info;
+
+} // namespace stack_metrics_logging
+} // namespace mock
+} // namespace test
+
+// END mockcify generation
\ No newline at end of file
--- /dev/null
+/*
+ * 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:71
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+
+// Mock include file to share data between tests and mock
+#include "test/mock/mock_stack_smp_act.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+// Mocked internal structures, if any
+
+namespace test {
+namespace mock {
+namespace stack_smp_act {
+
+// Function state capture and return values, if needed
+struct smp_send_app_cback smp_send_app_cback;
+struct smp_send_pair_fail smp_send_pair_fail;
+struct smp_send_pair_req smp_send_pair_req;
+struct smp_send_pair_rsp smp_send_pair_rsp;
+struct smp_send_confirm smp_send_confirm;
+struct smp_send_init smp_send_init;
+struct smp_send_rand smp_send_rand;
+struct smp_send_pair_public_key smp_send_pair_public_key;
+struct smp_send_commitment smp_send_commitment;
+struct smp_send_dhkey_check smp_send_dhkey_check;
+struct smp_send_keypress_notification smp_send_keypress_notification;
+struct smp_send_enc_info smp_send_enc_info;
+struct smp_send_id_info smp_send_id_info;
+struct smp_send_csrk_info smp_send_csrk_info;
+struct smp_send_ltk_reply smp_send_ltk_reply;
+struct smp_proc_sec_req smp_proc_sec_req;
+struct smp_proc_sec_grant smp_proc_sec_grant;
+struct smp_proc_pair_fail smp_proc_pair_fail;
+struct smp_proc_pair_cmd smp_proc_pair_cmd;
+struct smp_proc_confirm smp_proc_confirm;
+struct smp_proc_init smp_proc_init;
+struct smp_proc_rand smp_proc_rand;
+struct smp_process_pairing_public_key smp_process_pairing_public_key;
+struct smp_process_pairing_commitment smp_process_pairing_commitment;
+struct smp_process_dhkey_check smp_process_dhkey_check;
+struct smp_process_keypress_notification smp_process_keypress_notification;
+struct smp_br_process_pairing_command smp_br_process_pairing_command;
+struct smp_br_process_security_grant smp_br_process_security_grant;
+struct smp_br_check_authorization_request smp_br_check_authorization_request;
+struct smp_br_select_next_key smp_br_select_next_key;
+struct smp_proc_enc_info smp_proc_enc_info;
+struct smp_proc_central_id smp_proc_central_id;
+struct smp_proc_id_info smp_proc_id_info;
+struct smp_proc_id_addr smp_proc_id_addr;
+struct smp_proc_srk_info smp_proc_srk_info;
+struct smp_proc_compare smp_proc_compare;
+struct smp_proc_sl_key smp_proc_sl_key;
+struct smp_start_enc smp_start_enc;
+struct smp_proc_discard smp_proc_discard;
+struct smp_enc_cmpl smp_enc_cmpl;
+struct smp_check_auth_req smp_check_auth_req;
+struct smp_key_pick_key smp_key_pick_key;
+struct smp_key_distribution smp_key_distribution;
+struct smp_decide_association_model smp_decide_association_model;
+struct smp_process_io_response smp_process_io_response;
+struct smp_br_process_peripheral_keys_response
+ smp_br_process_peripheral_keys_response;
+struct smp_br_send_pair_response smp_br_send_pair_response;
+struct smp_pairing_cmpl smp_pairing_cmpl;
+struct smp_pair_terminate smp_pair_terminate;
+struct smp_idle_terminate smp_idle_terminate;
+struct smp_both_have_public_keys smp_both_have_public_keys;
+struct smp_start_secure_connection_phase1 smp_start_secure_connection_phase1;
+struct smp_process_local_nonce smp_process_local_nonce;
+struct smp_process_peer_nonce smp_process_peer_nonce;
+struct smp_match_dhkey_checks smp_match_dhkey_checks;
+struct smp_move_to_secure_connections_phase2
+ smp_move_to_secure_connections_phase2;
+struct smp_phase_2_dhkey_checks_are_present
+ smp_phase_2_dhkey_checks_are_present;
+struct smp_wait_for_both_public_keys smp_wait_for_both_public_keys;
+struct smp_start_passkey_verification smp_start_passkey_verification;
+struct smp_process_secure_connection_oob_data
+ smp_process_secure_connection_oob_data;
+struct smp_set_local_oob_keys smp_set_local_oob_keys;
+struct smp_set_local_oob_random_commitment smp_set_local_oob_random_commitment;
+struct smp_link_encrypted smp_link_encrypted;
+struct smp_cancel_start_encryption_attempt smp_cancel_start_encryption_attempt;
+struct smp_proc_ltk_request smp_proc_ltk_request;
+struct smp_process_secure_connection_long_term_key
+ smp_process_secure_connection_long_term_key;
+struct smp_set_derive_link_key smp_set_derive_link_key;
+struct smp_derive_link_key_from_long_term_key
+ smp_derive_link_key_from_long_term_key;
+struct smp_br_process_link_key smp_br_process_link_key;
+struct smp_key_distribution_by_transport smp_key_distribution_by_transport;
+struct smp_br_pairing_complete smp_br_pairing_complete;
+
+} // namespace stack_smp_act
+} // namespace mock
+} // namespace test
+
+// Mocked functions, if any
+void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_app_cback(p_cb, p_data);
+}
+void smp_send_pair_fail(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_pair_fail(p_cb, p_data);
+}
+void smp_send_pair_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_pair_req(p_cb, p_data);
+}
+void smp_send_pair_rsp(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_pair_rsp(p_cb, p_data);
+}
+void smp_send_confirm(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_confirm(p_cb, p_data);
+}
+void smp_send_init(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_init(p_cb, p_data);
+}
+void smp_send_rand(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_rand(p_cb, p_data);
+}
+void smp_send_pair_public_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_pair_public_key(p_cb, p_data);
+}
+void smp_send_commitment(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_commitment(p_cb, p_data);
+}
+void smp_send_dhkey_check(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_dhkey_check(p_cb, p_data);
+}
+void smp_send_keypress_notification(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_keypress_notification(p_cb, p_data);
+}
+void smp_send_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_enc_info(p_cb, p_data);
+}
+void smp_send_id_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_id_info(p_cb, p_data);
+}
+void smp_send_csrk_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_csrk_info(p_cb, p_data);
+}
+void smp_send_ltk_reply(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_send_ltk_reply(p_cb, p_data);
+}
+void smp_proc_sec_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_sec_req(p_cb, p_data);
+}
+void smp_proc_sec_grant(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_sec_grant(p_cb, p_data);
+}
+void smp_proc_pair_fail(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_pair_fail(p_cb, p_data);
+}
+void smp_proc_pair_cmd(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_pair_cmd(p_cb, p_data);
+}
+void smp_proc_confirm(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_confirm(p_cb, p_data);
+}
+void smp_proc_init(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_init(p_cb, p_data);
+}
+void smp_proc_rand(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_rand(p_cb, p_data);
+}
+void smp_process_pairing_public_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_pairing_public_key(p_cb, p_data);
+}
+void smp_process_pairing_commitment(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_pairing_commitment(p_cb, p_data);
+}
+void smp_process_dhkey_check(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_dhkey_check(p_cb, p_data);
+}
+void smp_process_keypress_notification(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_keypress_notification(p_cb, p_data);
+}
+void smp_br_process_pairing_command(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_process_pairing_command(p_cb, p_data);
+}
+void smp_br_process_security_grant(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_process_security_grant(p_cb, p_data);
+}
+void smp_br_check_authorization_request(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_check_authorization_request(p_cb, p_data);
+}
+void smp_br_select_next_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_select_next_key(p_cb, p_data);
+}
+void smp_proc_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_enc_info(p_cb, p_data);
+}
+void smp_proc_central_id(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_central_id(p_cb, p_data);
+}
+void smp_proc_id_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_id_info(p_cb, p_data);
+}
+void smp_proc_id_addr(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_id_addr(p_cb, p_data);
+}
+void smp_proc_srk_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_srk_info(p_cb, p_data);
+}
+void smp_proc_compare(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_compare(p_cb, p_data);
+}
+void smp_proc_sl_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_sl_key(p_cb, p_data);
+}
+void smp_start_enc(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_start_enc(p_cb, p_data);
+}
+void smp_proc_discard(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_proc_discard(p_cb, p_data);
+}
+void smp_enc_cmpl(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_enc_cmpl(p_cb, p_data);
+}
+void smp_check_auth_req(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_check_auth_req(p_cb, p_data);
+}
+void smp_key_pick_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_key_pick_key(p_cb, p_data);
+}
+void smp_key_distribution(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_key_distribution(p_cb, p_data);
+}
+void smp_decide_association_model(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_decide_association_model(p_cb, p_data);
+}
+void smp_process_io_response(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_io_response(p_cb, p_data);
+}
+void smp_br_process_peripheral_keys_response(tSMP_CB* p_cb,
+ tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_process_peripheral_keys_response(p_cb,
+ p_data);
+}
+void smp_br_send_pair_response(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_send_pair_response(p_cb, p_data);
+}
+void smp_pairing_cmpl(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_pairing_cmpl(p_cb, p_data);
+}
+void smp_pair_terminate(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_pair_terminate(p_cb, p_data);
+}
+void smp_idle_terminate(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_idle_terminate(p_cb, p_data);
+}
+void smp_both_have_public_keys(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_both_have_public_keys(p_cb, p_data);
+}
+void smp_start_secure_connection_phase1(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_start_secure_connection_phase1(p_cb, p_data);
+}
+void smp_process_local_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_local_nonce(p_cb, p_data);
+}
+void smp_process_peer_nonce(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_peer_nonce(p_cb, p_data);
+}
+void smp_match_dhkey_checks(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_match_dhkey_checks(p_cb, p_data);
+}
+void smp_move_to_secure_connections_phase2(tSMP_CB* p_cb,
+ tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_move_to_secure_connections_phase2(p_cb,
+ p_data);
+}
+void smp_phase_2_dhkey_checks_are_present(tSMP_CB* p_cb,
+ tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_phase_2_dhkey_checks_are_present(p_cb, p_data);
+}
+void smp_wait_for_both_public_keys(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_wait_for_both_public_keys(p_cb, p_data);
+}
+void smp_start_passkey_verification(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_start_passkey_verification(p_cb, p_data);
+}
+void smp_process_secure_connection_oob_data(tSMP_CB* p_cb,
+ tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_secure_connection_oob_data(p_cb,
+ p_data);
+}
+void smp_set_local_oob_keys(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_set_local_oob_keys(p_cb, p_data);
+}
+void smp_set_local_oob_random_commitment(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_set_local_oob_random_commitment(p_cb, p_data);
+}
+void smp_link_encrypted(const RawAddress& bda, uint8_t encr_enable) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_link_encrypted(bda, encr_enable);
+}
+void smp_cancel_start_encryption_attempt() {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_cancel_start_encryption_attempt();
+}
+bool smp_proc_ltk_request(const RawAddress& bda) {
+ mock_function_count_map[__func__]++;
+ return test::mock::stack_smp_act::smp_proc_ltk_request(bda);
+}
+void smp_process_secure_connection_long_term_key(void) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_process_secure_connection_long_term_key();
+}
+void smp_set_derive_link_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_set_derive_link_key(p_cb, p_data);
+}
+void smp_derive_link_key_from_long_term_key(tSMP_CB* p_cb,
+ tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_derive_link_key_from_long_term_key(p_cb,
+ p_data);
+}
+void smp_br_process_link_key(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_process_link_key(p_cb, p_data);
+}
+void smp_key_distribution_by_transport(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_key_distribution_by_transport(p_cb, p_data);
+}
+void smp_br_pairing_complete(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
+ mock_function_count_map[__func__]++;
+ test::mock::stack_smp_act::smp_br_pairing_complete(p_cb, p_data);
+}
+
+// END mockcify generation
--- /dev/null
+/*
+ * 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:71
+ *
+ * mockcify.pl ver 0.2
+ */
+
+#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 the inclusion set.
+#include "btif/include/btif_api.h"
+#include "stack/smp/smp_int.h"
+#include "types/raw_address.h"
+
+// Mocked compile conditionals, if any
+#ifndef UNUSED_ATTR
+#define UNUSED_ATTR
+#endif
+
+namespace test {
+namespace mock {
+namespace stack_smp_act {
+
+// Shared state between mocked functions and tests
+// Name: smp_send_app_cback
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_app_cback {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_app_cback smp_send_app_cback;
+// Name: smp_send_pair_fail
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_pair_fail {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_pair_fail smp_send_pair_fail;
+// Name: smp_send_pair_req
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_pair_req {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_pair_req smp_send_pair_req;
+// Name: smp_send_pair_rsp
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_pair_rsp {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_pair_rsp smp_send_pair_rsp;
+// Name: smp_send_confirm
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_confirm {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_confirm smp_send_confirm;
+// Name: smp_send_init
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_init {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_init smp_send_init;
+// Name: smp_send_rand
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_rand {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_rand smp_send_rand;
+// Name: smp_send_pair_public_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_pair_public_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_pair_public_key smp_send_pair_public_key;
+// Name: smp_send_commitment
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_commitment {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_commitment smp_send_commitment;
+// Name: smp_send_dhkey_check
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_dhkey_check {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_dhkey_check smp_send_dhkey_check;
+// Name: smp_send_keypress_notification
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_keypress_notification {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_keypress_notification smp_send_keypress_notification;
+// Name: smp_send_enc_info
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_enc_info {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_enc_info smp_send_enc_info;
+// Name: smp_send_id_info
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_id_info {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_id_info smp_send_id_info;
+// Name: smp_send_csrk_info
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_csrk_info {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_csrk_info smp_send_csrk_info;
+// Name: smp_send_ltk_reply
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_send_ltk_reply {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_send_ltk_reply smp_send_ltk_reply;
+// Name: smp_proc_sec_req
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_sec_req {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_sec_req smp_proc_sec_req;
+// Name: smp_proc_sec_grant
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_sec_grant {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_sec_grant smp_proc_sec_grant;
+// Name: smp_proc_pair_fail
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_pair_fail {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_pair_fail smp_proc_pair_fail;
+// Name: smp_proc_pair_cmd
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_pair_cmd {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_pair_cmd smp_proc_pair_cmd;
+// Name: smp_proc_confirm
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_confirm {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_confirm smp_proc_confirm;
+// Name: smp_proc_init
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_init {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_init smp_proc_init;
+// Name: smp_proc_rand
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_rand {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_rand smp_proc_rand;
+// Name: smp_process_pairing_public_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_pairing_public_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_pairing_public_key smp_process_pairing_public_key;
+// Name: smp_process_pairing_commitment
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_pairing_commitment {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_pairing_commitment smp_process_pairing_commitment;
+// Name: smp_process_dhkey_check
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_dhkey_check {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_dhkey_check smp_process_dhkey_check;
+// Name: smp_process_keypress_notification
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_keypress_notification {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_keypress_notification
+ smp_process_keypress_notification;
+// Name: smp_br_process_pairing_command
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_process_pairing_command {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_process_pairing_command smp_br_process_pairing_command;
+// Name: smp_br_process_security_grant
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_process_security_grant {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_process_security_grant smp_br_process_security_grant;
+// Name: smp_br_check_authorization_request
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_check_authorization_request {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_check_authorization_request
+ smp_br_check_authorization_request;
+// Name: smp_br_select_next_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_select_next_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_select_next_key smp_br_select_next_key;
+// Name: smp_proc_enc_info
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_enc_info {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_enc_info smp_proc_enc_info;
+// Name: smp_proc_central_id
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_central_id {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_central_id smp_proc_central_id;
+// Name: smp_proc_id_info
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_id_info {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_id_info smp_proc_id_info;
+// Name: smp_proc_id_addr
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_id_addr {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_id_addr smp_proc_id_addr;
+// Name: smp_proc_srk_info
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_srk_info {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_srk_info smp_proc_srk_info;
+// Name: smp_proc_compare
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_compare {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_compare smp_proc_compare;
+// Name: smp_proc_sl_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_sl_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_sl_key smp_proc_sl_key;
+// Name: smp_start_enc
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_start_enc {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_start_enc smp_start_enc;
+// Name: smp_proc_discard
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_proc_discard {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_proc_discard smp_proc_discard;
+// Name: smp_enc_cmpl
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_enc_cmpl {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_enc_cmpl smp_enc_cmpl;
+// Name: smp_check_auth_req
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_check_auth_req {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_check_auth_req smp_check_auth_req;
+// Name: smp_key_pick_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_key_pick_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_key_pick_key smp_key_pick_key;
+// Name: smp_key_distribution
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_key_distribution {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_key_distribution smp_key_distribution;
+// Name: smp_decide_association_model
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_decide_association_model {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_decide_association_model smp_decide_association_model;
+// Name: smp_process_io_response
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_io_response {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_io_response smp_process_io_response;
+// Name: smp_br_process_peripheral_keys_response
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_process_peripheral_keys_response {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_process_peripheral_keys_response
+ smp_br_process_peripheral_keys_response;
+// Name: smp_br_send_pair_response
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_send_pair_response {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_send_pair_response smp_br_send_pair_response;
+// Name: smp_pairing_cmpl
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_pairing_cmpl {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_pairing_cmpl smp_pairing_cmpl;
+// Name: smp_pair_terminate
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_pair_terminate {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_pair_terminate smp_pair_terminate;
+// Name: smp_idle_terminate
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_idle_terminate {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_idle_terminate smp_idle_terminate;
+// Name: smp_both_have_public_keys
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_both_have_public_keys {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_both_have_public_keys smp_both_have_public_keys;
+// Name: smp_start_secure_connection_phase1
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_start_secure_connection_phase1 {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_start_secure_connection_phase1
+ smp_start_secure_connection_phase1;
+// Name: smp_process_local_nonce
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_local_nonce {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_local_nonce smp_process_local_nonce;
+// Name: smp_process_peer_nonce
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_peer_nonce {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_peer_nonce smp_process_peer_nonce;
+// Name: smp_match_dhkey_checks
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_match_dhkey_checks {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_match_dhkey_checks smp_match_dhkey_checks;
+// Name: smp_move_to_secure_connections_phase2
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_move_to_secure_connections_phase2 {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_move_to_secure_connections_phase2
+ smp_move_to_secure_connections_phase2;
+// Name: smp_phase_2_dhkey_checks_are_present
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_phase_2_dhkey_checks_are_present {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_phase_2_dhkey_checks_are_present
+ smp_phase_2_dhkey_checks_are_present;
+// Name: smp_wait_for_both_public_keys
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_wait_for_both_public_keys {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_wait_for_both_public_keys smp_wait_for_both_public_keys;
+// Name: smp_start_passkey_verification
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_start_passkey_verification {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_start_passkey_verification smp_start_passkey_verification;
+// Name: smp_process_secure_connection_oob_data
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_process_secure_connection_oob_data {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_process_secure_connection_oob_data
+ smp_process_secure_connection_oob_data;
+// Name: smp_set_local_oob_keys
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_set_local_oob_keys {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_set_local_oob_keys smp_set_local_oob_keys;
+// Name: smp_set_local_oob_random_commitment
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_set_local_oob_random_commitment {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_set_local_oob_random_commitment
+ smp_set_local_oob_random_commitment;
+// Name: smp_link_encrypted
+// Params: const RawAddress& bda, uint8_t encr_enable
+// Returns: void
+struct smp_link_encrypted {
+ std::function<void(const RawAddress& bda, uint8_t encr_enable)> body{
+ [](const RawAddress& bda, uint8_t encr_enable) {}};
+ void operator()(const RawAddress& bda, uint8_t encr_enable) {
+ body(bda, encr_enable);
+ };
+};
+extern struct smp_link_encrypted smp_link_encrypted;
+// Name: smp_cancel_start_encryption_attempt
+// Params:
+// Returns: void
+struct smp_cancel_start_encryption_attempt {
+ std::function<void()> body{[]() {}};
+ void operator()() { body(); };
+};
+extern struct smp_cancel_start_encryption_attempt
+ smp_cancel_start_encryption_attempt;
+// Name: smp_proc_ltk_request
+// Params: const RawAddress& bda
+// Returns: bool
+struct smp_proc_ltk_request {
+ std::function<bool(const RawAddress& bda)> body{
+ [](const RawAddress& bda) { return false; }};
+ bool operator()(const RawAddress& bda) { return body(bda); };
+};
+extern struct smp_proc_ltk_request smp_proc_ltk_request;
+// Name: smp_process_secure_connection_long_term_key
+// Params: void
+// Returns: void
+struct smp_process_secure_connection_long_term_key {
+ std::function<void(void)> body{[](void) {}};
+ void operator()(void) { body(); };
+};
+extern struct smp_process_secure_connection_long_term_key
+ smp_process_secure_connection_long_term_key;
+// Name: smp_set_derive_link_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_set_derive_link_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_set_derive_link_key smp_set_derive_link_key;
+// Name: smp_derive_link_key_from_long_term_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_derive_link_key_from_long_term_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_derive_link_key_from_long_term_key
+ smp_derive_link_key_from_long_term_key;
+// Name: smp_br_process_link_key
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_process_link_key {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_process_link_key smp_br_process_link_key;
+// Name: smp_key_distribution_by_transport
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_key_distribution_by_transport {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_key_distribution_by_transport
+ smp_key_distribution_by_transport;
+// Name: smp_br_pairing_complete
+// Params: tSMP_CB* p_cb, tSMP_INT_DATA* p_data
+// Returns: void
+struct smp_br_pairing_complete {
+ std::function<void(tSMP_CB* p_cb, tSMP_INT_DATA* p_data)> body{
+ [](tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {}};
+ void operator()(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { body(p_cb, p_data); };
+};
+extern struct smp_br_pairing_complete smp_br_pairing_complete;
+
+} // namespace stack_smp_act
+} // namespace mock
+} // namespace test
+
+// END mockcify generation