CheckRequest: send the real board's test-mode handshake
The host waits up to 5s after CheckRequest for TestModeChange ENTER (8C 01 0D) before anything else, and sends no requests until the matching EXIT (8C 00 0C) arrives; vRIO jumped straight to the CheckReply dump, so hosts logged "RIO never came back from check request" and skipped the version exchange. Bracket the per-board BoardOk replies with enter/exit, byte-for-byte what the real v4.2 board sends on the wire tap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,9 @@ namespace VRio.Core.Device;
|
||||
/// <para>Wire behavior (mirroring what RIOJoy expects from the real board):</para>
|
||||
/// <list type="bullet">
|
||||
/// <item>ACKs every well-formed inbound packet, NAKs one with a bad checksum.</item>
|
||||
/// <item>CheckRequest → a BoardOk CheckReply per known board.</item>
|
||||
/// <item>CheckRequest → TestModeChange ENTER, a BoardOk CheckReply per known
|
||||
/// board (the self-test stream), then TestModeChange EXIT — the init
|
||||
/// handshake the real board performs and the game waits (≤5s per step) on.</item>
|
||||
/// <item>VersionRequest → VersionReply with the configured firmware version
|
||||
/// (default 4.2, matching the real board's dumped EPROM).</item>
|
||||
/// <item>AnalogRequest → AnalogReply with the current five axis values.</item>
|
||||
@@ -239,9 +241,14 @@ public sealed class VRioDevice
|
||||
switch (packet.Command)
|
||||
{
|
||||
case RioCommand.CheckRequest:
|
||||
Logged?.Invoke("RX CheckRequest → all boards OK");
|
||||
// Init handshake (verified against a real v4.2 board tap): the
|
||||
// host waits ≤5s for TestModeChange ENTER before anything else,
|
||||
// and sends no requests at all until the matching EXIT arrives.
|
||||
Logged?.Invoke("RX CheckRequest → test mode enter, all boards OK, exit");
|
||||
Send(PacketBuilder.TestModeChange(1));
|
||||
foreach ((byte number, string _) in RioAddressSpace.Boards)
|
||||
Send(PacketBuilder.CheckReply(RioStatusType.BoardOk, number));
|
||||
Send(PacketBuilder.TestModeChange(0));
|
||||
break;
|
||||
|
||||
case RioCommand.VersionRequest:
|
||||
|
||||
Reference in New Issue
Block a user