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()
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
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")
def ConfigurationRequest(cid=None): return Capture(L2capMatchers.ConfigurationRequest(cid), L2capCaptures._extract_configuration_request)
def config_request_for_me(self): return L2capMatchers.ConfigurationRequest(self._scid)