Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tests/drivers/can/api/src/canfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,20 @@ ZTEST(canfd, test_send_fd_dlc_out_of_range)
}

/**
* @brief Test error when CAN FD Error State Indicator (ESI) is send without FD format flag (FDF).
* @brief Test error when CAN FD Error State Indicator (ESI) is set on transmit frame.
*
* CAN FD Error State Indicator (ESI) indicates that the transmitting node is
* in error-passive state. Only valid in combination with CAN_FRAME_FDF.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copied from the CAN API documentation at
https://docs.zephyrproject.org/latest/doxygen/html/group__can__interface.html#ga83f8b7af6eb45e43aaac355de3e69e52
Is it worth to make changes there too?

* CAN FD Error State Indicator (ESI) indicates that the transmitting node is in error-passive
* state, but should never be set explicitly. Setting it is handled in the CAN controller hardware.
*/
ZTEST(canfd, test_send_fd_incorrect_esi)
{
struct can_frame frame = {
.flags = CAN_FRAME_ESI,
.flags = CAN_FRAME_FDF | CAN_FRAME_ESI,
.id = TEST_CAN_STD_ID_1,
.dlc = 0,
};
int err;

Z_TEST_SKIP_IFNDEF(CONFIG_RUNTIME_ERROR_CHECKS);

err = can_send(can_dev, &frame, TEST_SEND_TIMEOUT, NULL, NULL);
zassert_equal(err, -ENOTSUP, "wrong error on sending invalid frame (err %d)", err);
}
Expand Down
Loading