feat(settings): add 2.8 amateur and EU Lite/Narrow LoRa regions - #6548
Conversation
Region picker gains the seven amateur ITU regions plus EU_866/EU_N_868, hidden from pre-2.8 targets via RegionInfo.minFirmware + Capabilities.supportsRegion (remote admin included). Slot math now mirrors firmware applyModemConfig: per-profile spacing/padding and fixed default slots (e.g. ITU2_70CM slot 137 -> 433.650 MHz). Fixes #6547
📝 WalkthroughWalkthroughThe model adds EU and ITU radio regions with regional slot parameters and firmware requirements. Frequency calculations honor spacing, padding, and fixed slots. Capabilities filter unsupported regions from the settings dropdown while preserving the current selection. Tests cover mappings, calculations, and firmware gating. ChangesRegional radio support
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant LoRaConfigItemList
participant Capabilities
participant RegionInfo
LoRaConfigItemList->>Capabilities: check supportsRegion(region)
Capabilities->>RegionInfo: read minFirmware
RegionInfo-->>Capabilities: return firmware requirement
Capabilities-->>LoRaConfigItemList: return supported status
LoRaConfigItemList-->>LoRaConfigItemList: build filtered region dropdown
🚥 Pre-merge checks | ✅ 3 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@core/model/src/commonTest/kotlin/org/meshtastic/core/model/RegionInfoTest.kt`:
- Around line 101-122: Add explicit numChannels assertions for both ITU3_2M and
ITU3_70CM in ham_70cm_and_125cm_regions_use_100kHz_slots, expecting 200 slots
for each region. Keep the existing frequency and channel-selection assertions
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 98e71c3e-86e9-4bc5-b0b7-8f3f92eec584
📒 Files selected for processing (5)
core/model/src/commonMain/kotlin/org/meshtastic/core/model/Capabilities.ktcore/model/src/commonMain/kotlin/org/meshtastic/core/model/ChannelOption.ktcore/model/src/commonTest/kotlin/org/meshtastic/core/model/CapabilitiesTest.ktcore/model/src/commonTest/kotlin/org/meshtastic/core/model/RegionInfoTest.ktfeature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/LoRaConfigItemList.kt
radioFreq() ignores freqEnd, so the default-slot assertions alone would miss a wrong upper band edge.
ChannelOption.minFirmware + Capabilities.supportsPreset() replace the hardcoded TINY filter. MEDIUM_TURBO and LITE/NARROW were offered ungated; pre-2.8 firmware has no modemPresetToParams case for any of them and silently falls back to LongFast. NB: LITE/NARROW enum values shipped in v2.7.23 protobufs but radio support (firmware#10120) is 2.8-only.
Adds the 2.8 firmware regions to the region picker: ITU1/2/3 2m, ITU2 1.25m, ITU1/2/3 70cm, plus EU_866 (Lite) and EU_N_868 (Narrow).
RegionInfo.minFirmware+Capabilities.supportsRegion()hide them from pre-2.8 targets, remote admin included; the current selection is never hiddenapplyModemConfig: per-profile spacing/padding and fixed default slots, so e.g. ITU2_70CM shows slot 137 @ 433.650 MHzChannelOption.minFirmware+supportsPreset()replace the hardcoded TINY filter, and now also gate MEDIUM_TURBO and LITE/NARROW — all 2.8-only in firmware (LITE/NARROW enum values shipped in v2.7.23 protobufs, but themodemPresetToParamscases are 2.8; older firmware silently falls back to LongFast)Fixes #6547