Repository navigation
feat(tagxl): decode ts2 LTE and active GNSS settings on port 151 - #213
Conversation
Add the ts2 settings replies to the shared port 151 layout: - 0xB1 LTE APN, 0xB2 LTE API key (only reported as configured, the key is never decoded) - 0xB3 LTE connection: upload time of day, chunk size, timeout, back-off, retry count - 0xD1 GPS config: scan duration, cool-off, HDOP/VDOP/PDOP thresholds - 0xD2 GPS constellation and power mode Devices that do not report these tags get the new fields as null. Tag 0x46 is unchanged (firmware hash).
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughPort 151 decoding now includes LTE and GPS configuration fields. The decoder extracts values from TLV settings, reports whether an LTE API key is configured without exposing the key, and handles incomplete values. Tests cover decoded, absent, and truncated settings. ChangesPort 151 LTE and GPS settings
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change adds decoding of LTE and GPS settings on port 151. Devices that do not report these tags get null fields. No merge-blocking risk was found. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
niko-kriznik-globtim
left a comment
There was a problem hiding this comment.
Seems okay as a quick fix, but we should probably rethink this a bit... I am interested in knowing if this will result in these additional fields being stored on existing Tag XL devices.
Summary
Loros (ts2-based cellular tracker) is decoded with the Tag XL decoder, but its port 151 replies to the new ts2 LTE and GPS settings decoded to all
null, because port 151 didn't know those tags. This adds them to the shared Tag XL port 151 layout, which serves as the ts2 base.0xB1lteApn0xB2lteApiKeyConfigured(bool only; the API key itself is never decoded)0xB3lteUploadTimeOfDay(min after 00:00 UTC),lteUploadChunkSize,lteConnectionTimeout(s),lteUploadBackoff(min),lteUploadRetryCount0xD1gpsScanDuration(s),gpsCooloffDuration(s),gpsHdopThreshold/gpsVdopThreshold/gpsPdopThreshold(DOP, sent ×10)0xD2gpsConstellation(0–7),gpsPowerMode(0 full, 1 low power)Example:
4c1002d2020201d10a0078000a00000000001e→ GPS+Galileo, low power, scan 120 s, cool-off 10 s, PDOP ≤ 3.0.Notes
null(noomitempty, consistent with existing fields likerotationInvert).0x46is unchanged (stillfirmwareHash). ts2 reports major/minor/patch/hw there, so the Loros firmware version still comes through as a hash-like string. That's out of scope here and will be handled separately.Testing
port151_lte_gnss_test.go: GPS reply, LTE reply (API key not in JSON), empty API key, truncated values, and null behaviour +0x46unchanged for a Tag XL report.go test ./pkg/...,go vet ./pkg/..., gofmt andmake check-json-tagspass.Summary by CodeRabbit