constraintFor

fun LoRaRegionPresetMap?.constraintFor(region: Config.LoRaConfig.RegionCode): RegionPresetConstraint?(source)

Resolves the RegionPresetConstraint the firmware advertised for region, or null when there is no constraint information and the client must therefore NOT restrict the preset list. A null result happens when:

  • the map is null (firmware older than 2.8 never sends it),

  • region is absent from region_groups (no firmware table entry — treated as unconstrained),

  • the referenced group_index is out of range (defensive against a malformed map), or

  • the referenced group has no presets (a degenerate/malformed group — must not collapse the picker to nothing).