@@ -235,19 +235,31 @@ def test_receive_multiframe_bad_seqnum(self):
235235 self .assertIsNone (self .get_tx_can_msg ()) # Do not send flow control
236236 self .assert_error_triggered (isotp .WrongSequenceNumberError )
237237
238+ def test_receive_timeout_consecutive_frame_after_flow_control (self ):
239+ self .stack .params .set ('rx_consecutive_frame_timeout' , 200 )
240+
241+ payload_size = 10
242+ payload = self .make_payload (payload_size )
243+ self .simulate_rx (data = [0x10 , payload_size ] + payload [0 :6 ])
244+ self .stack .process ()
245+ time .sleep (0.2 ) # Should stop receivving after 200 msec
246+ self .stack .process ()
247+ self .assertIsNone (self .rx_isotp_frame ()) # No message received indeed
248+ self .assert_error_triggered (isotp .ConsecutiveFrameTimeoutError )
249+
238250 def test_receive_timeout_consecutive_frame_after_first_frame (self ):
239251 self .stack .params .set ('rx_consecutive_frame_timeout' , 200 )
240252
241253 payload_size = 10
242254 payload = self .make_payload (payload_size )
243255 self .simulate_rx (data = [0x10 , payload_size ] + payload [0 :6 ])
244256 self .stack .process ()
245- time .sleep (0.2 ) # Should stop receivving after 200 msec
257+ time .sleep (0.2 ) # Should stop receivving after 200 msec
246258 self .simulate_rx (data = [0x21 ] + payload [6 :10 ])
247259 self .stack .process ()
248- self .assertIsNone (self .rx_isotp_frame ()) # No message received indeed
260+ self .assertIsNone (self .rx_isotp_frame ()) # No message received indeed
249261 self .assert_error_triggered (isotp .ConsecutiveFrameTimeoutError )
250- self .assert_error_triggered (isotp .UnexpectedConsecutiveFrameError )
262+ self .assert_error_triggered (isotp .UnexpectedConsecutiveFrameError )
251263
252264 def test_receive_recover_timeout_consecutive_frame (self ):
253265 self .stack .params .set ('rx_consecutive_frame_timeout' , 200 )
0 commit comments