# Converting Received Data to CanardFrame

**URL:** <https://forum.opencyphal.org/t/converting-received-data-to-canardframe/826>\
**Category:** Libcanard\
**Created:** [May 7, 2020, 8:49pm UTC](https://forum.opencyphal.org/t/converting-received-data-to-canardframe/826 "2020-05-07T20:49:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle-pawlowski](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/kyle-pawlowski/32/543_2.png) [@kyle-pawlowski](https://forum.opencyphal.org/u/kyle-pawlowski)\
**Post date:** [May 7, 2020, 8:49pm UTC](https://forum.opencyphal.org/t/converting-received-data-to-canardframe/826/1 "2020-05-07T20:49:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [May 8, 2020, 6:22am UTC](https://forum.opencyphal.org/t/converting-received-data-to-canardframe/826/2 "2020-05-08T06:22:42Z")

</div>

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

> <https://github.com/UAVCAN/libcanard/blob/bec890304a2888bc516416e4ebf252f761558b92/libcanard/canard.h#L179-L200>

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

Then feed the result into `canardRxAccept`.
