Example #1
0
    def test_retry_config_after_rejection(self):
        """
        L2CAP/COS/CFD/BV-02-C
        """
        self._setup_link_from_cert()

        self.cert_l2cap.reply_with_unacceptable_parameters()

        self._open_unvalidated_channel(scid=0x41, psm=0x33)

        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationResponse(),
            L2capMatchers.ConfigurationRequest(),
            L2capMatchers.ConfigurationRequest()).inAnyOrder()
Example #2
0
    def _open_channel(self,
                      signal_id=1,
                      scid=0x0101,
                      psm=0x33,
                      use_ertm=False):
        result = self._open_unvalidated_channel(signal_id, scid, psm, use_ertm)

        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationResponse(),
            L2capMatchers.ConfigurationRequest()).inAnyOrder()

        return result
Example #3
0
    def test_initiated_configuration_request_ertm(self):
        """
        L2CAP/CMC/BV-01-C [IUT Initiated Configuration of Enhanced Retransmission Mode]
        Verify the IUT can send a Configuration Request command containing the F&EC option that specifies
        Enhanced Retransmission Mode.
        """
        self._setup_link_from_cert()
        self.cert_l2cap.turn_on_ertm()

        self._open_unvalidated_channel(scid=0x41, psm=0x33, use_ertm=True)

        # TODO: Fix this test. It doesn't work so far with PDL struct

        assertThat(self.cert_l2cap.get_control_channel()).emits(
            L2capMatchers.ConfigurationRequest())
        asserts.skip("Struct not working")
Example #4
0
 def ConfigurationRequest(cid=None):
     return Capture(L2capMatchers.ConfigurationRequest(cid),
                    L2capCaptures._extract_configuration_request)
Example #5
0
 def config_request_for_me(self):
     return L2capMatchers.ConfigurationRequest(self._scid)