Пример #1
0
    def test_inquiry_from_dut(self):
        self.dut_hci.register_for_events(hci_packets.EventCode.INQUIRY_RESULT)

        self.send_hal_hci_command(
            hci_packets.WriteScanEnableBuilder(
                hci_packets.ScanEnable.INQUIRY_AND_PAGE_SCAN))
        lap = hci_packets.Lap()
        lap.lap = 0x33
        self.dut_hci.send_command_with_status(
            hci_packets.InquiryBuilder(lap, 0x30, 0xff))
        assertThat(self.dut_hci.get_event_stream()).emits(
            HciMatchers.EventWithCode(hci_packets.EventCode.INQUIRY_RESULT))
Пример #2
0
    def test_inquiry_from_dut(self):
        self.cert_hal.send_hci_command(
            hci_packets.WriteScanEnableBuilder(
                hci_packets.ScanEnable.INQUIRY_AND_PAGE_SCAN))

        lap = hci_packets.Lap()
        lap.lap = 0x33
        self.dut_hal.send_hci_command(
            hci_packets.InquiryBuilder(lap, 0x30, 0xff))

        assertThat(self.dut_hal.get_hci_event_stream()).emits(
            lambda packet: b'\x02\x0f' in packet.payload
            # Expecting an HCI Event (code 0x02, length 0x0f)
        )
Пример #3
0
 def test_inquiry_from_dut(self):
     with EventCallbackStream(
             self.device_under_test.hal.FetchHciEvent(
                 empty_pb2.Empty())) as hci_event_stream:
         hci_event_asserts = EventAsserts(hci_event_stream)
         self.send_cert_hci_command(
             hci_packets.WriteScanEnableBuilder(
                 hci_packets.ScanEnable.INQUIRY_AND_PAGE_SCAN))
         lap = hci_packets.Lap()
         lap.lap = 0x33
         self.send_dut_hci_command(
             hci_packets.InquiryBuilder(lap, 0x30, 0xff))
         hci_event_asserts.assert_event_occurs(
             lambda packet: b'\x02\x0f' in packet.payload
             # Expecting an HCI Event (code 0x02, length 0x0f)
         )
Пример #4
0
    def test_inquiry_from_dut(self):
        self.register_for_event(hci_packets.EventCode.INQUIRY_RESULT)
        with EventStream(self.dut.hci.FetchEvents(
                empty_proto.Empty())) as hci_event_stream:

            self.send_hal_hci_command(
                hci_packets.WriteScanEnableBuilder(
                    hci_packets.ScanEnable.INQUIRY_AND_PAGE_SCAN))
            lap = hci_packets.Lap()
            lap.lap = 0x33
            self.enqueue_hci_command(
                hci_packets.InquiryBuilder(lap, 0x30, 0xff), False)
            hci_event_stream.assert_event_occurs(
                lambda packet: b'\x02\x0f' in packet.event
                # Expecting an HCI Event (code 0x02, length 0x0f)
            )