Skip to content

Relay sends the pilot value twice, so FlightModel fields carry pilot data #184

Description

@Phlabry

Describe the bug
The generated XML declares two fields per sample, FlightModel* and Pilot* (for example relay/src/update.rs:222-223). The relay fills both with the same number, cloning the single value it received (relay/src/state.rs:584-602).

The duplication originates in the relay, not the plugin. The plugin reads both the flightmodel and pilot datarefs and displays both, but transmits only the eight pilot values (xplane_plugin/src/pilotdatasync-xp11.cpp:418-428). The relay then fabricates the missing half.

Expected behavior
FlightModel* carries the flightmodel value and Pilot* carries the pilot value, so the two can be compared. Being able to see instrument versus true state is the reason there are two fields.

Additional context
The relay already has a generic branch that pairs values correctly (relay/src/state.rs:605-624), but it is unreachable because the 8-field branch matches first. The likely fix is widening the plugin payload to 16 paired values. Yaw is a known exception: no pilot yaw dataref exists, so the plugin deliberately uses the flightmodel value (xplane_plugin/src/pilotdatasync-xp11.cpp:138-139).

Found while writing the setup documentation in #138 / #178.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions