# How to generate .h just like the content of .hpp

**URL:** <https://forum.opencyphal.org/t/how-to-generate-h-just-like-the-content-of-hpp/946>\
**Category:** Nunavut\
**Created:** [September 23, 2020, 3:40am UTC](https://forum.opencyphal.org/t/how-to-generate-h-just-like-the-content-of-hpp/946 "2020-09-23T03:40:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newcomer](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/n/e5b9ba/32.png) [@newcomer](https://forum.opencyphal.org/u/newcomer)\
**Post date:** [September 23, 2020, 3:40am UTC](https://forum.opencyphal.org/t/how-to-generate-h-just-like-the-content-of-hpp/946/1 "2020-09-23T03:40:00Z")

</div>

![image](https://forum.opencyphal.org/uploads/default/original/1X/b5d137a0fc7e1a656b2f6adbf076c1464e5d6f9b.png)

The templates is here  
[https://github.com/PX4/Firmware/tree/pr-uavcan-v1\_bms\_minimal/src/drivers/uavcan\_v1/templates](https://github.com/PX4/Firmware/tree/pr-uavcan-v1_bms_minimal/src/drivers/uavcan_v1/templates)

 ![image](https://forum.opencyphal.org/uploads/default/original/1X/2f3325f72b1256720387035d76931746ecd5ee6a.png)

for C++ ：  
nnvg --templates templates/ --outdir include --target-language cpp public\_regulated\_data\_types-master/uavcan

However ， what is the command to generate .h just link the content of red rectangle?

---

<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:** [September 23, 2020, 5:27pm UTC](https://forum.opencyphal.org/t/how-to-generate-h-just-like-the-content-of-hpp/946/2 "2020-09-23T17:27:42Z")

</div>

C code generation is not yet there, but it is very close to completion. You can follow the progress here:

> <https://github.com/OpenCyphal/nunavut/pull/115>
>
> \# Notes about code:
> \- Generated code requires libcanard, as its base serializat…ion functions are utilized.
> \- Code is implemented as discussed in #112 
> \- Implemented inline functions return bit length. This is so they can nest easily in the case of not being byte-aligned.
> 
> \# Notes about PR:
> 
> As of creating this, I believe I am mostly done serialization support. There are a few fixes and cleanups to do, but the bulk of it is there. (probably some edge cases I missed too).
> 
> Deserialization support is next, and I will likely finish that tomorrow.
> 
> I will take this PR out of Draft mode once it is in a state I believe should start getting in depth reviews (I will also clean up the commits a bit so you aren't looking through 20 random commits).

---

<div class="post-metadata">

**Author:** ![newcomer](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/n/e5b9ba/32.png) [@newcomer](https://forum.opencyphal.org/u/newcomer)\
**Post date:** [September 24, 2020, 12:19am UTC](https://forum.opencyphal.org/t/how-to-generate-h-just-like-the-content-of-hpp/946/3 "2020-09-24T00:19:04Z")

</div>

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![sdo91](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sdo91](https://forum.opencyphal.org/u/sdo91)\
**Post date:** [October 27, 2020, 2:59pm UTC](https://forum.opencyphal.org/t/how-to-generate-h-just-like-the-content-of-hpp/946/4 "2020-10-27T14:59:00Z")

</div>

@newcomer where did those C++ templates come from, and do you know if there is a more complete version? Thanks.
