diff options
| author | 2023-08-01 20:44:43 +0000 | |
|---|---|---|
| committer | 2023-08-01 23:12:20 +0000 | |
| commit | f7d545948f2972eb7fb97e8d49d1a7618e15a588 (patch) | |
| tree | c082259bba9dbcffda6583f57f72621928d9f01f | |
| parent | c340dfbf533f58f33fa825e448dc3fdc1de27e8b (diff) | |
RootCanal: Rename LeCreateConnection and LeExtendedCreateConnection fields
Use names matching the specification of the commands.
Bug: 279665786
Test: m root-canal
Change-Id: Ic3e9724126172e63cdb42c96b739c0f33bf3a967
21 files changed, 216 insertions, 187 deletions
diff --git a/tools/rootcanal/Android.bp b/tools/rootcanal/Android.bp index ec97801685..fa74c957a1 100644 --- a/tools/rootcanal/Android.bp +++ b/tools/rootcanal/Android.bp @@ -313,8 +313,8 @@ python_test_host { "test/LL/CON_/PER/*.py", "test/LL/DDI/ADV/*.py", "test/LL/DDI/SCN/*.py", - "test/LMP/LIH/*.py", "test/LMP/*.py", + "test/LMP/LIH/*.py", "test/main.py", ], data: [ @@ -415,8 +415,8 @@ cc_binary_host { genrule { name: "rootcanal_hci_packets_cxx_gen", tools: [ - ":pdlc", ":pdl_cxx_generator", + ":pdlc", ], cmd: "set -o pipefail;" + " $(location :pdlc) $(in) |" + @@ -435,8 +435,8 @@ genrule { genrule { name: "rootcanal_link_layer_packets_cxx_gen", tools: [ - ":pdlc", ":pdl_cxx_generator", + ":pdlc", ], cmd: "set -o pipefail;" + " $(location :pdlc) $(in) |" + @@ -456,8 +456,8 @@ genrule { genrule { name: "rootcanal_bredr_bb_packets_cxx_gen", tools: [ - ":pdlc", ":pdl_cxx_generator", + ":pdlc", ], cmd: "set -o pipefail;" + " $(location :pdlc) $(in) |" + diff --git a/tools/rootcanal/model/controller/dual_mode_controller.cc b/tools/rootcanal/model/controller/dual_mode_controller.cc index e10ef34c3f..175f08aa03 100644 --- a/tools/rootcanal/model/controller/dual_mode_controller.cc +++ b/tools/rootcanal/model/controller/dual_mode_controller.cc @@ -2061,10 +2061,10 @@ void DualModeController::LeCreateConnection(CommandView command) { command_view.GetPeerAddress(), command_view.GetPeerAddressType(), }, - command_view.GetOwnAddressType(), command_view.GetConnIntervalMin(), - command_view.GetConnIntervalMax(), command_view.GetConnLatency(), - command_view.GetSupervisionTimeout(), command_view.GetMinimumCeLength(), - command_view.GetMaximumCeLength()); + command_view.GetOwnAddressType(), command_view.GetConnectionIntervalMin(), + command_view.GetConnectionIntervalMax(), command_view.GetMaxLatency(), + command_view.GetSupervisionTimeout(), command_view.GetMinCeLength(), + command_view.GetMaxCeLength()); send_event_(bluetooth::hci::LeCreateConnectionStatusBuilder::Create( status, kNumCommandPackets)); } @@ -2089,8 +2089,9 @@ void DualModeController::LeConnectionUpdate(CommandView command) { DEBUG(id_, " connection_handle=0x{:x}", command_view.GetConnectionHandle()); ErrorCode status = link_layer_controller_.LeConnectionUpdate( - command_view.GetConnectionHandle(), command_view.GetConnIntervalMin(), - command_view.GetConnIntervalMax(), command_view.GetConnLatency(), + command_view.GetConnectionHandle(), + command_view.GetConnectionIntervalMin(), + command_view.GetConnectionIntervalMax(), command_view.GetMaxLatency(), command_view.GetSupervisionTimeout()); send_event_(bluetooth::hci::LeConnectionUpdateStatusBuilder::Create( @@ -2608,7 +2609,7 @@ void DualModeController::LeSetExtendedScanParameters(CommandView command) { ErrorCode status = link_layer_controller_.LeSetExtendedScanParameters( command_view.GetOwnAddressType(), command_view.GetScanningFilterPolicy(), - command_view.GetScanningPhys(), command_view.GetParameters()); + command_view.GetScanningPhys(), command_view.GetScanningPhyParameters()); send_event_( bluetooth::hci::LeSetExtendedScanParametersCompleteBuilder::Create( kNumCommandPackets, status)); @@ -2639,18 +2640,30 @@ void DualModeController::LeExtendedCreateConnection(CommandView command) { DEBUG(id_, "<< LE Extended Create Connection"); DEBUG(id_, " peer_address={}", command_view.GetPeerAddress()); DEBUG(id_, " peer_address_type={}", - bluetooth::hci::AddressTypeText(command_view.GetPeerAddressType())); + bluetooth::hci::PeerAddressTypeText(command_view.GetPeerAddressType())); DEBUG(id_, " initiator_filter_policy={}", bluetooth::hci::InitiatorFilterPolicyText( command_view.GetInitiatorFilterPolicy())); + AddressType peer_address_type; + switch (command_view.GetPeerAddressType()) { + case PeerAddressType::PUBLIC_DEVICE_OR_IDENTITY_ADDRESS: + default: + peer_address_type = AddressType::PUBLIC_DEVICE_ADDRESS; + break; + case PeerAddressType::RANDOM_DEVICE_OR_IDENTITY_ADDRESS: + peer_address_type = AddressType::RANDOM_DEVICE_ADDRESS; + break; + } + ErrorCode status = link_layer_controller_.LeExtendedCreateConnection( command_view.GetInitiatorFilterPolicy(), command_view.GetOwnAddressType(), AddressWithType{ command_view.GetPeerAddress(), - command_view.GetPeerAddressType(), + peer_address_type, }, - command_view.GetInitiatingPhys(), command_view.GetPhyScanParameters()); + command_view.GetInitiatingPhys(), + command_view.GetInitiatingPhyParameters()); send_event_(bluetooth::hci::LeExtendedCreateConnectionStatusBuilder::Create( status, kNumCommandPackets)); } diff --git a/tools/rootcanal/model/controller/link_layer_controller.cc b/tools/rootcanal/model/controller/link_layer_controller.cc index 49a1bab32b..85fca6d5cd 100644 --- a/tools/rootcanal/model/controller/link_layer_controller.cc +++ b/tools/rootcanal/model/controller/link_layer_controller.cc @@ -1281,7 +1281,8 @@ ErrorCode LinkLayerController::LeSetExtendedScanParameters( bluetooth::hci::OwnAddressType own_address_type, bluetooth::hci::LeScanningFilterPolicy scanning_filter_policy, uint8_t scanning_phys, - std::vector<bluetooth::hci::PhyScanParameters> scanning_phy_parameters) { + std::vector<bluetooth::hci::ScanningPhyParameters> + scanning_phy_parameters) { uint8_t supported_phys = properties_.LeSupportedPhys(); // Extended advertising commands are disallowed when legacy advertising @@ -1676,7 +1677,7 @@ ErrorCode LinkLayerController::LeExtendedCreateConnection( bluetooth::hci::InitiatorFilterPolicy initiator_filter_policy, bluetooth::hci::OwnAddressType own_address_type, AddressWithType peer_address, uint8_t initiating_phys, - std::vector<bluetooth::hci::LeCreateConnPhyScanParameters> + std::vector<bluetooth::hci::InitiatingPhyParameters> initiating_phy_parameters) { // Extended advertising commands are disallowed when legacy advertising // commands were used since the last reset. @@ -1751,36 +1752,39 @@ ErrorCode LinkLayerController::LeExtendedCreateConnection( // Note: no explicit error code stated for invalid connection interval // values but assuming Unsupported Feature or Parameter Value (0x11) // error code based on similar advertising command. - if (parameter.conn_interval_min_ < 0x6 || - parameter.conn_interval_min_ > 0x0c80 || - parameter.conn_interval_max_ < 0x6 || - parameter.conn_interval_max_ > 0x0c80) { + if (parameter.connection_interval_min_ < 0x6 || + parameter.connection_interval_min_ > 0x0c80 || + parameter.connection_interval_max_ < 0x6 || + parameter.connection_interval_max_ > 0x0c80) { INFO(id_, "connection_interval_min (0x{:04x}) and/or " "connection_interval_max (0x{:04x}) are outside the range" " of supported values (0x6 - 0x0c80)", - parameter.conn_interval_min_, parameter.conn_interval_max_); + parameter.connection_interval_min_, + parameter.connection_interval_max_); return ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; } // The Connection_Interval_Min parameter shall not be greater than the // Connection_Interval_Max parameter. - if (parameter.conn_interval_max_ < parameter.conn_interval_min_) { + if (parameter.connection_interval_max_ < + parameter.connection_interval_min_) { INFO(id_, "connection_interval_min (0x{:04x}) is larger than" " connection_interval_max (0x{:04x})", - parameter.conn_interval_min_, parameter.conn_interval_max_); + parameter.connection_interval_min_, + parameter.connection_interval_max_); return ErrorCode::INVALID_HCI_COMMAND_PARAMETERS; } // Note: no explicit error code stated for invalid max_latency // values but assuming Unsupported Feature or Parameter Value (0x11) // error code based on similar advertising command. - if (parameter.conn_latency_ > 0x01f3) { + if (parameter.max_latency_ > 0x01f3) { INFO(id_, "max_latency (0x{:04x}) is outside the range" " of supported values (0x0 - 0x01f3)", - parameter.conn_latency_); + parameter.max_latency_); return ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; } @@ -1800,8 +1804,8 @@ ErrorCode LinkLayerController::LeExtendedCreateConnection( // (1 + Max_Latency) * Connection_Interval_Max * 2, where // Connection_Interval_Max is given in milliseconds. milliseconds min_supervision_timeout = duration_cast<milliseconds>( - (1 + parameter.conn_latency_) * - slots(2 * parameter.conn_interval_max_) * 2); + (1 + parameter.max_latency_) * + slots(2 * parameter.connection_interval_max_) * 2); if (parameter.supervision_timeout_ * 10ms < min_supervision_timeout) { INFO( id_, @@ -1862,10 +1866,10 @@ ErrorCode LinkLayerController::LeExtendedCreateConnection( .scan_interval = initiating_phy_parameters[offset].scan_interval_, .scan_window = initiating_phy_parameters[offset].scan_window_, .connection_interval_min = - initiating_phy_parameters[offset].conn_interval_min_, + initiating_phy_parameters[offset].connection_interval_min_, .connection_interval_max = - initiating_phy_parameters[offset].conn_interval_max_, - .max_latency = initiating_phy_parameters[offset].conn_latency_, + initiating_phy_parameters[offset].connection_interval_max_, + .max_latency = initiating_phy_parameters[offset].max_latency_, .supervision_timeout = initiating_phy_parameters[offset].supervision_timeout_, .min_ce_length = initiating_phy_parameters[offset].min_ce_length_, @@ -1880,10 +1884,10 @@ ErrorCode LinkLayerController::LeExtendedCreateConnection( .scan_interval = initiating_phy_parameters[offset].scan_interval_, .scan_window = initiating_phy_parameters[offset].scan_window_, .connection_interval_min = - initiating_phy_parameters[offset].conn_interval_min_, + initiating_phy_parameters[offset].connection_interval_min_, .connection_interval_max = - initiating_phy_parameters[offset].conn_interval_max_, - .max_latency = initiating_phy_parameters[offset].conn_latency_, + initiating_phy_parameters[offset].connection_interval_max_, + .max_latency = initiating_phy_parameters[offset].max_latency_, .supervision_timeout = initiating_phy_parameters[offset].supervision_timeout_, .min_ce_length = initiating_phy_parameters[offset].min_ce_length_, @@ -1898,10 +1902,10 @@ ErrorCode LinkLayerController::LeExtendedCreateConnection( .scan_interval = initiating_phy_parameters[offset].scan_interval_, .scan_window = initiating_phy_parameters[offset].scan_window_, .connection_interval_min = - initiating_phy_parameters[offset].conn_interval_min_, + initiating_phy_parameters[offset].connection_interval_min_, .connection_interval_max = - initiating_phy_parameters[offset].conn_interval_max_, - .max_latency = initiating_phy_parameters[offset].conn_latency_, + initiating_phy_parameters[offset].connection_interval_max_, + .max_latency = initiating_phy_parameters[offset].max_latency_, .supervision_timeout = initiating_phy_parameters[offset].supervision_timeout_, .min_ce_length = initiating_phy_parameters[offset].min_ce_length_, diff --git a/tools/rootcanal/model/controller/link_layer_controller.h b/tools/rootcanal/model/controller/link_layer_controller.h index 4af0be4a99..ebbe4d8565 100644 --- a/tools/rootcanal/model/controller/link_layer_controller.h +++ b/tools/rootcanal/model/controller/link_layer_controller.h @@ -480,7 +480,8 @@ class LinkLayerController { bluetooth::hci::OwnAddressType own_address_type, bluetooth::hci::LeScanningFilterPolicy scanning_filter_policy, uint8_t scanning_phys, - std::vector<bluetooth::hci::PhyScanParameters> scanning_phy_parameters); + std::vector<bluetooth::hci::ScanningPhyParameters> + scanning_phy_parameters); // HCI command LE_Set_Extended_Scan_Enable (Vol 4, Part E ยง 7.8.65). ErrorCode LeSetExtendedScanEnable( @@ -509,7 +510,7 @@ class LinkLayerController { bluetooth::hci::InitiatorFilterPolicy initiator_filter_policy, bluetooth::hci::OwnAddressType own_address_type, AddressWithType peer_address, uint8_t initiating_phys, - std::vector<bluetooth::hci::LeCreateConnPhyScanParameters> + std::vector<bluetooth::hci::InitiatingPhyParameters> initiating_phy_parameters); // Periodic Advertising diff --git a/tools/rootcanal/packets/hci_packets.pdl b/tools/rootcanal/packets/hci_packets.pdl index 0743244999..a99774499b 100644 --- a/tools/rootcanal/packets/hci_packets.pdl +++ b/tools/rootcanal/packets/hci_packets.pdl @@ -3279,12 +3279,12 @@ packet LeCreateConnection : Command (op_code = LE_CREATE_CONNECTION) { peer_address_type : AddressType, peer_address : Address, own_address_type : OwnAddressType, - conn_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) - conn_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) - conn_latency : 16, // 0x0006-0x01F3 + connection_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) + connection_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) + max_latency : 16, // 0x0006-0x01F3 supervision_timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) - minimum_ce_length : 16, // 0.625ms - maximum_ce_length : 16, // 0.625ms + min_ce_length : 16, // 0.625ms + max_ce_length : 16, // 0.625ms } packet LeCreateConnectionStatus : CommandStatus (command_op_code = LE_CREATE_CONNECTION) { @@ -3347,12 +3347,12 @@ packet LeRemoveDeviceFromFilterAcceptListComplete : CommandComplete (command_op_ packet LeConnectionUpdate : Command (op_code = LE_CONNECTION_UPDATE) { connection_handle : 12, _reserved_ : 4, - conn_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) - conn_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) - conn_latency : 16, // 0x0006-0x01F3 + connection_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) + connection_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) + max_latency : 16, // 0x0006-0x01F3 supervision_timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) - minimum_ce_length : 16, // 0.625ms - maximum_ce_length : 16, // 0.625ms + min_ce_length : 16, // 0.625ms + max_ce_length : 16, // 0.625ms } packet LeConnectionUpdateStatus : CommandStatus (command_op_code = LE_CONNECTION_UPDATE) { @@ -3988,7 +3988,7 @@ packet LeSetPeriodicAdvertisingEnableComplete : CommandComplete (command_op_code status : ErrorCode, } -struct PhyScanParameters { +struct ScanningPhyParameters { le_scan_type : LeScanType, le_scan_interval : 16, // 0x0004-0xFFFF Default 0x10 (10ms) le_scan_window : 16, // 0x004-0xFFFF Default 0x10 (10ms) @@ -3998,7 +3998,7 @@ packet LeSetExtendedScanParameters : Command (op_code = LE_SET_EXTENDED_SCAN_PAR own_address_type : OwnAddressType, scanning_filter_policy : LeScanningFilterPolicy, scanning_phys : 8, - parameters : PhyScanParameters[], + scanning_phy_parameters : ScanningPhyParameters[], } test LeSetExtendedScanParameters { @@ -4040,12 +4040,12 @@ test LeSetExtendedScanEnableComplete { "\x0e\x04\x01\x42\x20\x00", } -struct LeCreateConnPhyScanParameters { +struct InitiatingPhyParameters { scan_interval : 16, // 0x0004-0xFFFF scan_window : 16, // < = LeScanInterval - conn_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) - conn_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) - conn_latency : 16, // 0x0006-0x01F3 + connection_interval_min : 16, // 0x0006-0x0C80 (7.5ms to 4s) + connection_interval_max : 16, // 0x0006-0x0C80 (7.5ms to 4s) + max_latency : 16, // 0x0006-0x01F3 supervision_timeout : 16, // 0x00A to 0x0C80 (100ms to 32s) min_ce_length : 16, // 0.625ms max_ce_length : 16, // 0.625ms @@ -4054,10 +4054,10 @@ struct LeCreateConnPhyScanParameters { packet LeExtendedCreateConnection : Command (op_code = LE_EXTENDED_CREATE_CONNECTION) { initiator_filter_policy : InitiatorFilterPolicy, own_address_type : OwnAddressType, - peer_address_type : AddressType, + peer_address_type : PeerAddressType, peer_address : Address, initiating_phys : 8, - phy_scan_parameters : LeCreateConnPhyScanParameters[], + initiating_phy_parameters : InitiatingPhyParameters[], } test LeExtendedCreateConnection { @@ -5625,8 +5625,8 @@ packet LeConnectionComplete : LeMetaEvent (subevent_code = CONNECTION_COMPLETE) role : Role, peer_address_type : AddressType, peer_address : Address, - conn_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) - conn_latency : 16, // Number of connection events + connection_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) + peripheral_latency : 16, supervision_timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) central_clock_accuracy : ClockAccuracy, } @@ -5657,8 +5657,8 @@ packet LeConnectionUpdateComplete : LeMetaEvent (subevent_code = CONNECTION_UPDA status : ErrorCode, connection_handle : 12, _reserved_ : 4, - conn_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) - conn_latency : 16, // Number of connection events + connection_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) + peripheral_latency : 16, // Number of connection events supervision_timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) } @@ -5713,8 +5713,8 @@ packet LeEnhancedConnectionComplete : LeMetaEvent (subevent_code = ENHANCED_CONN peer_address : Address, local_resolvable_private_address : Address, peer_resolvable_private_address : Address, - conn_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) - conn_latency : 16, // Number of connection events + connection_interval : 16, // 0x006 - 0x0C80 (7.5ms - 4000ms) + peripheral_latency : 16, supervision_timeout : 16, // 0x000A to 0x0C80 (100ms to 32s) central_clock_accuracy : ClockAccuracy, } diff --git a/tools/rootcanal/py/controller.py b/tools/rootcanal/py/controller.py index 9c3e2a85fd..b4bbecaac0 100644 --- a/tools/rootcanal/py/controller.py +++ b/tools/rootcanal/py/controller.py @@ -373,13 +373,13 @@ class ControllerTest(unittest.IsolatedAsyncioTestCase): peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, initiating_phys=0x1, - phy_scan_parameters=[ - hci.LeCreateConnPhyScanParameters( + initiating_phy_parameters=[ + hci.InitiatingPhyParameters( scan_interval=0x200, scan_window=0x100, - conn_interval_min=0x200, - conn_interval_max=0x200, - conn_latency=0x6, + connection_interval_min=0x200, + connection_interval_max=0x200, + max_latency=0x6, supervision_timeout=0xc80, min_ce_length=0, max_ce_length=0, @@ -418,8 +418,8 @@ class ControllerTest(unittest.IsolatedAsyncioTestCase): role=hci.Role.CENTRAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=0x200, - conn_latency=0x6, + connection_interval=0x200, + peripheral_latency=0x6, supervision_timeout=0xc80, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) @@ -470,8 +470,8 @@ class ControllerTest(unittest.IsolatedAsyncioTestCase): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=0x200, - conn_latency=0x200, + connection_interval=0x200, + peripheral_latency=0x200, supervision_timeout=0x200, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/CON_/CEN/BV_41_C.py b/tools/rootcanal/test/LL/CON_/CEN/BV_41_C.py index c3b719082e..9d377ef54a 100644 --- a/tools/rootcanal/test/LL/CON_/CEN/BV_41_C.py +++ b/tools/rootcanal/test/LL/CON_/CEN/BV_41_C.py @@ -46,13 +46,13 @@ class Test(ControllerTest): peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, initiating_phys=0x1, - phy_scan_parameters=[ - hci.LeCreateConnPhyScanParameters( + initiating_phy_parameters=[ + hci.InitiatingPhyParameters( scan_interval=0x200, scan_window=0x100, - conn_interval_min=0x200, - conn_interval_max=0x200, - conn_latency=0x6, + connection_interval_min=0x200, + connection_interval_max=0x200, + max_latency=0x6, supervision_timeout=0xc80, min_ce_length=0, max_ce_length=0, @@ -91,8 +91,8 @@ class Test(ControllerTest): role=hci.Role.CENTRAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=0x200, - conn_latency=0x6, + connection_interval=0x200, + peripheral_latency=0x6, supervision_timeout=0xc80, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/CON_/CEN/BV_43_C.py b/tools/rootcanal/test/LL/CON_/CEN/BV_43_C.py index ec5b68ba4a..914df4cfe9 100644 --- a/tools/rootcanal/test/LL/CON_/CEN/BV_43_C.py +++ b/tools/rootcanal/test/LL/CON_/CEN/BV_43_C.py @@ -43,13 +43,13 @@ class Test(ControllerTest): peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, initiating_phys=0x1, - phy_scan_parameters=[ - hci.LeCreateConnPhyScanParameters( + initiating_phy_parameters=[ + hci.InitiatingPhyParameters( scan_interval=0x200, scan_window=0x100, - conn_interval_min=0x200, - conn_interval_max=0x200, - conn_latency=0x6, + connection_interval_min=0x200, + connection_interval_max=0x200, + max_latency=0x6, supervision_timeout=0xc80, min_ce_length=0, max_ce_length=0, @@ -88,8 +88,8 @@ class Test(ControllerTest): role=hci.Role.CENTRAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=0x200, - conn_latency=0x6, + connection_interval=0x200, + peripheral_latency=0x6, supervision_timeout=0xc80, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/CON_/PER/BV_40_C.py b/tools/rootcanal/test/LL/CON_/PER/BV_40_C.py index 201beeb3cd..045bca32a3 100644 --- a/tools/rootcanal/test/LL/CON_/PER/BV_40_C.py +++ b/tools/rootcanal/test/LL/CON_/PER/BV_40_C.py @@ -77,8 +77,8 @@ class Test(ControllerTest): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=0x200, - conn_latency=0x200, + connection_interval=0x200, + peripheral_latency=0x200, supervision_timeout=0x200, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/CON_/PER/BV_42_C.py b/tools/rootcanal/test/LL/CON_/PER/BV_42_C.py index 4f19d701c5..ae067c2269 100644 --- a/tools/rootcanal/test/LL/CON_/PER/BV_42_C.py +++ b/tools/rootcanal/test/LL/CON_/PER/BV_42_C.py @@ -77,8 +77,8 @@ class Test(ControllerTest): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=0x200, - conn_latency=0x200, + connection_interval=0x200, + peripheral_latency=0x200, supervision_timeout=0x200, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/DDI/ADV/BV_06_C.py b/tools/rootcanal/test/LL/DDI/ADV/BV_06_C.py index f850c57143..f52edd3deb 100644 --- a/tools/rootcanal/test/LL/DDI/ADV/BV_06_C.py +++ b/tools/rootcanal/test/LL/DDI/ADV/BV_06_C.py @@ -95,8 +95,8 @@ class Test(ControllerTest): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=LL_initiator_connInterval, - conn_latency=LL_initiator_connPeripheralLatency, + connection_interval=LL_initiator_connInterval, + peripheral_latency=LL_initiator_connPeripheralLatency, supervision_timeout=LL_initiator_connSupervisionTimeout, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/DDI/ADV/BV_07_C.py b/tools/rootcanal/test/LL/DDI/ADV/BV_07_C.py index c4b10cdc8e..271a4fc564 100644 --- a/tools/rootcanal/test/LL/DDI/ADV/BV_07_C.py +++ b/tools/rootcanal/test/LL/DDI/ADV/BV_07_C.py @@ -125,8 +125,8 @@ class Test(ControllerTest): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=LL_initiator_connInterval, - conn_latency=LL_initiator_connPeripheralLatency, + connection_interval=LL_initiator_connInterval, + peripheral_latency=LL_initiator_connPeripheralLatency, supervision_timeout=LL_initiator_connSupervisionTimeout, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/DDI/ADV/BV_09_C.py b/tools/rootcanal/test/LL/DDI/ADV/BV_09_C.py index d583ef4cf3..719ddc76e3 100644 --- a/tools/rootcanal/test/LL/DDI/ADV/BV_09_C.py +++ b/tools/rootcanal/test/LL/DDI/ADV/BV_09_C.py @@ -310,8 +310,8 @@ class Test(ControllerTest): peer_address_type=(hci.AddressType.PUBLIC_DEVICE_ADDRESS if peer_address_type == ll.AddressType.PUBLIC else hci.AddressType.RANDOM_DEVICE_ADDRESS), peer_address=peer_address, - conn_interval=self.LL_initiator_connInterval, - conn_latency=self.LL_initiator_connPeripheralLatency, + connection_interval=self.LL_initiator_connInterval, + peripheral_latency=self.LL_initiator_connPeripheralLatency, supervision_timeout=self.LL_initiator_connSupervisionTimeout, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) @@ -380,8 +380,8 @@ class Test(ControllerTest): peer_address_type=(hci.AddressType.PUBLIC_DEVICE_ADDRESS if peer_address_type == ll.AddressType.PUBLIC else hci.AddressType.RANDOM_DEVICE_ADDRESS), peer_address=peer_address, - conn_interval=self.LL_initiator_connInterval, - conn_latency=self.LL_initiator_connPeripheralLatency, + connection_interval=self.LL_initiator_connInterval, + peripheral_latency=self.LL_initiator_connPeripheralLatency, supervision_timeout=self.LL_initiator_connSupervisionTimeout, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/DDI/ADV/BV_11_C.py b/tools/rootcanal/test/LL/DDI/ADV/BV_11_C.py index 1b0953ac51..014417f9be 100644 --- a/tools/rootcanal/test/LL/DDI/ADV/BV_11_C.py +++ b/tools/rootcanal/test/LL/DDI/ADV/BV_11_C.py @@ -137,8 +137,8 @@ class Test(ControllerTest): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=peer_address, - conn_interval=self.LL_initiator_connInterval, - conn_latency=self.LL_initiator_connPeripheralLatency, + connection_interval=self.LL_initiator_connInterval, + peripheral_latency=self.LL_initiator_connPeripheralLatency, supervision_timeout=self.LL_initiator_connSupervisionTimeout, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/DDI/ADV/BV_19_C.py b/tools/rootcanal/test/LL/DDI/ADV/BV_19_C.py index ba996c7ad6..9247324a4f 100644 --- a/tools/rootcanal/test/LL/DDI/ADV/BV_19_C.py +++ b/tools/rootcanal/test/LL/DDI/ADV/BV_19_C.py @@ -112,8 +112,8 @@ class Test(ControllerTest): role=hci.Role.PERIPHERAL, peer_address_type=hci.AddressType.PUBLIC_DEVICE_ADDRESS, peer_address=public_peer_address, - conn_interval=self.LL_initiator_connInterval, - conn_latency=self.LL_initiator_connPeripheralLatency, + connection_interval=self.LL_initiator_connInterval, + peripheral_latency=self.LL_initiator_connPeripheralLatency, supervision_timeout=self.LL_initiator_connSupervisionTimeout, central_clock_accuracy=hci.ClockAccuracy.PPM_500)) diff --git a/tools/rootcanal/test/LL/DDI/SCN/BV_19_C.py b/tools/rootcanal/test/LL/DDI/SCN/BV_19_C.py index 04bda10551..41c3db5b94 100644 --- a/tools/rootcanal/test/LL/DDI/SCN/BV_19_C.py +++ b/tools/rootcanal/test/LL/DDI/SCN/BV_19_C.py @@ -82,10 +82,10 @@ class Test(ControllerTest): hci.LeSetExtendedScanParameters(own_address_type=hci.OwnAddressType.PUBLIC_DEVICE_ADDRESS, scanning_filter_policy=hci.LeScanningFilterPolicy.ACCEPT_ALL, scanning_phys=0x1, - parameters=[ - hci.PhyScanParameters(le_scan_type=hci.LeScanType.PASSIVE, - le_scan_interval=0x0010, - le_scan_window=0x0010) + scanning_phy_parameters=[ + hci.ScanningPhyParameters(le_scan_type=hci.LeScanType.PASSIVE, + le_scan_interval=0x0010, + le_scan_window=0x0010) ])) await self.expect_evt( diff --git a/tools/rootcanal/test/LL/DDI/SCN/BV_79_C.py b/tools/rootcanal/test/LL/DDI/SCN/BV_79_C.py index a27b0a1058..80a6245c68 100644 --- a/tools/rootcanal/test/LL/DDI/SCN/BV_79_C.py +++ b/tools/rootcanal/test/LL/DDI/SCN/BV_79_C.py @@ -52,10 +52,10 @@ class Test(ControllerTest): hci.LeSetExtendedScanParameters(own_address_type=hci.OwnAddressType.PUBLIC_DEVICE_ADDRESS, scanning_filter_policy=hci.LeScanningFilterPolicy.ACCEPT_ALL, scanning_phys=0x1, - parameters=[ - hci.PhyScanParameters(le_scan_type=hci.LeScanType.PASSIVE, - le_scan_interval=0x0010, - le_scan_window=0x0010) + scanning_phy_parameters=[ + hci.ScanningPhyParameters(le_scan_type=hci.LeScanType.PASSIVE, + le_scan_interval=0x0010, + le_scan_window=0x0010) ])) await self.expect_evt( diff --git a/tools/rootcanal/test/controller/le/le_scanning_filter_duplicates_test.cc b/tools/rootcanal/test/controller/le/le_scanning_filter_duplicates_test.cc index 3387c8ad21..feed4edcd7 100644 --- a/tools/rootcanal/test/controller/le/le_scanning_filter_duplicates_test.cc +++ b/tools/rootcanal/test/controller/le/le_scanning_filter_duplicates_test.cc @@ -71,7 +71,7 @@ class LeScanningFilterDuplicates : public ::testing::Test { void StartExtendedScan(FilterDuplicates filter_duplicates, uint16_t duration = 0, uint16_t period = 0) { - bluetooth::hci::PhyScanParameters param; + bluetooth::hci::ScanningPhyParameters param; param.le_scan_type_ = LeScanType::ACTIVE; param.le_scan_interval_ = 0x4; param.le_scan_window_ = 0x4; diff --git a/tools/rootcanal/test/controller/le/le_set_extended_scan_enable_test.cc b/tools/rootcanal/test/controller/le/le_set_extended_scan_enable_test.cc index 79b9663619..278b9d06aa 100644 --- a/tools/rootcanal/test/controller/le/le_set_extended_scan_enable_test.cc +++ b/tools/rootcanal/test/controller/le/le_set_extended_scan_enable_test.cc @@ -33,10 +33,10 @@ class LeSetExtendedScanEnableTest : public ::testing::Test { LinkLayerController controller_{address_, properties_}; }; -static PhyScanParameters MakePhyScanParameters(LeScanType scan_type, - uint16_t scan_interval, - uint16_t scan_window) { - PhyScanParameters parameters; +static ScanningPhyParameters MakeScanningPhyParameters(LeScanType scan_type, + uint16_t scan_interval, + uint16_t scan_window) { + ScanningPhyParameters parameters; parameters.le_scan_type_ = scan_type; parameters.le_scan_interval_ = scan_interval; parameters.le_scan_window_ = scan_window; @@ -44,22 +44,24 @@ static PhyScanParameters MakePhyScanParameters(LeScanType scan_type, } TEST_F(LeSetExtendedScanEnableTest, EnableUsingPublicAddress) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 0, 0), ErrorCode::SUCCESS); } TEST_F(LeSetExtendedScanEnableTest, EnableUsingRandomAddress) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::RANDOM_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::RANDOM_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetRandomAddress(Address{1}), ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 0, 0), @@ -67,11 +69,12 @@ TEST_F(LeSetExtendedScanEnableTest, EnableUsingRandomAddress) { } TEST_F(LeSetExtendedScanEnableTest, EnableUsingResolvableAddress) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetRandomAddress(Address{1}), ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 0, 0), @@ -79,11 +82,12 @@ TEST_F(LeSetExtendedScanEnableTest, EnableUsingResolvableAddress) { } TEST_F(LeSetExtendedScanEnableTest, ResetEachPeriod) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::RESET_EACH_PERIOD, 100, 1000), ErrorCode::SUCCESS); @@ -96,11 +100,12 @@ TEST_F(LeSetExtendedScanEnableTest, Disable) { } TEST_F(LeSetExtendedScanEnableTest, ValidDuration) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 127, 1), @@ -108,11 +113,12 @@ TEST_F(LeSetExtendedScanEnableTest, ValidDuration) { } TEST_F(LeSetExtendedScanEnableTest, InvalidDuration) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::RESET_EACH_PERIOD, 0, 0), @@ -123,20 +129,22 @@ TEST_F(LeSetExtendedScanEnableTest, InvalidDuration) { } TEST_F(LeSetExtendedScanEnableTest, NoRandomAddress) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::RANDOM_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::RANDOM_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 0, 0), ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::SUCCESS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::RESOLVABLE_OR_RANDOM_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 0, 0), ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); diff --git a/tools/rootcanal/test/controller/le/le_set_extended_scan_parameters_test.cc b/tools/rootcanal/test/controller/le/le_set_extended_scan_parameters_test.cc index 0c153ea1ac..3e1ab5390a 100644 --- a/tools/rootcanal/test/controller/le/le_set_extended_scan_parameters_test.cc +++ b/tools/rootcanal/test/controller/le/le_set_extended_scan_parameters_test.cc @@ -33,10 +33,10 @@ class LeSetExtendedScanParametersTest : public ::testing::Test { LinkLayerController controller_{address_, properties_}; }; -static PhyScanParameters MakePhyScanParameters(LeScanType scan_type, - uint16_t scan_interval, - uint16_t scan_window) { - PhyScanParameters parameters; +static ScanningPhyParameters MakeScanningPhyParameters(LeScanType scan_type, + uint16_t scan_interval, + uint16_t scan_window) { + ScanningPhyParameters parameters; parameters.le_scan_type_ = scan_type; parameters.le_scan_interval_ = scan_interval; parameters.le_scan_window_ = scan_window; @@ -47,8 +47,8 @@ TEST_F(LeSetExtendedScanParametersTest, Success) { ASSERT_EQ(controller_.LeSetExtendedScanParameters( OwnAddressType::PUBLIC_DEVICE_ADDRESS, LeScanningFilterPolicy::ACCEPT_ALL, 0x5, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200), - MakePhyScanParameters(LeScanType::ACTIVE, 0x2000, 0x200)}), + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200), + MakeScanningPhyParameters(LeScanType::ACTIVE, 0x2000, 0x200)}), ErrorCode::SUCCESS); } @@ -56,8 +56,8 @@ TEST_F(LeSetExtendedScanParametersTest, ScanningActive) { ASSERT_EQ(controller_.LeSetExtendedScanParameters( OwnAddressType::PUBLIC_DEVICE_ADDRESS, LeScanningFilterPolicy::ACCEPT_ALL, 0x5, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200), - MakePhyScanParameters(LeScanType::ACTIVE, 0x2000, 0x200)}), + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200), + MakeScanningPhyParameters(LeScanType::ACTIVE, 0x2000, 0x200)}), ErrorCode::SUCCESS); ASSERT_EQ(controller_.LeSetExtendedScanEnable( true, FilterDuplicates::DISABLED, 0, 0), @@ -66,17 +66,18 @@ TEST_F(LeSetExtendedScanParametersTest, ScanningActive) { ASSERT_EQ(controller_.LeSetExtendedScanParameters( OwnAddressType::PUBLIC_DEVICE_ADDRESS, LeScanningFilterPolicy::ACCEPT_ALL, 0x5, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200), - MakePhyScanParameters(LeScanType::ACTIVE, 0x2000, 0x200)}), + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200), + MakeScanningPhyParameters(LeScanType::ACTIVE, 0x2000, 0x200)}), ErrorCode::COMMAND_DISALLOWED); } TEST_F(LeSetExtendedScanParametersTest, ReservedPhy) { - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x80, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x80, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE); } TEST_F(LeSetExtendedScanParametersTest, InvalidPhyParameters) { @@ -85,19 +86,20 @@ TEST_F(LeSetExtendedScanParametersTest, InvalidPhyParameters) { LeScanningFilterPolicy::ACCEPT_ALL, 0x1, {}), ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200), - MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), - ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200), + MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x200)}), + ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); } TEST_F(LeSetExtendedScanParametersTest, InvalidScanInterval) { ASSERT_EQ(controller_.LeSetExtendedScanParameters( OwnAddressType::PUBLIC_DEVICE_ADDRESS, LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x0, 0x200)}), + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x0, 0x200)}), ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); } @@ -105,14 +107,15 @@ TEST_F(LeSetExtendedScanParametersTest, InvalidScanWindow) { ASSERT_EQ(controller_.LeSetExtendedScanParameters( OwnAddressType::PUBLIC_DEVICE_ADDRESS, LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x0)}), + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x0)}), ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); - ASSERT_EQ(controller_.LeSetExtendedScanParameters( - OwnAddressType::PUBLIC_DEVICE_ADDRESS, - LeScanningFilterPolicy::ACCEPT_ALL, 0x1, - {MakePhyScanParameters(LeScanType::PASSIVE, 0x2000, 0x2001)}), - ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); + ASSERT_EQ( + controller_.LeSetExtendedScanParameters( + OwnAddressType::PUBLIC_DEVICE_ADDRESS, + LeScanningFilterPolicy::ACCEPT_ALL, 0x1, + {MakeScanningPhyParameters(LeScanType::PASSIVE, 0x2000, 0x2001)}), + ErrorCode::INVALID_HCI_COMMAND_PARAMETERS); } } // namespace rootcanal diff --git a/tools/rootcanal/test/controller/le/test_helpers.h b/tools/rootcanal/test/controller/le/test_helpers.h index 074e258d5c..4c9016c22c 100644 --- a/tools/rootcanal/test/controller/le/test_helpers.h +++ b/tools/rootcanal/test/controller/le/test_helpers.h @@ -49,18 +49,18 @@ MakeAdvertisingEventProperties(unsigned mask = 0) { return set; } -[[maybe_unused]] static bluetooth::hci::LeCreateConnPhyScanParameters +[[maybe_unused]] static bluetooth::hci::InitiatingPhyParameters MakeInitiatingPhyParameters(uint16_t scan_interval, uint16_t scan_window, uint16_t connection_interval_min, uint16_t connection_interval_max, uint16_t max_latency, uint16_t supervision_timeout, uint16_t min_ce_length, uint16_t max_ce_length) { - bluetooth::hci::LeCreateConnPhyScanParameters parameters; + bluetooth::hci::InitiatingPhyParameters parameters; parameters.scan_interval_ = scan_interval; parameters.scan_window_ = scan_window; - parameters.conn_interval_min_ = connection_interval_min; - parameters.conn_interval_max_ = connection_interval_max; - parameters.conn_latency_ = max_latency; + parameters.connection_interval_min_ = connection_interval_min; + parameters.connection_interval_max_ = connection_interval_max; + parameters.max_latency_ = max_latency; parameters.supervision_timeout_ = supervision_timeout; parameters.min_ce_length_ = min_ce_length; parameters.max_ce_length_ = max_ce_length; |