repairPresetFor

fun LoRaRegionPresetMap?.repairPresetFor(region: Config.LoRaConfig.RegionCode, current: Config.LoRaConfig.ModemPreset): Config.LoRaConfig.ModemPreset(source)

Returns the modem preset the LoRa form should hold for region given the currently-selected current preset.

Keeps current when it is still legal in region; otherwise falls back to the region's default preset (and, if that is somehow not in the legal set, the first legal preset). Returns current unchanged when region is unconstrained. Licensing is intentionally NOT considered here — auto-swap is about legality; selectability is decided separately by RegionPresetConstraint.isGated.