Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8567101 authored by Zach Johnson's avatar Zach Johnson
Browse files

Add HAL reset helper

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Ia2df0a7e05e8d8fccc8af5005c3fb2e4a5d6a6fe
parent 14087dfc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -147,6 +147,10 @@ class PyHal(Closable):
        assertThat(self.hci_event_stream).emits(read_bd_addr)
        return read_bd_addr.get().GetBdAddr()

    def reset(self):
        self.send_hci_command(hci_packets.ResetBuilder())
        assertThat(self.hci_event_stream).emits(HciMatchers.CommandComplete(OpCode.RESET))

    def enable_inquiry_and_page_scan(self):
        self.send_hci_command(WriteScanEnableBuilder(ScanEnable.INQUIRY_AND_PAGE_SCAN))

+2 −2
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ class SimpleHalTest(GdBaseTestClass):
        self.dut_hal = PyHal(self.dut)
        self.cert_hal = PyHal(self.cert)

        self.dut_hal.send_hci_command(hci_packets.ResetBuilder())
        self.cert_hal.send_hci_command(hci_packets.ResetBuilder())
        self.dut_hal.reset()
        self.cert_hal.reset()

    def teardown_test(self):
        self.dut_hal.close()