示例#1
0
    def setup_test(self):
        super().setup_test()

        self.dut_security = PyLeSecurity(self.dut)
        self.cert_security = PyLeSecurity(self.cert)
        self.dut_hci = PyHci(self.dut)

        self.dut_address = common.BluetoothAddressWithType(
            address=common.BluetoothAddress(
                address=bytes(b'DD:05:04:03:02:01')),
            type=common.RANDOM_DEVICE_ADDRESS)
        privacy_policy = le_initiator_address_facade.PrivacyPolicy(
            address_policy=le_initiator_address_facade.AddressPolicy.
            USE_STATIC_ADDRESS,
            address_with_type=self.dut_address)
        self.dut.security.SetLeInitiatorAddressPolicy(privacy_policy)
        self.cert_address = common.BluetoothAddressWithType(
            address=common.BluetoothAddress(
                address=bytes(b'C5:11:FF:AA:33:22')),
            type=common.RANDOM_DEVICE_ADDRESS)
        cert_privacy_policy = le_initiator_address_facade.PrivacyPolicy(
            address_policy=le_initiator_address_facade.AddressPolicy.
            USE_STATIC_ADDRESS,
            address_with_type=self.cert_address)
        self.cert.security.SetLeInitiatorAddressPolicy(cert_privacy_policy)
示例#2
0
 def __init__(self, device):
     """
         Don't call super b/c the gRPC stream setup will crash test
     """
     logging.info("Cert: Init")
     self._device = device
     self._device.wait_channel_ready()
     self._hci = PyHci(device)
     self._hci.register_for_events(
         hci_packets.EventCode.ENCRYPTION_CHANGE,
         hci_packets.EventCode.CHANGE_CONNECTION_LINK_KEY_COMPLETE,
         hci_packets.EventCode.CENTRAL_LINK_KEY_COMPLETE,
         hci_packets.EventCode.RETURN_LINK_KEYS,
         hci_packets.EventCode.PIN_CODE_REQUEST,
         hci_packets.EventCode.LINK_KEY_REQUEST,
         hci_packets.EventCode.LINK_KEY_NOTIFICATION,
         hci_packets.EventCode.ENCRYPTION_KEY_REFRESH_COMPLETE,
         hci_packets.EventCode.IO_CAPABILITY_REQUEST,
         hci_packets.EventCode.IO_CAPABILITY_RESPONSE,
         hci_packets.EventCode.REMOTE_OOB_DATA_REQUEST,
         hci_packets.EventCode.SIMPLE_PAIRING_COMPLETE,
         hci_packets.EventCode.USER_PASSKEY_NOTIFICATION,
         hci_packets.EventCode.KEYPRESS_NOTIFICATION,
         hci_packets.EventCode.USER_CONFIRMATION_REQUEST,
         hci_packets.EventCode.USER_PASSKEY_REQUEST,
         hci_packets.EventCode.REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION)
     self._hci_event_stream = self._hci.get_event_stream()
示例#3
0
 def setup_test(self):
     super().setup_test()
     self.cert_hci = PyHci(self.cert, acl_streaming=True)
     self.cert_hci.send_command(hci_packets.WriteScanEnableBuilder(hci_packets.ScanEnable.INQUIRY_AND_PAGE_SCAN))
     self.cert_name = b'Im_A_Cert'
     self.cert_address = self.cert_hci.read_own_address()
     self.cert_name += b'@' + self.cert_address.encode('utf8')
     self.dut_neighbor = PyNeighbor(self.dut)
示例#4
0
 def __init__(self, device, cert_address, has_security=False):
     self._device = device
     self._cert_address = cert_address
     self._hci = PyHci(device)
     self._l2cap_stream = EventStream(
         self._device.l2cap.FetchL2capData(empty_proto.Empty()))
     self._security_connection_event_stream = EventStream(
         self._device.l2cap.FetchSecurityConnectionEvents(
             empty_proto.Empty()))
     if has_security == False:
         self._hci.register_for_events(
             hci_packets.EventCode.LINK_KEY_REQUEST)
 def setup_test(self):
     super().setup_test()
     self.cert_hci = PyHci(self.cert, acl_streaming=True)
 def setup_test(self):
     super().setup_test()
     self.cert_hci = PyHci(self.cert, acl_streaming=True)
     self.dut_acl_manager = PyAclManager(self.dut)
示例#7
0
 def setup_test(self):
     super().setup_test()
     self.dut_hci = PyHci(self.dut, acl_streaming=True)
     self.cert_hal = PyHal(self.cert)
     self.cert_hal.send_hci_command(ResetBuilder())
 def setup_test(self):
     super().setup_test()
     self.cert_hci = PyHci(self.cert)
     self.dut_acl_manager = PyAclManager(self.dut)