refactor config get and set methods

This commit is contained in:
andrekir 2022-09-12 00:26:12 -03:00
parent 346a50a360
commit fd0c8ef9b8
4 changed files with 72 additions and 118 deletions

View file

@ -493,10 +493,8 @@ class MeshService : Service(), Logging {
setChannel(it)
}
val newConfig = ConfigProtos.Config.newBuilder()
val newPrefs = (value.loraConfig).toBuilder()
newConfig.lora = newPrefs.build()
if (localConfig.lora != newConfig.lora) sendDeviceConfig(newConfig.build())
val newConfig = config { lora = value.loraConfig }
if (localConfig.lora != newConfig.lora) sendDeviceConfig(newConfig)
channels = fixupChannelList(asChannels)
}