@@ -235,19 +235,31 @@ def test_receive_multiframe_bad_seqnum(self):
235
235
self .assertIsNone (self .get_tx_can_msg ()) # Do not send flow control
236
236
self .assert_error_triggered (isotp .WrongSequenceNumberError )
237
237
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
+
238
250
def test_receive_timeout_consecutive_frame_after_first_frame (self ):
239
251
self .stack .params .set ('rx_consecutive_frame_timeout' , 200 )
240
252
241
253
payload_size = 10
242
254
payload = self .make_payload (payload_size )
243
255
self .simulate_rx (data = [0x10 , payload_size ] + payload [0 :6 ])
244
256
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
246
258
self .simulate_rx (data = [0x21 ] + payload [6 :10 ])
247
259
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
249
261
self .assert_error_triggered (isotp .ConsecutiveFrameTimeoutError )
250
- self .assert_error_triggered (isotp .UnexpectedConsecutiveFrameError )
262
+ self .assert_error_triggered (isotp .UnexpectedConsecutiveFrameError )
251
263
252
264
def test_receive_recover_timeout_consecutive_frame (self ):
253
265
self .stack .params .set ('rx_consecutive_frame_timeout' , 200 )
0 commit comments