def __init__(self, device, cid, l2cap_stream): self._device = device self._cid = cid self._le_l2cap_stream = l2cap_stream self._our_le_l2cap_view = FilteringEventStream( self._le_l2cap_stream, L2capMatchers.PacketPayloadWithMatchingCid(self._cid))
def __init__(self, device, psm, l2cap_stream): self._device = device self._psm = psm self._le_l2cap_stream = l2cap_stream self._our_le_l2cap_view = FilteringEventStream( self._le_l2cap_stream, L2capMatchers.PacketPayloadWithMatchingPsm(self._psm))
def test_filtering_event_stream_none_filter_function(self): with EventStream(FetchEvents(events=[1, 2, 3], delay_ms=50)) as event_stream: filtered_event_stream = FilteringEventStream(event_stream, None) assertThat(filtered_event_stream)\ .emits(lambda data: data.value_ == 1)\ .then(lambda data: data.value_ == 3)
def __init__(self, device, cis_handle, iso_data_stream): self._device = device self._cis_handle = cis_handle self._le_iso_data_stream = iso_data_stream self._our_le_iso_cis_view = FilteringEventStream( self._le_iso_data_stream, IsoMatchers.PacketPayloadWithMatchingCisHandle(self._cis_handle))
def __init__(self, device, scid, dcid, acl_stream, acl, control_channel, fcs=None): self._device = device self._scid = scid self._dcid = dcid self._acl_stream = acl_stream self._acl = acl self._control_channel = control_channel self._config_rsp_received = False self._config_rsp_sent = False if fcs == l2cap_packets.FcsType.DEFAULT: self._our_acl_view = FilteringEventStream( acl_stream, L2capMatchers.ExtractBasicFrameWithFcs(scid)) else: self._our_acl_view = FilteringEventStream( acl_stream, L2capMatchers.ExtractBasicFrame(scid))
def __init__(self, device, scid, dcid, acl_stream, acl, control_channel, initial_credits=0): self._device = device self._scid = scid self._dcid = dcid self._acl_stream = acl_stream self._acl = acl self._control_channel = control_channel self._our_acl_view = FilteringEventStream( acl_stream, L2capMatchers.ExtractBasicFrame(scid)) self._credits_left = initial_credits
def __init__(self, handle, acl_stream, device): self.handle = int(handle) self.device = device # todo, handle we got is 0, so doesn't match - fix before enabling filtering self.our_acl_stream = FilteringEventStream(acl_stream, None)
def __init__(self, handle, acl_stream, device): self.handle = int(handle) self.device = device self.our_acl_stream = FilteringEventStream(acl_stream, None)