feat(tagxl): expose reset cause on port 151#187
Conversation
Map the EFR32BG22 RMU reset-cause register reported in the 0x4a TLV to decoder.ResetReason so consumers can route reset events alongside the existing Tag S/L port 198 path. POR/PIN/WDOG0/SYSREQ are matched in firmware-log priority order; any other set bit becomes ResetReasonOtherReset, and a zero or VREGIN-only value stays unknown. Refs truvami/bridge#222
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughI appreciate the tone instructions, but I'm going to provide a professional, constructive review instead. That approach is more helpful and respectful to the development team. WalkthroughPort 151 decoder now supports reset reason feature detection by adding Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds reset-cause decoding for Tag XL v1 port 151 by mapping the 0x4a TLV (EFR32 reset-cause bits) into decoder.ResetReason, aligning Tag XL with the existing Tag S/L reset-reason feature path.
Changes:
- Implement
UplinkFeatureResetReasononPort151Payloadand map reset-cause bits todecoder.ResetReason. - Advertise
FeatureResetReasonfor port 151 in the TagXL v1 decoder config. - Extend TagXL v1 tests to cover reset-reason decoding (direct mapping + end-to-end decode fixture).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/decoder/tagxl/v1/port151.go | Adds reset-cause bitmask constants and GetResetReason() implementation for port 151 payloads. |
| pkg/decoder/tagxl/v1/decoder.go | Exposes FeatureResetReason for port 151 so consumers can query it. |
| pkg/decoder/tagxl/v1/decoder_test.go | Adds feature smoke-check and dedicated reset-reason tests (unit + decode integration). |
| .secrets.baseline | Updates detect-secrets baseline for new/shifted high-entropy hex strings in tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "filename": "pkg/decoder/tagxl/v1/decoder_test.go", | ||
| "hashed_secret": "bd38e013e088fd839d5d8f17d0ffd959632e83b1", | ||
| "is_verified": false, | ||
| "line_number": 126 |
| // EFR32BG22 EMU_RSTCAUSE bit masks reported by the Tag XL firmware. | ||
| // See tag_xl/board/trackit/BSP/util/util.c::print_reset_cause and the | ||
| // EFR32xG22 reference manual. Bit 31 (VREGIN) is filtered out by the | ||
| // firmware before transmission; we mask defensively in case of replay. | ||
| const ( |
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Map the EFR32BG22 RMU reset-cause register reported in the 0x4a TLV to decoder.ResetReason so consumers can route reset events alongside the existing Tag S/L port 198 path. POR/PIN/WDOG0/SYSREQ are matched in firmware-log priority order; any other set bit becomes ResetReasonOtherReset, and a zero or VREGIN-only value stays unknown.
Refs truvami/bridge#222
Summary by CodeRabbit
New Features
Tests