fix channel setting

This commit is contained in:
Kevin Hester 2021-03-05 14:14:17 +08:00
parent d15ff7ed36
commit 390413bd8a
3 changed files with 14 additions and 3 deletions

View file

@ -542,7 +542,10 @@ class MeshService : Service(), Logging {
}.build()
}
TODO("Need to send channels to device")
debug("Sending channels to device")
asChannels.forEach {
setChannel(it)
}
channels = asChannels.toTypedArray()
}
@ -1387,6 +1390,12 @@ class MeshService : Service(), Logging {
})
}
private fun setChannel(channel: ChannelProtos.Channel) {
sendToRadio(newMeshPacketTo(myNodeNum).buildAdminPacket(wantResponse = true) {
setChannel = channel
})
}
/**
* Start the modern (REV2) API configuration flow
*/