reformat per coding conventions

This commit is contained in:
Kevin Hester 2021-03-29 20:33:06 +08:00
parent 2c75d0dee7
commit 5b653d29f8
29 changed files with 207 additions and 149 deletions

View file

@ -1,14 +1,29 @@
package com.geeksville.mesh.model
import com.geeksville.mesh.ChannelProtos
import com.geeksville.mesh.MeshProtos
import com.geeksville.mesh.R
enum class ChannelOption(val modemConfig: ChannelProtos.ChannelSettings.ModemConfig, val configRes: Int, val minBroadcastPeriodSecs: Int) {
enum class ChannelOption(
val modemConfig: ChannelProtos.ChannelSettings.ModemConfig,
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);
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
);
companion object {
fun fromConfig(modemConfig: ChannelProtos.ChannelSettings.ModemConfig?): ChannelOption? {
@ -18,6 +33,7 @@ enum class ChannelOption(val modemConfig: ChannelProtos.ChannelSettings.ModemCon
}
return null
}
val defaultMinBroadcastPeriod = VERY_LONG.minBroadcastPeriodSecs
}
}