mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
convert channel builders to dsl
This commit is contained in:
parent
68558e4078
commit
5612d7d7c9
2 changed files with 25 additions and 24 deletions
|
|
@ -1,7 +1,9 @@
|
|||
package com.geeksville.mesh.model
|
||||
|
||||
import com.geeksville.mesh.ChannelProtos
|
||||
import com.geeksville.mesh.ConfigKt.loRaConfig
|
||||
import com.geeksville.mesh.ConfigProtos
|
||||
import com.geeksville.mesh.channelSettings
|
||||
import com.google.protobuf.ByteString
|
||||
|
||||
/** Utility function to make it easy to declare byte arrays - FIXME move someplace better */
|
||||
|
|
@ -25,12 +27,8 @@ data class Channel(
|
|||
|
||||
// The default channel that devices ship with
|
||||
val default = Channel(
|
||||
ChannelProtos.ChannelSettings.newBuilder()
|
||||
.setPsk(ByteString.copyFrom(defaultPSK))
|
||||
.build(),
|
||||
ConfigProtos.Config.LoRaConfig.newBuilder()
|
||||
.setModemPreset(ConfigProtos.Config.LoRaConfig.ModemPreset.LongFast)
|
||||
.build()
|
||||
channelSettings { psk = ByteString.copyFrom(defaultPSK) },
|
||||
loRaConfig { modemPreset = ConfigProtos.Config.LoRaConfig.ModemPreset.LongFast }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue