feat: add channel editor (#627)

This commit is contained in:
Andre K 2023-04-29 07:14:30 -03:00 committed by GitHub
parent c821eb3681
commit e5a860cb36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 561 additions and 104 deletions

View file

@ -250,6 +250,12 @@ class UIViewModel @Inject constructor(
"Request getOwner error"
)
fun getChannel(destNum: Int, index: Int) = request(
destNum,
{ service, packetId, dest -> service.getRemoteChannel(packetId, dest, index) },
"Request getChannel error"
)
fun getConfig(destNum: Int, configType: Int) = request(
destNum,
{ service, packetId, dest -> service.getRemoteConfig(packetId, dest, configType) },
@ -452,6 +458,10 @@ class UIViewModel @Inject constructor(
this._channelSet = channelSet.protobuf
}
fun setRemoteChannel(destNum: Int, channel: ChannelProtos.Channel) {
meshService?.setRemoteChannel(destNum, channel.toByteArray())
}
/// our name in hte radio
/// Note, we generate owner initials automatically for now
/// our activity will read this from prefs or set it to the empty string