diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-11-04 18:23:57 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-11-04 18:23:57 +0000 |
commit | 24862207293f2dc67b59ae65406e971059973c92 (patch) | |
tree | 53d7b79f080ec59d7437ff7bad930c979db7abcb | |
parent | 4cf33852e3601e80e5b4e800b7c779b38036278a (diff) | |
parent | 6922781ab115dd7175c55f6767326801a3b4ad78 (diff) | |
download | bt-24862207293f2dc67b59ae65406e971059973c92.tar.gz |
Merge "RootCanal: AddressResolutionEnable"
3 files changed, 21 insertions, 6 deletions
diff --git a/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc b/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc index 654aeac71..6cd3fc5df 100644 --- a/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +++ b/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc @@ -1611,12 +1611,16 @@ void DualModeController::LeReadBufferSizeV2(CommandView command) { } void DualModeController::LeSetAddressResolutionEnable(CommandView command) { - // NOP - auto payload = - std::make_unique<bluetooth::packet::RawBuilder>(std::vector<uint8_t>( - {static_cast<uint8_t>(bluetooth::hci::ErrorCode::SUCCESS)})); - send_event_(bluetooth::hci::CommandCompleteBuilder::Create( - kNumCommandPackets, command.GetOpCode(), std::move(payload))); + auto command_view = gd_hci::LeSetAddressResolutionEnableView::Create( + gd_hci::LeSecurityCommandView::Create( + gd_hci::SecurityCommandView::Create(command))); + ASSERT(command_view.IsValid()); + auto status = link_layer_controller_.LeSetAddressResolutionEnable( + command_view.GetAddressResolutionEnable() == + bluetooth::hci::Enable::ENABLED); + send_event_( + bluetooth::hci::LeSetAddressResolutionEnableCompleteBuilder::Create( + kNumCommandPackets, status)); } void DualModeController::LeSetResovalablePrivateAddressTimeout(CommandView command) { diff --git a/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc b/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc index b0cc1170d..091b700ed 100644 --- a/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +++ b/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc @@ -2876,6 +2876,15 @@ ErrorCode LinkLayerController::LeConnectListClear() { return ErrorCode::SUCCESS; } +ErrorCode LinkLayerController::LeSetAddressResolutionEnable(bool enable) { + if (ResolvingListBusy()) { + return ErrorCode::COMMAND_DISALLOWED; + } + + le_resolving_list_enabled_ = enable; + return ErrorCode::SUCCESS; +} + ErrorCode LinkLayerController::LeResolvingListClear() { if (ResolvingListBusy()) { return ErrorCode::COMMAND_DISALLOWED; diff --git a/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h b/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h index 8693add30..f3ab29892 100644 --- a/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h +++ b/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h @@ -181,6 +181,7 @@ class LinkLayerController { bool LeConnectListContainsDevice(Address addr, uint8_t addr_type); bool LeConnectListFull(); bool ResolvingListBusy(); + ErrorCode LeSetAddressResolutionEnable(bool enable); ErrorCode LeResolvingListClear(); ErrorCode LeResolvingListAddDevice(Address addr, uint8_t addr_type, std::array<uint8_t, kIrkSize> peerIrk, @@ -463,6 +464,7 @@ class LinkLayerController { std::array<uint8_t, kIrkSize> local_irk; }; std::vector<ResolvingListEntry> le_resolving_list_; + bool le_resolving_list_enabled_{false}; std::array<LeAdvertiser, 7> advertisers_; |