fix(tagxl): decode port 10 movement - #205
Conversation
Map status bit 0 to FeatureMoving so Loros GNSS uplinks carry a present moving flag instead of unknown.
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPort 10 GNSS payloads now decode and serialize movement state. The payload implements ChangesPort 10 moving support
Priority: ➖ Normal — Impact reflects medium issue severity. Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Port 10 GNSS uplinks now provide a boolean movement state to downstream consumers while preserving the existing status field. The decoding and serialized behavior are covered for stationary and moving payloads, with no remaining concrete merge-blocking risk. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
✅ Action performedReview finished.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Summary
Loros port 10 GNSS uplinks encode movement in bit 0 of the status byte (firmware commit
45b8a05e). The shared Tag XL decoder kept that byte as opaqueStatusand did not advertiseFeatureMoving, so bridge storedPosition.Movingas nil and the dashboard rendered it as N/A.This maps the same byte to
Movingand advertisesFeatureMoving. Downstream code already consumes that feature; no protobuf, API, or dashboard change is required.Statusstays on the payload for compatibility. Firmware that still writes00now reportsfalserather than unknown. There is no payload version that can recover the previous unknown state.Tag XL, Smart Label v2, and Loros share this decoder. All three now expose the same bit-0 movement flag on port 10.
Closes #203
Test plan
go test ./pkg/decoder/tagxl/v1/go test ./...go vet ./...golangci-lint run ./...make check-json-tags check-metricspre-commit run --all-fileson the changed files00→Moving=false,01→true,02→false(bit 0 only)No database queries or migrations were run.
Summary by CodeRabbit