Loading system/gd/cert/matchers.py +15 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,10 @@ class L2capMatchers(object): def ExtractBasicFrameWithFcs(scid): return lambda packet: L2capMatchers._basic_frame_with_fcs_for(packet, scid) @staticmethod def InformationRequestWithType(info_type): return lambda packet: L2capMatchers._information_request_with_type(packet, info_type) @staticmethod def InformationResponseExtendedFeatures(supports_ertm=None, supports_streaming=None, Loading Loading @@ -490,6 +494,17 @@ class L2capMatchers(object): request = l2cap_packets.LeFlowControlCreditView(frame) return request.GetCid() == cid @staticmethod def _information_request_with_type(packet, info_type): frame = L2capMatchers.control_frame_with_code( packet, CommandCode.INFORMATION_REQUEST) if frame is None: return None request = l2cap_packets.InformationRequestView(frame) if request.GetInfoType() != info_type: return None return request @staticmethod def _information_response_with_type(packet, info_type): frame = L2capMatchers.control_frame_with_code( Loading system/gd/l2cap/classic/cert/l2cap_test.py +14 −2 Original line number Diff line number Diff line Loading @@ -441,8 +441,6 @@ class L2capTest(GdBaseTestClass): type of Extended Features that correctly identifies that the Fixed Channels option is locally supported """ asserts.skip("Fixed channel is not supported") self._setup_link_from_cert() control_channel = self.cert_l2cap.get_control_channel() Loading @@ -452,6 +450,20 @@ class L2capTest(GdBaseTestClass): L2capMatchers.InformationResponseExtendedFeatures( supports_fixed_channels=True)) @metadata( pts_test_id="L2CAP/FIX/BV-01-C", pts_test_name="Fixed Channels Supported Information Request") def test_fixed_channels_supported_information_request(self): """ Verify that the IUT can send an Information Request for the information type of Fixed Channels Supported. """ self._setup_link_from_cert() assertThat(self.cert_l2cap.get_control_channel()).emits( L2capMatchers.InformationRequestWithType( l2cap_packets.InformationRequestInfoType. FIXED_CHANNELS_SUPPORTED)) @metadata( pts_test_id="L2CAP/FOC/BV-01-C", pts_test_name="IUT Initiated Configuration of the FCS Option") Loading Loading
system/gd/cert/matchers.py +15 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,10 @@ class L2capMatchers(object): def ExtractBasicFrameWithFcs(scid): return lambda packet: L2capMatchers._basic_frame_with_fcs_for(packet, scid) @staticmethod def InformationRequestWithType(info_type): return lambda packet: L2capMatchers._information_request_with_type(packet, info_type) @staticmethod def InformationResponseExtendedFeatures(supports_ertm=None, supports_streaming=None, Loading Loading @@ -490,6 +494,17 @@ class L2capMatchers(object): request = l2cap_packets.LeFlowControlCreditView(frame) return request.GetCid() == cid @staticmethod def _information_request_with_type(packet, info_type): frame = L2capMatchers.control_frame_with_code( packet, CommandCode.INFORMATION_REQUEST) if frame is None: return None request = l2cap_packets.InformationRequestView(frame) if request.GetInfoType() != info_type: return None return request @staticmethod def _information_response_with_type(packet, info_type): frame = L2capMatchers.control_frame_with_code( Loading
system/gd/l2cap/classic/cert/l2cap_test.py +14 −2 Original line number Diff line number Diff line Loading @@ -441,8 +441,6 @@ class L2capTest(GdBaseTestClass): type of Extended Features that correctly identifies that the Fixed Channels option is locally supported """ asserts.skip("Fixed channel is not supported") self._setup_link_from_cert() control_channel = self.cert_l2cap.get_control_channel() Loading @@ -452,6 +450,20 @@ class L2capTest(GdBaseTestClass): L2capMatchers.InformationResponseExtendedFeatures( supports_fixed_channels=True)) @metadata( pts_test_id="L2CAP/FIX/BV-01-C", pts_test_name="Fixed Channels Supported Information Request") def test_fixed_channels_supported_information_request(self): """ Verify that the IUT can send an Information Request for the information type of Fixed Channels Supported. """ self._setup_link_from_cert() assertThat(self.cert_l2cap.get_control_channel()).emits( L2capMatchers.InformationRequestWithType( l2cap_packets.InformationRequestInfoType. FIXED_CHANNELS_SUPPORTED)) @metadata( pts_test_id="L2CAP/FOC/BV-01-C", pts_test_name="IUT Initiated Configuration of the FCS Option") Loading