Namespace 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_statusFlow status nibble.block_sizeBlock size byte.st_minSTmin 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:
sizeNumber 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:
linkISO-TP link handle.payload_sizeExpected payload size for receive.stepsMaximum number of poll iterations.advance_msOptional 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