Namespace test_cantp

Namespace List > test_cantp

Public Functions

Type Name
test_cantp_stmin_and_bs ()
Verify STmin and block size pacing.
test_cantp_timeout_n_bs ()
Verify N_Bs timeout is detected.
test_cantp_timeout_n_cr ()
Verify N_Cr timeout is detected.
test_cantp_unexpected_pdu ()
Verify unexpected PDU is reported.
test_wait_frame_overrun ()
Verify WAIT frame overrun is reported.
test_wait_frame_then_continue ()
Verify receiver resumes after WAIT then CONTINUE FC.

Protected Functions

Type Name
_fc_frame (flow_status flow_status, block_size block_size, st_min st_min)
Build a Flow Control (FC) frame.
_make_payload (size size)
Build a deterministic payload of a given size.
_poll_until_receive (link link, payload_size payload_size, steps steps, advance_ms advance_ms=0)
Poll the link until a response is received or steps are exhausted.

Public Functions Documentation

function test_cantp_stmin_and_bs

Verify STmin and block size pacing.

test_cantp::test_cantp_stmin_and_bs () 

Advances time to satisfy STmin between frames.


function test_cantp_timeout_n_bs

Verify N_Bs timeout is detected.

test_cantp::test_cantp_timeout_n_bs () 

Disables FC to force a sender block-size timeout.


function test_cantp_timeout_n_cr

Verify N_Cr timeout is detected.

test_cantp::test_cantp_timeout_n_cr () 

Drops incoming frames to force a receiver timeout.


function test_cantp_unexpected_pdu

Verify unexpected PDU is reported.

test_cantp::test_cantp_unexpected_pdu () 

Injects a CF when receiver is idle.


function test_wait_frame_overrun

Verify WAIT frame overrun is reported.

test_cantp::test_wait_frame_overrun () 

Repeated WAIT frames exceed the limit and trigger WFT_OVRN.


function test_wait_frame_then_continue

Verify receiver resumes after WAIT then CONTINUE FC.

test_cantp::test_wait_frame_then_continue () 

WAIT should pause transmission until CONTINUE arrives.


Protected Functions Documentation

function _fc_frame

Build a Flow Control (FC) frame.

test_cantp::_fc_frame (
    flow_status flow_status,
    block_size block_size,
    st_min st_min
) 

Parameters:

  • flow_status Flow status nibble.
  • block_size Block size byte.
  • st_min STmin byte.

Returns:

CAN frame bytes representing the FC.

Encodes the 0x30 PCI for flow control.


function _make_payload

Build a deterministic payload of a given size.

test_cantp::_make_payload (
    size size
) 

Parameters:

  • size Number of bytes to generate.

Returns:

Payload bytes.

Uses a simple modulo pattern for repeatability.


function _poll_until_receive

Poll the link until a response is received or steps are exhausted.

test_cantp::_poll_until_receive (
    link link,
    payload_size payload_size,
    steps steps,
    advance_ms advance_ms=0
) 

Parameters:

  • link ISO-TP link handle.
  • payload_size Expected payload size for receive.
  • steps Maximum number of poll iterations.
  • advance_ms Optional time advance per step in milliseconds.

Returns:

Received payload bytes or None when nothing is received.

Optionally advances the mock time between polls.



The documentation for this class was generated from the following file tests/integration/test_cantp.py