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

Commit 9e612045 authored by Zach Johnson's avatar Zach Johnson
Browse files

Add shortcut for enabling inquiry in PyHal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I74197927c8a61b9ab970557a9f49830b26b2d876
parent 3440ab69
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ from cert.event_stream import EventStream
from cert.closable import Closable
from cert.closable import safeClose
from hal import facade_pb2 as hal_facade
from bluetooth_packets_python3.hci_packets import WriteScanEnableBuilder
from bluetooth_packets_python3.hci_packets import ScanEnable


class PyHal(Closable):
@@ -46,3 +48,6 @@ class PyHal(Closable):

    def send_acl(self, acl):
        self.device.hal.SendAcl(hal_facade.AclPacket(payload=bytes(acl)))

    def enable_inquiry_and_page_scan(self):
        self.send_hci_command(WriteScanEnableBuilder(ScanEnable.INQUIRY_AND_PAGE_SCAN))
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ class DirectHciTest(GdBaseTestClass):
    def test_inquiry_from_dut(self):
        self.dut_hci.register_for_events(EventCode.INQUIRY_RESULT)

        self.cert_hal.send_hci_command(WriteScanEnableBuilder(ScanEnable.INQUIRY_AND_PAGE_SCAN))
        self.cert_hal.enable_inquiry_and_page_scan()
        lap = Lap()
        lap.lap = 0x33
        self.dut_hci.send_command_with_status(InquiryBuilder(lap, 0x30, 0xff))