RespiraWorks / Ventilator

Fully-featured ICU ventilator design, optimized for manufacture using commonly available components and free to license. Repository tracks all mechanical, electrical and systems design, software, requirements and regulatory documentation.
Apache License 2.0
130 stars 37 forks source link

Investigate replacing the custom debug protocol with a code generator like protobuf #1073

Open asmodai27 opened 3 years ago

asmodai27 commented 3 years ago

I wonder if we could define this format using protobuffers like we have for the main data protocol? I would not be surprised if it had an implementation for python as well, so we might avoid hard-coding this type of stuff on both ends?

_Originally posted by @martukas in https://github.com/RespiraWorks/Ventilator/pull/1063#discussion_r584163854_

What has to be done Check whether there is a possibility to use a generic solution that would generate the protocol code for both Python and C++ to avoid hard coding data on both ends.

How do you know it has to be done See above quote

Starting points Look into the debug protocol from both the controller_debug script and the controller debug library (debug_types.h and interface.h) There was an attempt to do this in #1134 by @a-vinod, but that code is now likely extremely out of date.

asmodai27 commented 2 years ago

Tangentially to this, adding framing to the debug interface would allow us to use DMA and make the solution to #1298 more elegant than the one in #1305

asmodai27 commented 2 years ago

See #1306 for the framing part of this, which is actually not dependent on using a code-generated protocol.