C++ Development Headers for DIO Pin State Updates?
Posted: 22 Jul 2025, 12:55
I’m currently developing a C++ application that needs to control the output pin states of a RevPi DIO module connected to a RevPi Connect 5. The program runs directly on the RevPi Connect 5 under **Bookworm** (Debian GNU/Linux, kernel `6.6.0-revpi8-rpi-v8`).
Ideally, I’d like to use the symbolic pin names defined in the PiCtory process image (e.g. `"O_1"`) directly in my C++ code to set pin states. From the available documentation and prior discussions (including some with ChatGPT), this appears to be supported via the **`revpi-dev`** package, which provides headers such as `piControlIf.h` and the corresponding shared library (`libpiControl.so`).
However, I’ve been unable to locate `revpi-dev` (or any alternative development package providing those headers) in the Bookworm repositories. Could you advise on:
* How to obtain the necessary headers and libraries for **Bookworm**?
* Whether there is a **newer/recommended API** for accessing named pins in C++ on recent RevPi systems?
As a temporary workaround, I’m using:
```cpp
std::string cmd = "piTest -w " + identifier + "," + (state ? "1" : "0") + " > /dev/null 2>&1";
std::system(cmd.c_str());
```
—but this relies on `std::system`, which spawns a shell process for every call and is not ideal for production use.
Any official guidance or workarounds would be greatly appreciated!
Ideally, I’d like to use the symbolic pin names defined in the PiCtory process image (e.g. `"O_1"`) directly in my C++ code to set pin states. From the available documentation and prior discussions (including some with ChatGPT), this appears to be supported via the **`revpi-dev`** package, which provides headers such as `piControlIf.h` and the corresponding shared library (`libpiControl.so`).
However, I’ve been unable to locate `revpi-dev` (or any alternative development package providing those headers) in the Bookworm repositories. Could you advise on:
* How to obtain the necessary headers and libraries for **Bookworm**?
* Whether there is a **newer/recommended API** for accessing named pins in C++ on recent RevPi systems?
As a temporary workaround, I’m using:
```cpp
std::string cmd = "piTest -w " + identifier + "," + (state ? "1" : "0") + " > /dev/null 2>&1";
std::system(cmd.c_str());
```
—but this relies on `std::system`, which spawns a shell process for every call and is not ideal for production use.
Any official guidance or workarounds would be greatly appreciated!