Release v7: complete Z21 LAN protocol, docs, CI/CD, and tooling#3
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v7 release of the Z21 client library.
version.json+ git height); split CI (Build.yml: build/test) from CD (Release.yml: publish to NuGet on push tomain, with--skip-duplicate).Z21.SmokeTestmanual hardware harness.UdpTransportnow implementsIDisposable, so synchronous DI container disposal no longer throws.Testing
Notes
Release.yml, which packs and publishes all five NuGet packages (Z21,Z21.DependencyInjection,Z21.Autofac,CommandStation.Abstractions,CommandStation.Transport.Udp) at the nbgv-computed7.0.xversion.CommandStation.*package IDs.Code review fixes (commit
efe80fa)A max-effort review of this branch against the LAN protocol spec found and fixed the following.
Correctness
LocoInfodecode dropped the last function group (F21–F28, and F29–F31 on FW ≥ 1.42 frames) — an off-by-one in the function-byte loop.CanHandleorOnBytesReceivedsubscriber could permanently kill all inbound handling; the dispatcher and the UDP receive loop now contain it.DisconnectAsync.KeyNotFoundExceptionon out-of-range wire values.DataLenof 0 or above the 1472-byte limit, preventing unbounded buffering on a corrupt length prefix.Validation & diagnostics
SetLocoFunctionrejects a function index above the 6-bit field (0–63).LAN_GET_HWINFOnow surfaces the firmware version alongside the hardware type.LocoSpeedOutOfRangemessages corrected to 14 / 28 / 126.Cleanup
IAddressCodecand used it across the four settings commands; renamed the accessory-mode parameter.MatchesFrameguard onIZ21ResponseHandler; migrated handlers offtry/catch (IndexOutOfRangeException)and removed the tautological XOR checks while keeping the real checksums.AccessoryModeResponseHandlernow implementsIZ21ResponseHandler, soLAN_GET_TURNOUTMODEresponses are discovered and dispatched.All 678 unit tests pass; Debug and Release builds are clean.