aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-11-01 18:52:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-11-01 18:52:15 +0000
commitedb3d34aa19843717a6b3b473a9cbcdc6eadd4b7 (patch)
tree509a812d145f343c564d6d97c35ef2311dae4470
parentb19a1ee1379b0d8737b672bf21c45e07494ded31 (diff)
parentcb3ab1dc63a1bf6eb95427b2476212b23f872907 (diff)
downloadbt-edb3d34aa19843717a6b3b473a9cbcdc6eadd4b7.tar.gz
Merge "Plumb address resolution through main"
-rw-r--r--main/shim/acl_api.cc19
-rw-r--r--main/shim/acl_api.h7
-rw-r--r--test/mock/mock_main_shim_acl_api.cc15
3 files changed, 41 insertions, 0 deletions
diff --git a/main/shim/acl_api.cc b/main/shim/acl_api.cc
index 8c614885e..d7f47fbdc 100644
--- a/main/shim/acl_api.cc
+++ b/main/shim/acl_api.cc
@@ -107,3 +107,22 @@ void bluetooth::shim::ACL_ReadConnectionAddress(const RawAddress& pseudo_addr,
conn_addr = ToRawAddress(local_address.GetAddress());
*p_addr_type = static_cast<uint8_t>(local_address.GetAddressType());
}
+
+void bluetooth::shim::ACL_AddToAddressResolution(
+ const tBLE_BD_ADDR& legacy_address_with_type, const Octet16& peer_irk,
+ const Octet16& local_irk) {
+ Stack::GetInstance()->GetAcl()->AddToAddressResolution(
+ ToAddressWithType(legacy_address_with_type.bda,
+ legacy_address_with_type.type),
+ peer_irk, local_irk);
+}
+
+void bluetooth::shim::ACL_RemoveFromAddressResolution(
+ const tBLE_BD_ADDR& legacy_address_with_type) {
+ Stack::GetInstance()->GetAcl()->RemoveFromAddressResolution(ToAddressWithType(
+ legacy_address_with_type.bda, legacy_address_with_type.type));
+}
+
+void bluetooth::shim::ACL_ClearAddressResolution() {
+ Stack::GetInstance()->GetAcl()->ClearAddressResolution();
+}
diff --git a/main/shim/acl_api.h b/main/shim/acl_api.h
index 06afdd96d..ee9f3f4da 100644
--- a/main/shim/acl_api.h
+++ b/main/shim/acl_api.h
@@ -40,5 +40,12 @@ void ACL_IgnoreAllLeConnections();
void ACL_ReadConnectionAddress(const RawAddress& pseudo_addr,
RawAddress& conn_addr, uint8_t* p_addr_type);
+void ACL_AddToAddressResolution(const tBLE_BD_ADDR& legacy_address_with_type,
+ const Octet16& peer_irk,
+ const Octet16& local_irk);
+void ACL_RemoveFromAddressResolution(
+ const tBLE_BD_ADDR& legacy_address_with_type);
+void ACL_ClearAddressResolution();
+
} // namespace shim
} // namespace bluetooth
diff --git a/test/mock/mock_main_shim_acl_api.cc b/test/mock/mock_main_shim_acl_api.cc
index 8c82df426..87da74f1b 100644
--- a/test/mock/mock_main_shim_acl_api.cc
+++ b/test/mock/mock_main_shim_acl_api.cc
@@ -29,6 +29,7 @@ extern std::map<std::string, int> mock_function_count_map;
#include "main/shim/acl_api.h"
#include "stack/include/bt_hdr.h"
+#include "stack/include/bt_octets.h"
#include "types/ble_address_with_type.h"
#include "types/raw_address.h"
@@ -71,3 +72,17 @@ void bluetooth::shim::ACL_ReadConnectionAddress(const RawAddress& pseudo_addr,
uint8_t* p_addr_type) {
mock_function_count_map[__func__]++;
}
+
+void bluetooth::shim::ACL_AddToAddressResolution(
+ const tBLE_BD_ADDR& legacy_address_with_type, const Octet16& peer_irk,
+ const Octet16& local_irk) {
+ mock_function_count_map[__func__]++;
+}
+
+void bluetooth::shim::ACL_RemoveFromAddressResolution(
+ const tBLE_BD_ADDR& legacy_address_with_type) {
+ mock_function_count_map[__func__]++;
+}
+void bluetooth::shim::ACL_ClearAddressResolution() {
+ mock_function_count_map[__func__]++;
+}