Loading system/gd/hci/cert/le_acl_manager_test.py +2 −3 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class LeAclManagerTest(GdBaseTestClass): private_policy = le_initiator_address_facade.PrivacyPolicy( address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS, address_with_type=common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), address=common.BluetoothAddress(address=bytes(b'D0:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS), rotation_irk=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', minimum_rotation_time=(7 * 60 * 1000), Loading Loading @@ -176,7 +176,6 @@ class LeAclManagerTest(GdBaseTestClass): gap_data = le_advertising_facade.GapDataMsg(data=bytes(gap_name.Serialize())) config = le_advertising_facade.AdvertisingConfig( advertisement=[gap_data], random_address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), interval_min=512, interval_max=768, event_type=le_advertising_facade.AdvertisingEventType.ADV_IND, Loading Loading @@ -204,7 +203,7 @@ class LeAclManagerTest(GdBaseTestClass): hci_packets.LeExtendedCreateConnectionBuilder(hci_packets.InitiatorFilterPolicy.USE_PEER_ADDRESS, hci_packets.OwnAddressType.RANDOM_DEVICE_ADDRESS, hci_packets.AddressType.RANDOM_DEVICE_ADDRESS, '0D:05:04:03:02:01', 1, [phy_scan_params]), False) 'D0:05:04:03:02:01', 1, [phy_scan_params]), False) # Cert gets ConnectionComplete with a handle and sends ACL data handle = 0xfff Loading system/gd/hci/le_address_rotator.cc +14 −3 Original line number Diff line number Diff line Loading @@ -32,10 +32,21 @@ void LeAddressRotator::SetPrivacyPolicyForInitiatorAddress(AddressPolicy address case AddressPolicy::USE_PUBLIC_ADDRESS: le_address_ = fixed_address; break; case AddressPolicy::USE_STATIC_ADDRESS: case AddressPolicy::USE_STATIC_ADDRESS: { auto addr = fixed_address.GetAddress(); auto address = addr.address; // The two most significant bits of the static address shall be equal to 1 ASSERT_LOG((address[5] & BLE_ADDR_MASK) == BLE_ADDR_MASK, "The two most significant bits shall be equal to 1"); // Bits of the random part of the address shall not be all 1 or all 0 if ((address[0] == 0x00 && address[1] == 0x00 && address[2] == 0x00 && address[3] == 0x00 && address[4] == 0x00 && address[5] == BLE_ADDR_MASK) || (address[0] == 0xFF && address[1] == 0xFF && address[2] == 0xFF && address[3] == 0xFF && address[4] == 0xFF && address[5] == 0xFF)) { LOG_ALWAYS_FATAL("Bits of the random part of the address shall not be all 1 or all 0"); } le_address_ = fixed_address; handler_->Post(common::Bind(set_random_address_, le_address_.GetAddress())); break; } break; case AddressPolicy::USE_NON_RESOLVABLE_ADDRESS: case AddressPolicy::USE_RESOLVABLE_ADDRESS: rotation_irk_ = rotation_irk; Loading @@ -43,7 +54,7 @@ void LeAddressRotator::SetPrivacyPolicyForInitiatorAddress(AddressPolicy address maximum_rotation_time_ = maximum_rotation_time; address_rotation_alarm_ = std::make_unique<os::Alarm>(handler_); break; default: case AddressPolicy::POLICY_NOT_SET: LOG_ALWAYS_FATAL("invalid parameters"); } } Loading system/gd/l2cap/le/cert/dual_l2cap_test.py +2 −2 Original line number Diff line number Diff line Loading @@ -50,9 +50,9 @@ class DualL2capTest(GdBaseTestClass): self.dut_le_l2cap = PyLeL2cap(self.dut) self.cert_le_l2cap = CertLeL2cap(self.cert) self.dut_le_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'D0:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) self.cert_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'55:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'C0:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) dut_privacy_policy = le_initiator_address_facade.PrivacyPolicy( address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS, address_with_type=self.dut_le_address, Loading system/gd/l2cap/le/cert/le_l2cap_test.py +2 −2 Original line number Diff line number Diff line Loading @@ -44,9 +44,9 @@ class LeL2capTest(GdBaseTestClass): self.dut_l2cap = PyLeL2cap(self.dut) self.cert_l2cap = CertLeL2cap(self.cert) self.dut_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'D0:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) self.cert_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'55:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'C0:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) dut_privacy_policy = le_initiator_address_facade.PrivacyPolicy( address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS, address_with_type=self.dut_address, Loading Loading
system/gd/hci/cert/le_acl_manager_test.py +2 −3 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class LeAclManagerTest(GdBaseTestClass): private_policy = le_initiator_address_facade.PrivacyPolicy( address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS, address_with_type=common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), address=common.BluetoothAddress(address=bytes(b'D0:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS), rotation_irk=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', minimum_rotation_time=(7 * 60 * 1000), Loading Loading @@ -176,7 +176,6 @@ class LeAclManagerTest(GdBaseTestClass): gap_data = le_advertising_facade.GapDataMsg(data=bytes(gap_name.Serialize())) config = le_advertising_facade.AdvertisingConfig( advertisement=[gap_data], random_address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), interval_min=512, interval_max=768, event_type=le_advertising_facade.AdvertisingEventType.ADV_IND, Loading Loading @@ -204,7 +203,7 @@ class LeAclManagerTest(GdBaseTestClass): hci_packets.LeExtendedCreateConnectionBuilder(hci_packets.InitiatorFilterPolicy.USE_PEER_ADDRESS, hci_packets.OwnAddressType.RANDOM_DEVICE_ADDRESS, hci_packets.AddressType.RANDOM_DEVICE_ADDRESS, '0D:05:04:03:02:01', 1, [phy_scan_params]), False) 'D0:05:04:03:02:01', 1, [phy_scan_params]), False) # Cert gets ConnectionComplete with a handle and sends ACL data handle = 0xfff Loading
system/gd/hci/le_address_rotator.cc +14 −3 Original line number Diff line number Diff line Loading @@ -32,10 +32,21 @@ void LeAddressRotator::SetPrivacyPolicyForInitiatorAddress(AddressPolicy address case AddressPolicy::USE_PUBLIC_ADDRESS: le_address_ = fixed_address; break; case AddressPolicy::USE_STATIC_ADDRESS: case AddressPolicy::USE_STATIC_ADDRESS: { auto addr = fixed_address.GetAddress(); auto address = addr.address; // The two most significant bits of the static address shall be equal to 1 ASSERT_LOG((address[5] & BLE_ADDR_MASK) == BLE_ADDR_MASK, "The two most significant bits shall be equal to 1"); // Bits of the random part of the address shall not be all 1 or all 0 if ((address[0] == 0x00 && address[1] == 0x00 && address[2] == 0x00 && address[3] == 0x00 && address[4] == 0x00 && address[5] == BLE_ADDR_MASK) || (address[0] == 0xFF && address[1] == 0xFF && address[2] == 0xFF && address[3] == 0xFF && address[4] == 0xFF && address[5] == 0xFF)) { LOG_ALWAYS_FATAL("Bits of the random part of the address shall not be all 1 or all 0"); } le_address_ = fixed_address; handler_->Post(common::Bind(set_random_address_, le_address_.GetAddress())); break; } break; case AddressPolicy::USE_NON_RESOLVABLE_ADDRESS: case AddressPolicy::USE_RESOLVABLE_ADDRESS: rotation_irk_ = rotation_irk; Loading @@ -43,7 +54,7 @@ void LeAddressRotator::SetPrivacyPolicyForInitiatorAddress(AddressPolicy address maximum_rotation_time_ = maximum_rotation_time; address_rotation_alarm_ = std::make_unique<os::Alarm>(handler_); break; default: case AddressPolicy::POLICY_NOT_SET: LOG_ALWAYS_FATAL("invalid parameters"); } } Loading
system/gd/l2cap/le/cert/dual_l2cap_test.py +2 −2 Original line number Diff line number Diff line Loading @@ -50,9 +50,9 @@ class DualL2capTest(GdBaseTestClass): self.dut_le_l2cap = PyLeL2cap(self.dut) self.cert_le_l2cap = CertLeL2cap(self.cert) self.dut_le_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'D0:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) self.cert_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'55:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'C0:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) dut_privacy_policy = le_initiator_address_facade.PrivacyPolicy( address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS, address_with_type=self.dut_le_address, Loading
system/gd/l2cap/le/cert/le_l2cap_test.py +2 −2 Original line number Diff line number Diff line Loading @@ -44,9 +44,9 @@ class LeL2capTest(GdBaseTestClass): self.dut_l2cap = PyLeL2cap(self.dut) self.cert_l2cap = CertLeL2cap(self.cert) self.dut_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'0D:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'D0:05:04:03:02:01')), type=common.RANDOM_DEVICE_ADDRESS) self.cert_address = common.BluetoothAddressWithType( address=common.BluetoothAddress(address=bytes(b'55:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) address=common.BluetoothAddress(address=bytes(b'C0:11:FF:AA:33:22')), type=common.RANDOM_DEVICE_ADDRESS) dut_privacy_policy = le_initiator_address_facade.PrivacyPolicy( address_policy=le_initiator_address_facade.AddressPolicy.USE_STATIC_ADDRESS, address_with_type=self.dut_address, Loading