Loading tools/rootcanal/py/controller.py +14 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,14 @@ from typing import Optional from hci_packets import ErrorCode class LeFeatures: def __init__(self, le_features: int): self.mask = le_features self.ll_privacy = (le_features & hci.LLFeaturesBits.LL_PRIVACY) != 0 self.le_extended_advertising = (le_features & hci.LLFeaturesBits.LE_EXTENDED_ADVERTISING) != 0 class Controller(rootcanal.BaseController): """Binder class to DualModeController. The methods send_cmd, send_hci, send_ll are used to inject HCI or LL Loading Loading @@ -115,6 +123,12 @@ class ControllerTest(unittest.IsolatedAsyncioTestCase): await controller.expect_evt(hci.SetEventMaskComplete(status=ErrorCode.SUCCESS, num_hci_command_packets=1)) controller.send_cmd(hci.LeSetEventMask(le_event_mask=0xffffffffffffffff)) await controller.expect_evt(hci.LeSetEventMaskComplete(status=ErrorCode.SUCCESS, num_hci_command_packets=1)) controller.send_cmd(hci.LeReadLocalSupportedFeatures()) # Load the local supported features to be able to disable tests # that rely on unsupported features. evt = await self.expect_cmd_complete(hci.LeReadLocalSupportedFeaturesComplete) controller.le_features = LeFeatures(evt.le_features) async def expect_evt(self, expected_evt: hci.Event, timeout: int = 3): packet = await asyncio.wait_for(self.controller.receive_evt(), timeout=timeout) Loading tools/rootcanal/test/LL/DDI/SCN/BV_13_C.py +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ class Test(ControllerTest): peer_identity_address_type = hci.PeerAddressType.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS peer_resolvable_address = Address(rootcanal.generate_rpa(peer_irk)) if not controller.le_features.ll_privacy: self.skipTest("LL privacy not supported") # 1. The Upper Tester populates the IUT resolving list with the peer IRK # and identity address. controller.send_cmd( Loading tools/rootcanal/test/LL/DDI/SCN/BV_14_C.py +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,9 @@ class Test(ControllerTest): local_resolvable_address_1 = Address(rootcanal.generate_rpa(local_irk)) local_resolvable_address_2 = Address(rootcanal.generate_rpa(local_irk)) if not controller.le_features.ll_privacy: self.skipTest("LL privacy not supported") # 1. The Upper Tester sets a resolvable private address for the IUT to use. controller.send_cmd(hci.LeSetRandomAddress(random_address=local_resolvable_address_1)) Loading tools/rootcanal/test/LL/DDI/SCN/BV_18_C.py +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ class Test(ControllerTest): peer_identity_address_type = hci.PeerAddressType.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS peer_resolvable_address = Address(rootcanal.generate_rpa(peer_irk)) if not controller.le_features.ll_privacy: self.skipTest("LL privacy not supported") # 1. Upper Tester sends an HCI_LE_Set_Random_Address to the IUT with a # random static address. controller.send_cmd(hci.LeSetRandomAddress(random_address=local_random_address)) Loading Loading
tools/rootcanal/py/controller.py +14 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,14 @@ from typing import Optional from hci_packets import ErrorCode class LeFeatures: def __init__(self, le_features: int): self.mask = le_features self.ll_privacy = (le_features & hci.LLFeaturesBits.LL_PRIVACY) != 0 self.le_extended_advertising = (le_features & hci.LLFeaturesBits.LE_EXTENDED_ADVERTISING) != 0 class Controller(rootcanal.BaseController): """Binder class to DualModeController. The methods send_cmd, send_hci, send_ll are used to inject HCI or LL Loading Loading @@ -115,6 +123,12 @@ class ControllerTest(unittest.IsolatedAsyncioTestCase): await controller.expect_evt(hci.SetEventMaskComplete(status=ErrorCode.SUCCESS, num_hci_command_packets=1)) controller.send_cmd(hci.LeSetEventMask(le_event_mask=0xffffffffffffffff)) await controller.expect_evt(hci.LeSetEventMaskComplete(status=ErrorCode.SUCCESS, num_hci_command_packets=1)) controller.send_cmd(hci.LeReadLocalSupportedFeatures()) # Load the local supported features to be able to disable tests # that rely on unsupported features. evt = await self.expect_cmd_complete(hci.LeReadLocalSupportedFeaturesComplete) controller.le_features = LeFeatures(evt.le_features) async def expect_evt(self, expected_evt: hci.Event, timeout: int = 3): packet = await asyncio.wait_for(self.controller.receive_evt(), timeout=timeout) Loading
tools/rootcanal/test/LL/DDI/SCN/BV_13_C.py +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ class Test(ControllerTest): peer_identity_address_type = hci.PeerAddressType.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS peer_resolvable_address = Address(rootcanal.generate_rpa(peer_irk)) if not controller.le_features.ll_privacy: self.skipTest("LL privacy not supported") # 1. The Upper Tester populates the IUT resolving list with the peer IRK # and identity address. controller.send_cmd( Loading
tools/rootcanal/test/LL/DDI/SCN/BV_14_C.py +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,9 @@ class Test(ControllerTest): local_resolvable_address_1 = Address(rootcanal.generate_rpa(local_irk)) local_resolvable_address_2 = Address(rootcanal.generate_rpa(local_irk)) if not controller.le_features.ll_privacy: self.skipTest("LL privacy not supported") # 1. The Upper Tester sets a resolvable private address for the IUT to use. controller.send_cmd(hci.LeSetRandomAddress(random_address=local_resolvable_address_1)) Loading
tools/rootcanal/test/LL/DDI/SCN/BV_18_C.py +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ class Test(ControllerTest): peer_identity_address_type = hci.PeerAddressType.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS peer_resolvable_address = Address(rootcanal.generate_rpa(peer_irk)) if not controller.le_features.ll_privacy: self.skipTest("LL privacy not supported") # 1. Upper Tester sends an HCI_LE_Set_Random_Address to the IUT with a # random static address. controller.send_cmd(hci.LeSetRandomAddress(random_address=local_random_address)) Loading