kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
Update with new default modem configurations
rodzic
161af395a4
commit
63d6881458
|
@ -22,7 +22,7 @@ data class Channel(val settings: ChannelProtos.ChannelSettings) {
|
|||
// TH=he unsecured channel that devices ship with
|
||||
val default = Channel(
|
||||
ChannelProtos.ChannelSettings.newBuilder()
|
||||
.setModemConfig(ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr48Sf4096)
|
||||
.setModemConfig(ChannelProtos.ChannelSettings.ModemConfig.LongFast)
|
||||
.setPsk(ByteString.copyFrom(defaultPSK))
|
||||
.build()
|
||||
)
|
||||
|
@ -35,12 +35,13 @@ data class Channel(val settings: ChannelProtos.ChannelSettings) {
|
|||
if (settings.bandwidth != 0)
|
||||
"Unset"
|
||||
else when (settings.modemConfig) {
|
||||
ChannelProtos.ChannelSettings.ModemConfig.Bw500Cr45Sf128 -> "ShortFast"
|
||||
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"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.ShortFast -> "ShortFast"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.ShortSlow -> "ShortSlow"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.MidFast -> "MidFast"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.MidSlow -> "MidSlow"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.LongFast -> "LongFast"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.LongSlow -> "LongSlow"
|
||||
ChannelProtos.ChannelSettings.ModemConfig.VLongSlow -> "VLongSlow"
|
||||
else -> "Invalid"
|
||||
}
|
||||
} else
|
||||
|
|
|
@ -8,12 +8,13 @@ enum class ChannelOption(
|
|||
val configRes: Int,
|
||||
val minBroadcastPeriodSecs: Int
|
||||
) {
|
||||
SHORT(ChannelProtos.ChannelSettings.ModemConfig.Bw500Cr45Sf128,R.string.modem_config_short, 30),
|
||||
MEDIUM(ChannelProtos.ChannelSettings.ModemConfig.Bw125Cr45Sf128, R.string.modem_config_slow_short, 30),
|
||||
MED_FAST(ChannelProtos.ChannelSettings.ModemConfig.Bw250Cr47Sf1024,R.string.modem_config_medium, 60),
|
||||
MED_SLOW(ChannelProtos.ChannelSettings.ModemConfig.Bw250Cr46Sf2048,R.string.modem_config_slow_medium, 60),
|
||||
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_FAST(ChannelProtos.ChannelSettings.ModemConfig.ShortFast,R.string.modem_config_short, 30),
|
||||
SHORT_SLOW(ChannelProtos.ChannelSettings.ModemConfig.ShortSlow, R.string.modem_config_slow_short, 30),
|
||||
MED_FAST(ChannelProtos.ChannelSettings.ModemConfig.MidFast,R.string.modem_config_medium, 60),
|
||||
MED_SLOW(ChannelProtos.ChannelSettings.ModemConfig.MidSlow,R.string.modem_config_slow_medium, 60),
|
||||
LONG_FAST(ChannelProtos.ChannelSettings.ModemConfig.LongFast, R.string.modem_config_long, 240),
|
||||
LONG_SLOW(ChannelProtos.ChannelSettings.ModemConfig.LongSlow, R.string.modem_config_slow_long, 375),
|
||||
VERY_LONG(ChannelProtos.ChannelSettings.ModemConfig.VLongSlow, R.string.modem_config_very_long, 375);
|
||||
|
||||
companion object {
|
||||
fun fromConfig(modemConfig: ChannelProtos.ChannelSettings.ModemConfig?): ChannelOption? {
|
||||
|
|
Ładowanie…
Reference in New Issue