Loading system/gd/l2cap/classic/cert/cert.cc +20 −4 Original line number Diff line number Diff line Loading @@ -139,8 +139,16 @@ class L2capClassicModuleCertService : public L2capClassicModuleCert::Service { if (request->retransmission_config().mode() == ChannelRetransmissionFlowControlMode::ERTM) { auto option = std::make_unique<RetransmissionAndFlowControlConfigurationOption>(); option->mode_ = RetransmissionAndFlowControlModeOption::ENHANCED_RETRANSMISSION; if (request->retransmission_config().tx_window()) { option->tx_window_size_ = request->retransmission_config().tx_window(); } else { option->tx_window_size_ = 10; } if (request->retransmission_config().max_transmit()) { option->max_transmit_ = request->retransmission_config().max_transmit(); } else { option->max_transmit_ = 20; } option->retransmission_time_out_ = 2000; option->monitor_time_out_ = 12000; option->maximum_pdu_size_ = 1010; Loading @@ -166,8 +174,16 @@ class L2capClassicModuleCertService : public L2capClassicModuleCert::Service { if (request->retransmission_config().mode() == ChannelRetransmissionFlowControlMode::ERTM) { auto option = std::make_unique<RetransmissionAndFlowControlConfigurationOption>(); option->mode_ = RetransmissionAndFlowControlModeOption::ENHANCED_RETRANSMISSION; if (request->retransmission_config().tx_window()) { option->tx_window_size_ = request->retransmission_config().tx_window(); } else { option->tx_window_size_ = 5; } if (request->retransmission_config().max_transmit()) { option->max_transmit_ = request->retransmission_config().max_transmit(); } else { option->max_transmit_ = 1; } option->retransmission_time_out_ = 1000; option->monitor_time_out_ = 2000; option->maximum_pdu_size_ = 1010; Loading system/gd/l2cap/classic/cert/pts_l2cap_test.py +146 −0 Original line number Diff line number Diff line Loading @@ -342,3 +342,149 @@ class PTSL2capTest(PTSBaseTestClass): RetransmissionFlowControlMode.ERTM)) self._assert_connection_complete(due_connection_asserts) self._pending_connection_close(timeout=60) def test_L2CAP_ERM_BV_05_C(self): """ L2CAP/ERM/BV-05-C [Resume Transmitting I-Frames when an S-Frame [RR] 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 S-frame [RR] 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) 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) 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) 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: 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) def test_L2CAP_ERM_BI_04_C(self): """ L2CAP/ERM/BI-04-C [Handle Receipt of S-Frame [REJ] and S-Frame [RR, 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: 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) 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: 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) system/gd/l2cap/classic/cert/simple_l2cap_test.py +376 −12 File changed.Preview size limit exceeded, changes collapsed. Show changes system/gd/l2cap/internal/enhanced_retransmission_mode_channel_data_controller.cc +2 −2 Original line number Diff line number Diff line Loading @@ -499,7 +499,7 @@ struct ErtmController::impl { } bool with_valid_f_bit(Final f) { return f == Final::NOT_SET || tx_state_ == TxState::WAIT_F; return f == Final::NOT_SET ^ tx_state_ == TxState::WAIT_F; } bool with_unexpected_tx_seq(uint8_t tx_seq) { Loading Loading @@ -1011,7 +1011,7 @@ void ErtmController::send_pdu(std::unique_ptr<packet::BasePacketBuilder> pdu) { void ErtmController::SetRetransmissionAndFlowControlOptions( const RetransmissionAndFlowControlConfigurationOption& option) { local_tx_window_ = option.tx_window_size_; remote_tx_window_ = option.tx_window_size_; local_max_transmit_ = option.max_transmit_; local_retransmit_timeout_ms_ = option.retransmission_time_out_; local_monitor_timeout_ms_ = option.monitor_time_out_; Loading system/gd/l2cap/internal/sender.cc +3 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,9 @@ void Sender::UpdateClassicConfiguration(classic::internal::ChannelConfigurationS if (mode == RetransmissionAndFlowControlModeOption::ENHANCED_RETRANSMISSION) { data_controller_ = std::make_unique<ErtmController>(link_, channel_id_, remote_channel_id_, queue_end_, handler_, scheduler_); data_controller_->SetRetransmissionAndFlowControlOptions(config.local_retransmission_and_flow_control_); RetransmissionAndFlowControlConfigurationOption option = config.local_retransmission_and_flow_control_; option.tx_window_size_ = config.remote_retransmission_and_flow_control_.tx_window_size_; data_controller_->SetRetransmissionAndFlowControlOptions(option); data_controller_->EnableFcs(config.fcs_type_ == FcsType::DEFAULT); return; } Loading Loading
system/gd/l2cap/classic/cert/cert.cc +20 −4 Original line number Diff line number Diff line Loading @@ -139,8 +139,16 @@ class L2capClassicModuleCertService : public L2capClassicModuleCert::Service { if (request->retransmission_config().mode() == ChannelRetransmissionFlowControlMode::ERTM) { auto option = std::make_unique<RetransmissionAndFlowControlConfigurationOption>(); option->mode_ = RetransmissionAndFlowControlModeOption::ENHANCED_RETRANSMISSION; if (request->retransmission_config().tx_window()) { option->tx_window_size_ = request->retransmission_config().tx_window(); } else { option->tx_window_size_ = 10; } if (request->retransmission_config().max_transmit()) { option->max_transmit_ = request->retransmission_config().max_transmit(); } else { option->max_transmit_ = 20; } option->retransmission_time_out_ = 2000; option->monitor_time_out_ = 12000; option->maximum_pdu_size_ = 1010; Loading @@ -166,8 +174,16 @@ class L2capClassicModuleCertService : public L2capClassicModuleCert::Service { if (request->retransmission_config().mode() == ChannelRetransmissionFlowControlMode::ERTM) { auto option = std::make_unique<RetransmissionAndFlowControlConfigurationOption>(); option->mode_ = RetransmissionAndFlowControlModeOption::ENHANCED_RETRANSMISSION; if (request->retransmission_config().tx_window()) { option->tx_window_size_ = request->retransmission_config().tx_window(); } else { option->tx_window_size_ = 5; } if (request->retransmission_config().max_transmit()) { option->max_transmit_ = request->retransmission_config().max_transmit(); } else { option->max_transmit_ = 1; } option->retransmission_time_out_ = 1000; option->monitor_time_out_ = 2000; option->maximum_pdu_size_ = 1010; Loading
system/gd/l2cap/classic/cert/pts_l2cap_test.py +146 −0 Original line number Diff line number Diff line Loading @@ -342,3 +342,149 @@ class PTSL2capTest(PTSBaseTestClass): RetransmissionFlowControlMode.ERTM)) self._assert_connection_complete(due_connection_asserts) self._pending_connection_close(timeout=60) def test_L2CAP_ERM_BV_05_C(self): """ L2CAP/ERM/BV-05-C [Resume Transmitting I-Frames when an S-Frame [RR] 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 S-frame [RR] 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) 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) 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) 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: 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) def test_L2CAP_ERM_BI_04_C(self): """ L2CAP/ERM/BI-04-C [Handle Receipt of S-Frame [REJ] and S-Frame [RR, 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: 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) 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: 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)
system/gd/l2cap/classic/cert/simple_l2cap_test.py +376 −12 File changed.Preview size limit exceeded, changes collapsed. Show changes
system/gd/l2cap/internal/enhanced_retransmission_mode_channel_data_controller.cc +2 −2 Original line number Diff line number Diff line Loading @@ -499,7 +499,7 @@ struct ErtmController::impl { } bool with_valid_f_bit(Final f) { return f == Final::NOT_SET || tx_state_ == TxState::WAIT_F; return f == Final::NOT_SET ^ tx_state_ == TxState::WAIT_F; } bool with_unexpected_tx_seq(uint8_t tx_seq) { Loading Loading @@ -1011,7 +1011,7 @@ void ErtmController::send_pdu(std::unique_ptr<packet::BasePacketBuilder> pdu) { void ErtmController::SetRetransmissionAndFlowControlOptions( const RetransmissionAndFlowControlConfigurationOption& option) { local_tx_window_ = option.tx_window_size_; remote_tx_window_ = option.tx_window_size_; local_max_transmit_ = option.max_transmit_; local_retransmit_timeout_ms_ = option.retransmission_time_out_; local_monitor_timeout_ms_ = option.monitor_time_out_; Loading
system/gd/l2cap/internal/sender.cc +3 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,9 @@ void Sender::UpdateClassicConfiguration(classic::internal::ChannelConfigurationS if (mode == RetransmissionAndFlowControlModeOption::ENHANCED_RETRANSMISSION) { data_controller_ = std::make_unique<ErtmController>(link_, channel_id_, remote_channel_id_, queue_end_, handler_, scheduler_); data_controller_->SetRetransmissionAndFlowControlOptions(config.local_retransmission_and_flow_control_); RetransmissionAndFlowControlConfigurationOption option = config.local_retransmission_and_flow_control_; option.tx_window_size_ = config.remote_retransmission_and_flow_control_.tx_window_size_; data_controller_->SetRetransmissionAndFlowControlOptions(option); data_controller_->EnableFcs(config.fcs_type_ == FcsType::DEFAULT); return; } Loading