Execute command with parameter response feature disscussion

Problem to be Solved:
In our current setup interfacing with various devices using Cyphal, we encounter limitations with command-response handling. While we can send basic commands and receive a success status, this approach doesn’t scale well for devices that support extensive command sets, as it’s inefficient to create individual services for each possible command.

Our aim is to establish a more flexible communication method that allows sending any command to a device and retrieving the corresponding response. This need arose while using a Raspberry Pi CM4 with ROS2 and Cyphal, where we found the standard command execution in Cyphal insufficient, as it only provides the execution status without the actual response data.

Suggested Solution:
To address this, I propose adding a feature to the Arduino Cyphal execution framework that enables capturing and returning detailed responses from devices. This would not replace the existing execute command but rather augment it with the ability to handle detailed responses, facilitating richer interaction with devices.

The enhancement would involve modifying the DSDL to include a response field capable of conveying detailed information back from the device. This way, users can send commands and directly receive specific data, like device status or measurements, in a streamlined manner.

I have developed a PoC that functions effectively, allowing for serial-like communication with devices, enabling not just command dispatch but also detailed response retrieval. This proves the concept and could serve as a basis for integrating similar functionality into the existing framework.

Request for Input:
Is there interest in the community for such a generic device communication feature? Would this addition align with the broader development goals of the official repository? I am ready to share my implementation and examples to illustrate this proposed functionality.

Yes it might be interesting. I’m not sure what does it have to do with 107-Arduino-Cyphal though; from your description it sounds like you’re simply proposing adding a new field to the ExecuteCommand service response. This can be done in a backward-compatible manner without altering compatibility with existing systems out there. A pull request to the DSDL repository would be accepted.

Meanwhile, if you’re struggling with the limitations of the existing service, you might want to consider using the register API for this. Define a string-valued register, say, sys.command; send commands to execute to it and read responses back. Using Yakut you could go like:

$ y r 125 sys.command "echo 'Hello world!'"
'Hello world!'

Sounds good, I can create the PR to the DSDL repository, do you have any preferences on the name of this field? Some discussions we have had have thought either data or parameter_response could be a good fit

I would just name it output.

I have seen the PR has been accepted and then also modded due to the extent issue, Will this have a trickle down effect into the 107-Arduino-Cyphal library, or shall I need to make another PR with the header files for the DSDL

We shall ask @aentinger

I am open to accept a PR to that end.