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

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

Add helper function on hci, to simplify hci event stream creation

Test: cert/run --host --test_filter=AclManagerTest
Change-Id: I0a0159eadc45dc54201ccea4b6167b059430de49
parent 4ce6a8e7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ from neighbor.facade import facade_pb2_grpc as neighbor_facade_pb2_grpc
from l2cap.classic import facade_pb2_grpc as l2cap_facade_pb2_grpc
from security import facade_pb2_grpc as security_facade_pb2_grpc
from google.protobuf import empty_pb2 as empty_proto
from cert.event_stream import EventStream

ACTS_CONTROLLER_CONFIG_NAME = "GdDevice"
ACTS_CONTROLLER_REFERENCE_NAME = "gd_devices"
@@ -85,6 +86,7 @@ class GdDevice(GdDeviceBase):
            self.grpc_channel)
        self.hci = hci_facade_pb2_grpc.HciLayerFacadeStub(self.grpc_channel)
        self.hci.register_for_events = self.__register_for_hci_events
        self.hci.new_event_stream = lambda: EventStream(self.hci.FetchEvents(empty_proto.Empty()))
        self.l2cap = l2cap_facade_pb2_grpc.L2capClassicModuleFacadeStub(
            self.grpc_channel)
        self.hci_acl_manager = acl_manager_facade_pb2_grpc.AclManagerFacadeStub(
+3 −3
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ class AclManagerTest(GdFacadeOnlyBaseTestClass):
            hci_packets.EventCode.CONNECTION_COMPLETE,
            hci_packets.EventCode.CONNECTION_PACKET_TYPE_CHANGED)

        with EventStream(self.cert.hci.FetchEvents(empty_proto.Empty())) as cert_hci_event_stream, \
        with self.cert.hci.new_event_stream() as cert_hci_event_stream, \
            EventStream(self.cert.hci.FetchAclPackets(empty_proto.Empty())) as cert_acl_data_stream, \
            EventStream(self.dut.hci_acl_manager.FetchAclData(empty_proto.Empty())) as acl_data_stream:

@@ -129,7 +129,7 @@ class AclManagerTest(GdFacadeOnlyBaseTestClass):
            hci_packets.EventCode.CONNECTION_COMPLETE,
            hci_packets.EventCode.CONNECTION_PACKET_TYPE_CHANGED)

        with EventStream(self.cert.hci.FetchEvents(empty_proto.Empty())) as cert_hci_event_stream, \
        with self.cert.hci.new_event_stream() as cert_hci_event_stream, \
            EventStream(self.cert.hci.FetchAclPackets(empty_proto.Empty())) as cert_acl_data_stream, \
            EventStream(self.dut.hci_acl_manager.FetchIncomingConnection(empty_proto.Empty())) as incoming_connection_stream, \
            EventStream(self.dut.hci_acl_manager.FetchAclData(empty_proto.Empty())) as acl_data_stream:
@@ -186,7 +186,7 @@ class AclManagerTest(GdFacadeOnlyBaseTestClass):
            hci_packets.EventCode.CONNECTION_COMPLETE,
            hci_packets.EventCode.CONNECTION_PACKET_TYPE_CHANGED)

        with EventStream(self.cert.hci.FetchEvents(empty_proto.Empty())) as cert_hci_event_stream, \
        with self.cert.hci.new_event_stream() as cert_hci_event_stream, \
            EventStream(self.cert.hci.FetchAclPackets(empty_proto.Empty())) as cert_acl_data_stream, \
            EventStream(self.dut.hci_acl_manager.FetchAclData(empty_proto.Empty())) as acl_data_stream: