diff options
author | 2024-05-22 09:12:06 -0700 | |
---|---|---|
committer | 2024-05-22 09:36:18 -0700 | |
commit | 06867de316d738e6a6b859ccc27b6a01dad26cbe (patch) | |
tree | 22b66b7e3bde0c02f4662ebe918d4daed663ae04 /tools | |
parent | 35ddefcd53ad371beac01cd871a887183bf560ee (diff) |
RootCanal: Send well formatted Apcf command complete event
The android stack panics if the LE Apcf Transport Discovery Service
command complete event is shortened, even with an error status code
Bug: 336513624
Test: m root-canal
Flag: EXEMPT, tool change
Change-Id: I3a0e7c954ba21d4f89b7dbd7e0b8fa7ae613e337
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rootcanal/model/controller/dual_mode_controller.cc | 10 | ||||
-rw-r--r-- | tools/rootcanal/packets/hci_packets.pdl | 11 |
2 files changed, 19 insertions, 2 deletions
diff --git a/tools/rootcanal/model/controller/dual_mode_controller.cc b/tools/rootcanal/model/controller/dual_mode_controller.cc index dbf888f52d..a7b106b3d7 100644 --- a/tools/rootcanal/model/controller/dual_mode_controller.cc +++ b/tools/rootcanal/model/controller/dual_mode_controller.cc @@ -3108,11 +3108,17 @@ void DualModeController::LeApcf(CommandView command) { break; } case bluetooth::hci::ApcfOpcode::TRANSPORT_DISCOVERY_SERVICE: { + auto subcommand_view = + bluetooth::hci::LeApcfServiceDataView::Create(command_view); + CHECK_PACKET_VIEW(subcommand_view); + DEBUG(id_, "<< LE APCF Transport Discovery Service"); + DEBUG(id_, " action={}", + bluetooth::hci::ApcfActionText(subcommand_view.GetApcfAction())); - send_event_(bluetooth::hci::LeApcfCompleteBuilder::Create( + send_event_(bluetooth::hci::LeApcfTransportDiscoveryServiceCompleteBuilder::Create( kNumCommandPackets, ErrorCode::INVALID_HCI_COMMAND_PARAMETERS, - command_view.GetApcfOpcode(), std::vector<uint8_t>{})); + subcommand_view.GetApcfAction(), 0)); break; } case bluetooth::hci::ApcfOpcode::AD_TYPE_FILTER: { diff --git a/tools/rootcanal/packets/hci_packets.pdl b/tools/rootcanal/packets/hci_packets.pdl index 363002aa48..2b404bdff1 100644 --- a/tools/rootcanal/packets/hci_packets.pdl +++ b/tools/rootcanal/packets/hci_packets.pdl @@ -5995,6 +5995,17 @@ packet LeApcfAdTypeFilterComplete : LeApcfComplete (apcf_opcode = AD_TYPE_FILTER apcf_available_spaces : 8, } +packet LeApcfTransportDiscoveryService : LeApcf (apcf_opcode = TRANSPORT_DISCOVERY_SERVICE) { + apcf_action : ApcfAction, + apcf_filter_index : 8, + apcf_transport_discovery_data : 8[], +} + +packet LeApcfTransportDiscoveryServiceComplete : LeApcfComplete (apcf_opcode = TRANSPORT_DISCOVERY_SERVICE) { + apcf_action : ApcfAction, + apcf_available_spaces : 8, +} + packet LeApcfReadExtendedFeatures : LeApcf (apcf_opcode = READ_EXTENDED_FEATURES) { } |