# Using custom DSDL with 107-Arduino-OpenCyphal and PIO

**URL:** <https://forum.opencyphal.org/t/using-custom-dsdl-with-107-arduino-opencyphal-and-pio/1830>\
**Category:** Nunavut\
**Created:** [February 21, 2023, 2:17pm UTC](https://forum.opencyphal.org/t/using-custom-dsdl-with-107-arduino-opencyphal-and-pio/1830 "2023-02-21T14:17:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![not7cd](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/not7cd/32/1329_2.png) [@not7cd](https://forum.opencyphal.org/u/not7cd)\
**Post date:** [February 21, 2023, 2:17pm UTC](https://forum.opencyphal.org/t/using-custom-dsdl-with-107-arduino-opencyphal-and-pio/1830/1 "2023-02-21T14:17:00Z")

</div>

What is recommended way to integrate project-specific namespace to an Arduino project? I’m using PlatformIO, which also has its own dependency management.

Should I generate my headers into `src/types` or `.pio/libdeps/pico/107-Arduino-Cyphal/src/types`?

ref: [Extending DSDL · Issue #205 · 107-systems/107-Arduino-Cyphal](https://github.com/107-systems/107-Arduino-Cyphal/issues/205)  
cc: @aentinger

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [February 23, 2023, 10:24am UTC](https://forum.opencyphal.org/t/using-custom-dsdl-with-107-arduino-opencyphal-and-pio/1830/2 "2023-02-23T10:24:33Z")

</div>

Hi Norbert ☕ 👋

You can compile your custom DSDL using [nnvg](https://github.com/OpenCyphal/nunavut), i.e. see how its done [here](https://github.com/107-systems/107-Arduino-Cyphal/blob/main/extras/script/update_cpp_header.sh#L13-L29) to automatically generate the C++ headers for 107-Arduino-Cyphal.

Then it should be possible to simply add your generated **.hpp** file to your sketch (basically adding it to the project, however that may be achieved on PlatformIO). You may include it and should then be able to instantiate Publishers/Subscribers like this:

```auto
auto my_type_pub = node_hdl.create_publisher<namespace1::namespace2::MyType>
  (MyTypeDefaultId, 1*1000*1000UL /* = 1 sec in usecs. */);

```

**Note** : This requires that you use the latest code from `main`.

If you are using the latest released version ([v2.2.1](https://github.com/107-systems/107-Arduino-Cyphal/releases/tag/2.2.1)) the steps for adding custom types are described [here](https://github.com/107-systems/107-Arduino-Cyphal/blob/58a0391a8373c2d21842040c7dab66bb5ce53f3a/README.md#how-to-add-missing-wrappers).

Please be advised that a **3.0.0** release of 107-Arduino-Cyphal is imminent and scheduled to happen within the next month.
