Scalar

@SerialInfo
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class Scalar(val multiplier: Int = 1, val decimalExponent: Int = 0, val binaryExponent: Int = 0, val offset: Int = 0)

Annotation added for serializing using BluetoothFormat

When applied to a numeric value, will calculate an integer using (value * [multiplier] * 2.pow([binaryExponent]) * 10.pow([decimalExponent]) + [offset]))

Combine with any Size to set the preferred Length of the value to be encoded

Properties

Link copied to clipboard

the exponent of the binary component the value will be multiplied with so that scaled = value * 2.pow(binaryExponent)

Link copied to clipboard

the exponent of the decimal component the value will be multiplied with so that scaled = value * 10.pow(decimalExponent)

Link copied to clipboard
val multiplier: Int = 1

the multiplier to multiply the value to be encoded with

Link copied to clipboard
val offset: Int = 0

the offset the value will be offset by so that scaled = value + offset