fix java paths for protos

This commit is contained in:
Kevin Hester 2021-02-27 13:43:55 +08:00
parent bd796524b9
commit 1eaabfc216
11 changed files with 113 additions and 118 deletions

View file

@ -11,10 +11,6 @@ import com.google.zxing.MultiFormatWriter
import com.journeyapps.barcodescanner.BarcodeEncoder
import java.net.MalformedURLException
/** Utility function to make it easy to declare byte arrays - FIXME move someplace better */
fun byteArrayOfInts(vararg ints: Int) = ByteArray(ints.size) { pos -> ints[pos].toByte() }
data class ChannelSet(
val protobuf: AppOnlyProtos.ChannelSet = AppOnlyProtos.ChannelSet.getDefaultInstance()
) {
@ -48,6 +44,13 @@ data class ChannelSet(
/// Can this channel be changed right now?
var editable = false
/**
* Return the primary channel info
*/
val primaryChannel: Channel get() {
return Channel(protobuf.getSettings(0))
}
/// Return an URL that represents the current channel values
/// @param upperCasePrefix - portions of the URL can be upper case to make for more efficient QR codes
fun getChannelUrl(upperCasePrefix: Boolean = false): Uri {