Homepage GitHub

Converting Received Data to CanardFrame

I’m trying to make a service request/response setup with libcanard. I’m a little confused about how data is taken in with the canardRxAccept function. I see the function takes the received data as an arguement in the format of a CanardFrame. How would I pack my raw CAN stream into a CanardFrame? Can I just set it to be the payload of a CanardFrame? Or are all of the attributes of the CanardFrame contained in the data packet? Or am I completely lost?

CanardFrame models one CAN frame. Just assign the fields using the values from your CAN frame as described in the docs:

If you don’t have receive timestamps, just use zero.

Then feed the result into canardRxAccept.