def test_L2CAP_ERM_BV_06_C(self):
        """
        L2CAP/ERM/BV-06-C [Resume Transmitting I-Frames when an I-Frame is Received]
        Verify the IUT will cease transmission of I-frames when the negotiated TxWindow is full. Verify the
        IUT will resume transmission of I-frames when an I-frame is received that acknowledges previously
        sent I-frames.
        """
        with self._dut_connection_stream() as dut_connection_stream, \
            self._dut_connection_close_stream() as dut_connection_close_stream:
            due_connection_asserts = EventAsserts(dut_connection_stream)
            due_connection_close_asserts = EventAsserts(
                dut_connection_close_stream)
            psm = 1

            self.device_under_test.l2cap.SetDynamicChannel(
                l2cap_facade_pb2.SetEnableDynamicChannelRequest(
                    psm=psm,
                    retransmission_mode=l2cap_facade_pb2.
                    RetransmissionFlowControlMode.ERTM))
            self._assert_connection_complete(due_connection_asserts)
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self._assert_connection_close(due_connection_close_asserts)
예제 #2
0
    def test_L2CAP_ERM_BI_03_C(self):
        """
        L2CAP/ERM/BI-03-C [Handle Duplicate S-Frame [SREJ]]
        """
        with self._dut_connection_stream() as dut_connection_stream, \
            self._dut_connection_close_stream() as dut_connection_close_stream:
            psm = 1

            self.device_under_test.l2cap.SetDynamicChannel(
                l2cap_facade_pb2.SetEnableDynamicChannelRequest(
                    psm=psm, retransmission_mode=l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM))
            self._assert_connection_complete(dut_connection_stream)
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self._assert_connection_close(dut_connection_close_stream)
예제 #3
0
    def test_L2CAP_ERM_BI_05_C(self):
        """
        L2CAP/ERM/BI-05-C [Handle receipt of S-Frame [REJ] and I-Frame [F=1] that
        Both Require Retransmission of the Same I-Frames]
        """
        with self._dut_connection_stream() as dut_connection_stream, \
            self._dut_connection_close_stream() as dut_connection_close_stream:
            psm = 1

            self.device_under_test.l2cap.SetDynamicChannel(
                l2cap_facade_pb2.SetEnableDynamicChannelRequest(
                    psm=psm, retransmission_mode=l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM))
            self._assert_connection_complete(dut_connection_stream)
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self._assert_connection_close(dut_connection_close_stream)
예제 #4
0
 def test_L2CAP_ERM_BV_01_C(self):
     """
     L2CAP/ERM/BV-01-C [Transmit I-frames]
     Verify the IUT can send correctly formatted sequential I-frames with valid values for the enhanced
     control fields (SAR, F-bit, ReqSeq, TxSeq).
     """
     with self._dut_connection_stream() as dut_connection_stream, \
         self._dut_connection_close_stream() as dut_connection_close_stream:
         psm = 1
         retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM
         self.device_under_test.l2cap.SetDynamicChannel(
             l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, retransmission_mode=retransmission_mode))
         self._assert_connection_complete(dut_connection_stream)
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self._assert_connection_close(dut_connection_close_stream)
    def test_L2CAP_ERM_BV_13_C(self):
        """
        L2CAP/ERM/BV-13-C [Respond to S-Frame [REJ]]
        """
        with self._dut_connection_stream() as dut_connection_stream, \
            self._dut_connection_close_stream() as dut_connection_close_stream:
            due_connection_asserts = EventAsserts(dut_connection_stream)
            due_connection_close_asserts = EventAsserts(
                dut_connection_close_stream)
            psm = 1

            self.device_under_test.l2cap.SetDynamicChannel(
                l2cap_facade_pb2.SetEnableDynamicChannelRequest(
                    psm=psm,
                    retransmission_mode=l2cap_facade_pb2.
                    RetransmissionFlowControlMode.ERTM))
            self._assert_connection_complete(due_connection_asserts)
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
            self._assert_connection_close(due_connection_close_asserts)
예제 #6
0
 def test_L2CAP_ERM_BV_10_C(self):
     """
   L2CAP/ERM/BV-10-C [Retransmit S-Frame [RR] with Poll Bit Set]
   Verify the IUT will retransmit the S-frame [RR] with the Poll bit set when the Monitor Timer expires.
   """
     with self._dut_connection_stream() as dut_connection_stream, \
         self._dut_connection_close_stream() as dut_connection_close_stream:
         psm = 1
         retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM
         self.device_under_test.l2cap.SetDynamicChannel(
             l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, retransmission_mode=retransmission_mode))
         self._assert_connection_complete(dut_connection_stream)
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self._assert_connection_close(dut_connection_close_stream)
예제 #7
0
    def test_L2CAP_COS_CED_BV_03_C(self):
        """
        L2CAP/COS/CED/BV-03-C [Send Data]
        Verify that the IUT is able to send DATA.
        """
        with self._dut_connection_stream() as dut_connection_stream, \
            self._dut_connection_close_stream() as dut_connection_close_stream:
            psm = 1
            retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.BASIC
            self.device_under_test.l2cap.SetDynamicChannel(
                l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, retransmission_mode=retransmission_mode))
            self._assert_connection_complete(dut_connection_stream)

            self.device_under_test.l2cap.SendDynamicChannelPacket(
                l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc' * 34))
            self._assert_connection_close(dut_connection_close_stream)
예제 #8
0
 def test_L2CAP_ERM_BV_20_C(self):
     """
     L2CAP/ERM/BV-20-C [Enter Remote Busy Condition]
     Verify the IUT will not retransmit any I-frames when it receives a remote busy indication from the
     Lower Tester (S-frame [RNR]).
     """
     with self._dut_connection_stream() as dut_connection_stream, \
         self._dut_connection_close_stream() as dut_connection_close_stream:
         psm = 1
         retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM
         self.device_under_test.l2cap.SetDynamicChannel(
             l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, retransmission_mode=retransmission_mode))
         self._assert_connection_complete(dut_connection_stream)
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self._assert_connection_close(dut_connection_close_stream)
예제 #9
0
 def test_L2CAP_ERM_BV_19_C(self):
     """
     L2CAP/ERM/BV-19-C [Receive I-Frame Final Bit = 1]
     Verify the IUT will retransmit any previously sent I-frames unacknowledged by receipt of an I-frame
     with the final bit set.
     """
     with self._dut_connection_stream() as dut_connection_stream, \
         self._dut_connection_close_stream() as dut_connection_close_stream:
         psm = 1
         retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM
         self.device_under_test.l2cap.SetDynamicChannel(
             l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, retransmission_mode=retransmission_mode))
         self._assert_connection_complete(dut_connection_stream)
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self._assert_connection_close(dut_connection_close_stream)
예제 #10
0
 def test_L2CAP_ERM_BV_08_C(self):
     """
     L2CAP/ERM/BV-08-C [Send S-Frame [RR] with Poll Bit Set]
     Verify the IUT sends an S-frame [RR] with the Poll bit set when its retransmission timer expires.
     """
     with self._dut_connection_stream() as dut_connection_stream, \
         self._dut_connection_close_stream() as dut_connection_close_stream:
         due_connection_asserts = EventAsserts(dut_connection_stream)
         due_connection_close_asserts = EventAsserts(
             dut_connection_close_stream)
         psm = 1
         retransmission_mode = l2cap_facade_pb2.RetransmissionFlowControlMode.ERTM
         self.device_under_test.l2cap.SetDynamicChannel(
             l2cap_facade_pb2.SetEnableDynamicChannelRequest(
                 psm=psm, retransmission_mode=retransmission_mode))
         self._assert_connection_complete(due_connection_asserts)
         self.device_under_test.l2cap.SendDynamicChannelPacket(
             l2cap_facade_pb2.DynamicChannelPacket(psm=psm, payload=b'abc'))
         self._assert_connection_close(due_connection_close_asserts)
예제 #11
0
 def send(self, payload):
     self._device.l2cap.SendDynamicChannelPacket(
         l2cap_facade_pb2.DynamicChannelPacket(psm=self._psm,
                                               payload=payload))