Skip to content

feat(settings): add 2.8 amateur and EU Lite/Narrow LoRa regions - #6548

Merged
jamesarich merged 3 commits into
mainfrom
feat/ham-regions
Aug 2, 2026
Merged

feat(settings): add 2.8 amateur and EU Lite/Narrow LoRa regions#6548
jamesarich merged 3 commits into
mainfrom
feat/ham-regions

Conversation

@jamesarich

@jamesarich jamesarich commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

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 hidden
  • slot math now mirrors firmware applyModemConfig: per-profile spacing/padding and fixed default slots, so e.g. ITU2_70CM shows slot 137 @ 433.650 MHz
  • preset gating generalized the same way: ChannelOption.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 the modemPresetToParams cases are 2.8; older firmware silently falls back to LongFast)
  • tests pin slot counts, default frequencies, and the gated region/preset sets to the firmware table

Fixes #6547

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
@github-actions github-actions Bot added the enhancement New feature or request label Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Regional radio support

Layer / File(s) Summary
Regional metadata and frequency calculations
core/model/src/commonMain/kotlin/org/meshtastic/core/model/ChannelOption.kt
RegionInfo now stores spacing, padding, fixed-slot, and minimum-firmware metadata. Channel calculations use regional slot widths. EU and ITU regions are added.
Firmware capability filtering in settings
core/model/src/commonMain/kotlin/org/meshtastic/core/model/Capabilities.kt, feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/LoRaConfigItemList.kt
Capabilities.supportsRegion checks firmware requirements. The region dropdown filters unsupported regions and retains the selected region.
Regional behavior validation
core/model/src/commonTest/kotlin/org/meshtastic/core/model/CapabilitiesTest.kt, core/model/src/commonTest/kotlin/org/meshtastic/core/model/RegionInfoTest.kt
Tests cover firmware gating, region mappings, EU and ITU frequencies, legacy US calculations, and explicit channel selection.

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
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds all listed amateur regions, but no evidence shows support for the required TinyFast and TinySlow presets. Implement and expose TinyFast and TinySlow presets with the required capability gating.
Out of Scope Changes check ⚠️ Warning The EU_866 and EU_N_868 regions are not included in linked issue #6547, which specifies amateur regions and TinyFast/TinySlow presets. Remove the EU region changes or link an issue that explicitly requires them.
Tests Prove The Path, Not The End State ⚠️ Warning Two added tests are non-discriminating: standard_regions_keep_legacy_slot_math matches parent behavior, and explicit_channel_num_wins_over_override_slot exercises the pre-existing explicit-chan... Replace or strengthen these tests. Assert a new region's fixed default slot without channel_num, and verify spacing/padding changes the slot count and frequency.
✅ Passed checks (3 passed)
Check name Status Explanation
Sibling Call Sites And Presence Semantics ✅ Passed The new nullable minFirmware is handled by supportsRegion and has no other call sites; spacing/padding/overrideSlot zero defaults are documented sentinels, not sensor fields. No unfixed NodeItem si...
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the added firmware 2.8 amateur and EU Lite/Narrow LoRa regions.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7bee4ff and d6870fa.

📒 Files selected for processing (5)
  • core/model/src/commonMain/kotlin/org/meshtastic/core/model/Capabilities.kt
  • core/model/src/commonMain/kotlin/org/meshtastic/core/model/ChannelOption.kt
  • core/model/src/commonTest/kotlin/org/meshtastic/core/model/CapabilitiesTest.kt
  • core/model/src/commonTest/kotlin/org/meshtastic/core/model/RegionInfoTest.kt
  • feature/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.
@jamesarich
jamesarich enabled auto-merge August 2, 2026 22:05
@jamesarich
jamesarich added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit c09bf1a Aug 2, 2026
15 checks passed
@jamesarich
jamesarich deleted the feat/ham-regions branch August 2, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support for new Amateur Radio Regions

1 participant