# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
import hci_packets as hci import link_layer_packets as ll import unittest from hci_packets import ErrorCode from py.bluetooth import Address from py.controller import ControllerTest, generate_rpa
ifnot controller.le_features.ll_privacy:
self.skipTest("LL privacy not supported")
# 1. Configure the Lower Tester to advertise using a valid public or static random address (identity # address).
# 2. The Upper Tester adds the Identity Address of the Lower Tester to the Resolving List with all zero # peer IRK, and with a local IRK.
controller.send_cmd(
hci.LeAddDeviceToResolvingList(
peer_irk=bytes([0] * 16),
local_irk=local_irk,
peer_identity_address=peer_address,
peer_identity_address_type=hci.PeerAddressType.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS))
# 4. Lower Tester sends ADV_IND packets, each advertising event on the selected advertising # channel, using the selected advertising interval.
controller.send_ll(ll.LeLegacyAdvertisingPdu(
source_address=peer_address,
advertising_address_type=ll.AddressType.PUBLIC,
advertising_type=ll.LegacyAdvertisingType.ADV_IND,
advertising_data=[1, 2, 3]),
rssi=-16)
# 5. The Lower Tester receives a CONNECT_IND packet T_IFS after any of the ADV_IND packets. # The InitA field contains a resolvable private address from the IUT.
connect_ind = await self.expect_ll(
ll.LeConnect(source_address=self.Any,
destination_address=peer_address,
initiating_address_type=ll.AddressType.RANDOM,
advertising_address_type=ll.AddressType.PUBLIC,
conn_interval=0x200,
conn_peripheral_latency=0x6,
conn_supervision_timeout=0xc80))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.