OpenCyphal / nunavut

Generate code from DSDL using PyDSDL and Jinja2
https://nunavut.readthedocs.io/
Other
39 stars 24 forks source link

[C] Attach type version numbers to service types rather than nested request/response #190

Closed Cherish-forever closed 3 years ago

Cherish-forever commented 3 years ago

exp:

define uavcan_node_ExecuteCommand_Request_1_1_EXTENTBYTES 300UL

define uavcan_node_ExecuteCommand_Request_1_1_SERIALIZATION_BUFFER_SIZEBYTES 258UL

I think define like this will be better:

define uavcan_node_ExecuteCommand_1_1_Request_EXTENTBYTES 300UL

define uavcan_node_ExecuteCommand_1_1_Request_SERIALIZATION_BUFFER_SIZEBYTES 258UL

it will be easy to replace string "ExecuteCommand_1_1" for different version or different protocol.

pavel-kirienko commented 3 years ago

Somewhat relevant discussion here: https://github.com/UAVCAN/nunavut/pull/155

Either format should work but I don't think it's worth changing it just for the sake of auto-renaming convenience.

thirtytwobits commented 3 years ago

Unfortunately we've already discussed where the version should be and decided it belongs on the request and response types. This isn't something we want to make a major/breaking change for even if we could be convinced to change our previous decision. Sorry.