Lines Matching +full:start +full:- +full:of +full:- +full:frame

5  * SPDX-License-Identifier: Apache-2.0
22 const struct can_frame *frame = user_data; in tx_std_callback_1() local
27 zassert_equal(frame->id, TEST_CAN_STD_ID_1, "ID does not match"); in tx_std_callback_1()
32 const struct can_frame *frame = user_data; in tx_std_callback_2() local
37 zassert_equal(frame->id, TEST_CAN_STD_ID_2, "ID does not match"); in tx_std_callback_2()
40 static void rx_std_callback_1(const struct device *dev, struct can_frame *frame, void *user_data) in rx_std_callback_1() argument
44 assert_frame_equal(frame, &test_std_frame_1, 0); in rx_std_callback_1()
51 static void rx_std_callback_2(const struct device *dev, struct can_frame *frame, void *user_data) in rx_std_callback_2() argument
55 assert_frame_equal(frame, &test_std_frame_2, 0); in rx_std_callback_2()
62 static void rx_std_callback_fd_1(const struct device *dev, struct can_frame *frame, in rx_std_callback_fd_1() argument
67 assert_frame_equal(frame, &test_std_fdf_frame_1, 0); in rx_std_callback_fd_1()
74 static void rx_std_callback_fd_2(const struct device *dev, struct can_frame *frame, in rx_std_callback_fd_2() argument
79 assert_frame_equal(frame, &test_std_fdf_frame_2, 0); in rx_std_callback_fd_2()
87 * @brief Send a CAN test frame with asserts.
89 * This function will block until the frame is transmitted or a test timeout
93 * @param frame Pointer to the CAN frame to send.
95 static void send_test_frame(const struct device *dev, const struct can_frame *frame) in send_test_frame() argument
99 err = can_send(dev, frame, TEST_SEND_TIMEOUT, NULL, NULL); in send_test_frame()
100 zassert_not_equal(err, -EBUSY, "arbitration lost in loopback mode"); in send_test_frame()
101 zassert_equal(err, 0, "failed to send frame (err %d)", err); in send_test_frame()
105 * @brief Send a CAN test frame with asserts.
107 * This function will block until the frame is queued or a test timeout
111 * @param frame Pointer to the CAN frame to send.
114 static void send_test_frame_nowait(const struct device *dev, const struct can_frame *frame, in send_test_frame_nowait() argument
119 err = can_send(dev, frame, TEST_SEND_TIMEOUT, callback, (void *)frame); in send_test_frame_nowait()
120 zassert_not_equal(err, -EBUSY, "arbitration lost in loopback mode"); in send_test_frame_nowait()
121 zassert_equal(err, 0, "failed to send frame (err %d)", err); in send_test_frame_nowait()
137 zassert_not_equal(filter_id, -ENOSPC, "no filters available"); in add_rx_msgq()
161 zassert_not_equal(filter_id, -ENOSPC, "no filters available"); in add_rx_filter()
168 * @brief Perform a send/receive test with a set of CAN ID filters and CAN frames.
172 * @param frame1 CAN frame 1
173 * @param frame2 CAN frame 2
196 if ((frame1->flags & CAN_FRAME_FDF) != 0) { in send_receive()
202 if ((frame2->flags & CAN_FRAME_FDF) != 0) { in send_receive()
242 * @brief Test sending CAN FD frame with too big payload.
246 struct can_frame frame = { in ZTEST() local
255 err = can_send(can_dev, &frame, TEST_SEND_TIMEOUT, NULL, NULL); in ZTEST()
256 zassert_equal(err, -EINVAL, "wrong error on sending invalid frame (err %d)", err); in ZTEST()
260 * @brief Test error when CAN FD Error State Indicator (ESI) is set on transmit frame.
262 * CAN FD Error State Indicator (ESI) indicates that the transmitting node is in error-passive
267 struct can_frame frame = { in ZTEST() local
274 err = can_send(can_dev, &frame, TEST_SEND_TIMEOUT, NULL, NULL); in ZTEST()
275 zassert_equal(err, -ENOTSUP, "wrong error on sending invalid frame (err %d)", err); in ZTEST()
279 * @brief Test send/receive with standard (11-bit) CAN IDs and classic CAN frames.
288 * @brief Test send/receive with standard (11-bit) CAN IDs and CAN FD frames.
297 * @brief Test send/receive with (11-bit) CAN IDs, mixed classic and CAN FD frames.
310 struct can_frame frame; in check_filters_preserved_between_modes() local
329 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in check_filters_preserved_between_modes()
337 err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT); in check_filters_preserved_between_modes()
339 assert_frame_equal(&frame, &test_std_frame_1, 0); in check_filters_preserved_between_modes()
344 err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT); in check_filters_preserved_between_modes()
346 assert_frame_equal(&frame, &test_std_fdf_frame_2, 0); in check_filters_preserved_between_modes()
362 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in check_filters_preserved_between_modes()
366 err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT); in check_filters_preserved_between_modes()
368 assert_frame_equal(&frame, &test_std_frame_1, 0); in check_filters_preserved_between_modes()
373 err = k_msgq_get(&can_msgq, &frame, TEST_RECEIVE_TIMEOUT); in check_filters_preserved_between_modes()
375 assert_frame_equal(&frame, &test_std_fdf_frame_2, 0); in check_filters_preserved_between_modes()
387 zassert_equal(err, 0, "failed to set loopback-mode (err %d)", err); in check_filters_preserved_between_modes()
391 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in check_filters_preserved_between_modes()
432 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
450 err = can_set_bitrate_data(can_dev, min - 1); in ZTEST_USER()
451 zassert_equal(err, -ENOTSUP, "too low data phase bitrate accepted"); in ZTEST_USER()
457 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
472 zassert_equal(err, -ENOTSUP, "too high data phase bitrate accepted"); in ZTEST_USER()
475 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
487 zassert_equal(err, -EINVAL, "invalid sample point of 100.0% accepted (err %d)", err); in ZTEST_USER()
507 zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); in ZTEST_USER()
519 zassert_equal(err, -EBUSY, "wrong error return code (err %d)", err); in ZTEST_USER()
535 zassert_equal(err, -EBUSY, "wrong error return code (err %d)", err); in ZTEST_USER()