determineSignalQuality

fun determineSignalQuality(snr: Float, modemPreset: Config.LoRaConfig.ModemPreset?, rssi: Int? = null, noiseFloor: Int? = null): Quality(source)

Rates link quality from SNR relative to the active modem preset's demodulation floor (ModemPreset.snrLimit). A given SNR means different things per preset — e.g. -15 dB is excellent on LongSlow (SF12) but unusable on ShortFast (SF7) — so a fixed threshold mis-rates most presets.

RSSI alone cannot indicate whether a signal is demodulable without knowing the noise floor, so it is ignored unless both rssi and noiseFloor are known (design#15, android#6826): when both are present, (rssi - noiseFloor) is rated against the same preset-relative bands as SNR and the worse of the two tiers wins — a strong SNR reading over a noisy channel is still a bad link. With either missing, the rating is SNR-only, unchanged from #5446.

A null/unknown modemPreset falls back to the LongFast default limit.

Without a noise floor, fixed RSSI thresholds cannot account for the preset's bandwidth, so rating stays SNR-only.