mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-04 06:04:19 -04:00
add LoRa channels (MediumFast, MediumSlow)
This commit is contained in:
@@ -35,9 +35,11 @@ data class Channel(val settings: ChannelProtos.ChannelSettings) {
|
||||
if (settings.bandwidth != 0)
|
||||
"Unset"
|
||||
else when (settings.modemConfig) {
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr45Sf128 -> "Medium"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw500Cr45Sf128 -> "ShortFast"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw31_25Cr48Sf512 -> "LongAlt"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr45Sf128 -> "ShortSlow"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw250Cr47Sf1024 -> "MediumFast"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw250Cr46Sf2048 -> "MediumSlow"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw31_25Cr48Sf512 -> "LongFast"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr48Sf4096 -> "LongSlow"
|
||||
else -> "Invalid"
|
||||
}
|
||||
|
||||
@@ -8,22 +8,12 @@ enum class ChannelOption(
|
||||
val configRes: Int,
|
||||
val minBroadcastPeriodSecs: Int
|
||||
) {
|
||||
SHORT(ChannelProtos.ChannelSettings.ModemConfig.Bw500Cr45Sf128, R.string.modem_config_short, 3),
|
||||
MEDIUM(
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr45Sf128,
|
||||
R.string.modem_config_medium,
|
||||
12
|
||||
),
|
||||
LONG(
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw31_25Cr48Sf512,
|
||||
R.string.modem_config_long,
|
||||
240
|
||||
),
|
||||
VERY_LONG(
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr48Sf4096,
|
||||
R.string.modem_config_very_long,
|
||||
375
|
||||
);
|
||||
SHORT(ChannelProtos.ChannelSettings.ModemConfig.Bw500Cr45Sf128,R.string.modem_config_short, 3),
|
||||
MEDIUM(ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr45Sf128, R.string.modem_config_slow_short, 12),
|
||||
MED_FAST(ChannelProtos.ChannelSettings.ModemConfig.Bw250Cr47Sf1024,R.string.modem_config_medium, 66),
|
||||
MED_SLOW(ChannelProtos.ChannelSettings.ModemConfig.Bw250Cr46Sf2048,R.string.modem_config_slow_medium, 66),
|
||||
LONG(ChannelProtos.ChannelSettings.ModemConfig.Bw31_25Cr48Sf512, R.string.modem_config_long, 240),
|
||||
VERY_LONG(ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr48Sf4096, R.string.modem_config_very_long, 375);
|
||||
|
||||
companion object {
|
||||
fun fromConfig(modemConfig: ChannelProtos.ChannelSettings.ModemConfig?): ChannelOption? {
|
||||
|
||||
Reference in New Issue
Block a user