Skip to content

canbus remote request #78994

Answered by henrikbrixandersen
eiten asked this question in Q&A
Sep 25, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote
1. Send rtr with the current zephyr version? can_frame has not rtr-field anymore

You set the CAN_FRAME_RTR flag in flags member in the struct can_frame TX instance.

2. Receive rtr and then send the requested data? If you set the rx filter to an ID, rtr will not trigger the callback/message queue.

You need to enable CONFIG_CAN_ACCEPT_RTR=y to allow incoming RTR frames, add a CAN RX filter for the specific CAN ID and check for the CAN_FRAME_RTR flag in matching RX frames in your callback. If the CAN ID matches and the RTR flag is present, you need to queue up a response TX frame (which can be prepared in advance, if needed).

Hardware support for RTR is very, very different between var…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@eiten
Comment options

@henrikbrixandersen
Comment options

Answer selected by eiten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants