Unprecise transmitted water ballast from XCS <-> XCV
hjr opened this issue · comments
Describe the bug
100l set on XCS become 96l on XCV side.
100l set on XCV become 94l on XCS side.
To Reproduce
Connect an XCS and XCV. Adjust water ballast setting on one or the other side.
Expected behavior
Could be more precise.
Desktop (please complete the following information):
Linux laptop and XCS & XCV from head.
Issue coming from CAI 302 protocol definition, allowing granularity only 10%.
For classic protocols like Borgelt or Cambridge, there is no way out.
For future XCVario protocol interface, we may add support for better granularity, maybe together with QNH sync from XCS.
Proposal:
Reimplement inherited method to assemble ballast in XCVario protocol in XCSoar side to provide higher resolution by sending a float number with 4 digits precision instead of a single rounded integer, XCV already provides float support (1).
So the issue needs to be moved to XCS, nothing else can be done/is needed from XCV side.
sscanf(str, "!g,b%f", &aballast);