def test_credit_based_connection_request_unsupported_le_psm(self): """ Verify that an IUT receiving an LE Credit Based Connection Request on an unsupported LE_PSM will respond with an LE Credit Based Connection Response refusing the connection. """ self._setup_link_from_cert() self.cert_l2cap.get_control_channel().send( l2cap_packets.LeCreditBasedConnectionRequestBuilder(1, 0x34, 0x0101, 2000, 1000, 1000)) assertThat(self.cert_l2cap.get_control_channel()).emits( L2capMatchers.CreditBasedConnectionResponse( result=LeCreditBasedConnectionResponseResult.LE_PSM_NOT_SUPPORTED))
def open_channel_with_expected_result( self, psm=0x33, result=LeCreditBasedConnectionResponseResult.SUCCESS): self.control_channel.send( l2cap_packets.LeCreditBasedConnectionRequestBuilder( 1, psm, 0x40, 1000, 100, 6)) response = L2capMatchers.CreditBasedConnectionResponse(result) assertThat(self.control_channel).emits(response)
def CreditBasedConnectionResponse(): return Capture(L2capMatchers.CreditBasedConnectionResponse(), L2capCaptures._extract_credit_based_connection_response)