diff options
author | 2025-01-28 16:29:28 -0800 | |
---|---|---|
committer | 2025-01-28 16:29:28 -0800 | |
commit | 9ce432a98a46a0b9989a644571c216282d9377d5 (patch) | |
tree | 14fe4d9080f70bf2be5017d9946777c0a3aa670a | |
parent | 2e00ab919ab25f60bc02c3e02780634f6c8f6e06 (diff) | |
parent | b6245f8beee5e87e66659d54136bc9714826585f (diff) |
Merge changes I258a2a3e,Ibfacbc9d into main
* changes:
RootCanal: Update controller_info.py script
RootCanal: Add INTEL_BE200 controller preset
8 files changed, 84 insertions, 28 deletions
diff --git a/android/pandora/mmi2grpc/mmi2grpc/_rootcanal.py b/android/pandora/mmi2grpc/mmi2grpc/_rootcanal.py index 42ef33f68b..5f68da54f7 100644 --- a/android/pandora/mmi2grpc/mmi2grpc/_rootcanal.py +++ b/android/pandora/mmi2grpc/mmi2grpc/_rootcanal.py @@ -92,6 +92,7 @@ class Dongle(enum.Enum): DEFAULT = "default" LAIRD_BL654 = "laird_bl654" CSR_RCK_PTS_DONGLE = "csr_rck_pts_dongle" + INTEL_BE200 = "intel_be200" class RootCanal: diff --git a/tools/rootcanal/model/controller/controller_properties.cc b/tools/rootcanal/model/controller/controller_properties.cc index 26718a9747..3f6c918bfe 100644 --- a/tools/rootcanal/model/controller/controller_properties.cc +++ b/tools/rootcanal/model/controller/controller_properties.cc @@ -1743,6 +1743,40 @@ ControllerProperties::ControllerProperties(rootcanal::configuration::Controller le_supported_states = 0x3ffffffffff; break; + case ControllerPreset::INTEL_BE200: + // Configuration extracted with the helper script controller_info.py + supports_csr_vendor_command = true; + br_supported = true; + le_supported = true; + hci_version = bluetooth::hci::HciVersion::V_5_4; + hci_subversion = 0x4363; + lmp_version = bluetooth::hci::LmpVersion::V_5_4; + lmp_subversion = 0x4363; + company_identifier = 0x2; + supported_commands = std::array<uint8_t, 64>{ + 0xbf, 0xff, 0xfb, 0x03, 0xcc, 0xff, 0x0f, 0xff, 0xbf, 0xff, 0xfc, 0x1f, 0xf2, + 0x0f, 0xe8, 0xfe, 0x3f, 0xf7, 0x8f, 0xff, 0x1c, 0x00, 0x04, 0x00, 0x61, 0xf7, + 0xff, 0xff, 0x7f, 0x38, 0x00, 0x00, 0xfe, 0xf0, 0xff, 0xff, 0xff, 0xe3, 0x80, + 0x07, 0x00, 0xe8, 0x1f, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + lmp_features = std::array<uint64_t, 3>{0x877bffdbfe0ffebf, 0x0, 0x300}; + acl_data_packet_length = 1021; + total_num_acl_data_packets = 4; + sco_data_packet_length = 96; + total_num_sco_data_packets = 6; + num_supported_iac = 2; + le_features = 0x80059ff; + le_acl_data_packet_length = 251; + total_num_le_acl_data_packets = 3; + le_filter_accept_list_size = 25; + le_resolving_list_size = 25; + le_supported_states = 0x3ffffffffff; + le_max_advertising_data_length = 160; + le_num_supported_advertising_sets = 12; + le_periodic_advertiser_list_size = 12; + break; + default: break; } diff --git a/tools/rootcanal/model/controller/dual_mode_controller.cc b/tools/rootcanal/model/controller/dual_mode_controller.cc index 15f788b438..c7b5d0bbe2 100644 --- a/tools/rootcanal/model/controller/dual_mode_controller.cc +++ b/tools/rootcanal/model/controller/dual_mode_controller.cc @@ -3290,6 +3290,11 @@ void DualModeController::WriteLoopbackMode(CommandView command) { ErrorCode::SUCCESS)); } +void DualModeController::IntelDdcConfigWrite(CommandView /*command*/) { + send_event_(bluetooth::hci::CommandCompleteBuilder::Create(kNumCommandPackets, OpCode::INTEL_DDC_CONFIG_WRITE, + std::vector<uint8_t> { static_cast<uint8_t>(ErrorCode::SUCCESS) })); +} + // Note: the list does not contain all defined opcodes. // Notable exceptions: // - Vendor commands @@ -4274,6 +4279,8 @@ const std::unordered_map<OpCode, DualModeController::CommandHandler> {OpCode::LE_GET_CONTROLLER_ACTIVITY_ENERGY_INFO, &DualModeController::LeGetControllerActivityEnergyInfo}, {OpCode::LE_EX_SET_SCAN_PARAMETERS, &DualModeController::LeExSetScanParameters}, - {OpCode::GET_CONTROLLER_DEBUG_INFO, &DualModeController::GetControllerDebugInfo}}; + {OpCode::GET_CONTROLLER_DEBUG_INFO, &DualModeController::GetControllerDebugInfo}, + {OpCode::INTEL_DDC_CONFIG_WRITE, &DualModeController::IntelDdcConfigWrite}, + }; } // namespace rootcanal diff --git a/tools/rootcanal/model/controller/dual_mode_controller.h b/tools/rootcanal/model/controller/dual_mode_controller.h index d0394a7bfd..c5574bda85 100644 --- a/tools/rootcanal/model/controller/dual_mode_controller.h +++ b/tools/rootcanal/model/controller/dual_mode_controller.h @@ -525,6 +525,7 @@ public: void LeGetControllerActivityEnergyInfo(CommandView command); void LeExSetScanParameters(CommandView command); void GetControllerDebugInfo(CommandView command); + void IntelDdcConfigWrite(CommandView command); // CSR vendor command. // Implement the command specific to the CSR controller diff --git a/tools/rootcanal/model/setup/test_command_handler.cc b/tools/rootcanal/model/setup/test_command_handler.cc index 93315ae16e..59071842a5 100644 --- a/tools/rootcanal/model/setup/test_command_handler.cc +++ b/tools/rootcanal/model/setup/test_command_handler.cc @@ -246,6 +246,8 @@ void TestCommandHandler::SetDeviceConfiguration(const vector<std::string>& args) preset = rootcanal::configuration::ControllerPreset::LAIRD_BL654; } else if (args[1] == "csr_rck_pts_dongle") { preset = rootcanal::configuration::ControllerPreset::CSR_RCK_PTS_DONGLE; + } else if (args[1] == "intel_be200") { + preset = rootcanal::configuration::ControllerPreset::INTEL_BE200; } else { response_string_ = "TestCommandHandler 'set_device_configuration' invalid configuration preset"; send_response_(response_string_); diff --git a/tools/rootcanal/packets/hci_packets.pdl b/tools/rootcanal/packets/hci_packets.pdl index 23abb93b29..8f3d3c1588 100644 --- a/tools/rootcanal/packets/hci_packets.pdl +++ b/tools/rootcanal/packets/hci_packets.pdl @@ -400,6 +400,7 @@ enum OpCode : 16 { // VENDOR_SPECIFIC // MSFT_OPCODE_xxxx below is needed for the tests. MSFT_OPCODE_INTEL = 0xFC1E, + INTEL_DDC_CONFIG_WRITE = 0xFC8B, LE_GET_VENDOR_CAPABILITIES = 0xFD53, LE_BATCH_SCAN = 0xFD56, LE_APCF = 0xFD57, diff --git a/tools/rootcanal/proto/rootcanal/configuration.proto b/tools/rootcanal/proto/rootcanal/configuration.proto index 0b6db15c89..0beb961291 100644 --- a/tools/rootcanal/proto/rootcanal/configuration.proto +++ b/tools/rootcanal/proto/rootcanal/configuration.proto @@ -24,6 +24,8 @@ enum ControllerPreset { LAIRD_BL654 = 1; // Official PTS dongle, CSR rck. CSR_RCK_PTS_DONGLE = 2; + // Official PTS dongle, Intel BE200. + INTEL_BE200 = 3; } message ControllerFeatures { diff --git a/tools/rootcanal/scripts/controller_info.py b/tools/rootcanal/scripts/controller_info.py index 10a74a0daf..cca4f0970b 100755 --- a/tools/rootcanal/scripts/controller_info.py +++ b/tools/rootcanal/scripts/controller_info.py @@ -98,66 +98,74 @@ async def br_edr_properties(host: Host): page2 = await host.expect_evt(hci.ReadLocalExtendedFeaturesComplete) print( - f"lmp_features: {{ 0x{page0.lmp_features:x}, 0x{page1.extended_lmp_features:x}, 0x{page2.extended_lmp_features:x} }}" + f"lmp_features = {{ 0x{page0.lmp_features:x}, 0x{page1.extended_lmp_features:x}, 0x{page2.extended_lmp_features:x} }};" ) await host.send_cmd(hci.ReadBufferSize()) evt = await host.expect_evt(hci.ReadBufferSizeComplete) - print(f"acl_data_packet_length: {evt.acl_data_packet_length}") - print(f"total_num_acl_data_packets: {evt.total_num_acl_data_packets}") - print(f"sco_data_packet_length: {evt.synchronous_data_packet_length}") - print(f"total_num_sco_data_packets: {evt.total_num_synchronous_data_packets}") + print(f"acl_data_packet_length = {evt.acl_data_packet_length};") + print(f"total_num_acl_data_packets = {evt.total_num_acl_data_packets};") + print(f"sco_data_packet_length = {evt.synchronous_data_packet_length};") + print(f"total_num_sco_data_packets = {evt.total_num_synchronous_data_packets};") await host.send_cmd(hci.ReadNumberOfSupportedIac()) evt = await host.expect_evt(hci.ReadNumberOfSupportedIacComplete) - print(f"num_supported_iac: {evt.num_support_iac}") + print(f"num_supported_iac = {evt.num_support_iac};") async def le_properties(host: Host): - await host.send_cmd(hci.LeReadLocalSupportedFeatures()) - evt = await host.expect_evt(hci.LeReadLocalSupportedFeaturesComplete) + await host.send_cmd(hci.LeReadLocalSupportedFeaturesPage0()) + evt = await host.expect_evt(hci.LeReadLocalSupportedFeaturesPage0Complete) - print(f"le_features: 0x{evt.le_features:x}") + print(f"le_features = 0x{evt.le_features:x};") - await host.send_cmd(hci.LeReadBufferSizeV2()) - evt = await host.expect_evt(hci.LeReadBufferSizeV2Complete) + try: + await host.send_cmd(hci.LeReadBufferSizeV2()) + evt = await host.expect_evt(hci.LeReadBufferSizeV2Complete) + + print(f"le_acl_data_packet_length = {evt.le_buffer_size.le_data_packet_length};") + print(f"total_num_le_acl_data_packets = {evt.le_buffer_size.total_num_le_packets};") + print(f"iso_data_packet_length = {evt.iso_buffer_size.le_data_packet_length};") + print(f"total_num_iso_data_packets = {evt.iso_buffer_size.total_num_le_packets};") + + except Exception: + await host.send_cmd(hci.LeReadBufferSizeV1()) + evt = await host.expect_evt(hci.LeReadBufferSizeV1Complete) - print(f"le_acl_data_packet_length: {evt.le_buffer_size.le_data_packet_length}") - print(f"total_num_le_acl_data_packets: {evt.le_buffer_size.total_num_le_packets}") - print(f"iso_data_packet_length: {evt.iso_buffer_size.le_data_packet_length}") - print(f"total_num_iso_data_packets: {evt.iso_buffer_size.total_num_le_packets}") + print(f"le_acl_data_packet_length = {evt.le_buffer_size.le_data_packet_length};") + print(f"total_num_le_acl_data_packets = {evt.le_buffer_size.total_num_le_packets};") await host.send_cmd(hci.LeReadFilterAcceptListSize()) evt = await host.expect_evt(hci.LeReadFilterAcceptListSizeComplete) - print(f"le_filter_accept_list_size: {evt.filter_accept_list_size}") + print(f"le_filter_accept_list_size = {evt.filter_accept_list_size};") await host.send_cmd(hci.LeReadResolvingListSize()) evt = await host.expect_evt(hci.LeReadResolvingListSizeComplete) - print(f"le_resolving_list_size: {evt.resolving_list_size}") + print(f"le_resolving_list_size = {evt.resolving_list_size};") await host.send_cmd(hci.LeReadSupportedStates()) evt = await host.expect_evt(hci.LeReadSupportedStatesComplete) - print(f"le_supported_states: 0x{evt.le_states:x}") + print(f"le_supported_states: 0x{evt.le_states:x};") await host.send_cmd(hci.LeReadMaximumAdvertisingDataLength()) evt = await host.expect_evt(hci.LeReadMaximumAdvertisingDataLengthComplete) - print(f"le_max_advertising_data_length: {evt.maximum_advertising_data_length}") + print(f"le_max_advertising_data_length = {evt.maximum_advertising_data_length};") await host.send_cmd(hci.LeReadNumberOfSupportedAdvertisingSets()) evt = await host.expect_evt(hci.LeReadNumberOfSupportedAdvertisingSetsComplete) - print(f"le_num_supported_advertising_sets: {evt.number_supported_advertising_sets}") + print(f"le_num_supported_advertising_sets = {evt.number_supported_advertising_sets};") await host.send_cmd(hci.LeReadPeriodicAdvertiserListSize()) evt = await host.expect_evt(hci.LeReadPeriodicAdvertiserListSizeComplete) - print(f"le_periodic_advertiser_list_size: {evt.periodic_advertiser_list_size}") + print(f"le_periodic_advertiser_list_size = {evt.periodic_advertiser_list_size};") async def run(tcp_port: int): @@ -170,16 +178,16 @@ async def run(tcp_port: int): await host.send_cmd(hci.ReadLocalVersionInformation()) evt = await host.expect_evt(hci.ReadLocalVersionInformationComplete) - print(f"hci_version: {evt.local_version_information.hci_version}") - print(f"hci_subversion: 0x{evt.local_version_information.hci_revision:x}") - print(f"lmp_version: {evt.local_version_information.lmp_version}") - print(f"lmp_subversion: 0x{evt.local_version_information.lmp_subversion:x}") - print(f"company_identifier: 0x{evt.local_version_information.manufacturer_name:x}") + print(f"hci_version = {evt.local_version_information.hci_version};") + print(f"hci_subversion = 0x{evt.local_version_information.hci_revision:x};") + print(f"lmp_version = {evt.local_version_information.lmp_version};") + print(f"lmp_subversion = 0x{evt.local_version_information.lmp_subversion:x};") + print(f"company_identifier = 0x{evt.local_version_information.manufacturer_name:x};") await host.send_cmd(hci.ReadLocalSupportedCommands()) evt = await host.expect_evt(hci.ReadLocalSupportedCommandsComplete) - print(f"supported_commands: {{ {', '.join([f'0x{b:x}' for b in evt.supported_commands])} }}") + print(f"supported_commands = {{ {', '.join([f'0x{b:02x}' for b in evt.supported_commands])} }};") try: await br_edr_properties(host) |